Unknown “encore_entry_link_tags” function when using Webpack Encore ^0.21.0

前端 未结 3 1514
野的像风
野的像风 2021-01-07 23:12

I would like to use the new version of Webpack encore to have access to all the new features it offers. however after following the steps in the official guide I can\'t make

3条回答
  •  渐次进展
    2021-01-08 00:10

    After digging a bit, I found that I omitted some steps (not mentioned on the guide). Maybe it's obvious for others but in my case it was not.

    Here are all the steps in order for it to work:

    1. Update my php version to match requierement of Webpack encore bundle (>7.1.9)
    2. run composer require symfony/webpack-encore-bundle
    3. update the version of encore on the package.json 0.21.0
    4. run npm install --save-dev
    5. Add new \Symfony\WebpackEncoreBundle\WebpackEncoreBundle() to your AppKernel.php
    6. Add to your config file

      webpack_encore:
          output_path: "%kernel.root_dir%/../web/build/"
      
    7. clear cache

    I don't know why the Symfony team just assumed everyone would know those 2 steps. Hope it helps

提交回复
热议问题