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 it to work and I get Unknown "encore_entry_link_tags" function
What I did:
composer require symfony/webpack-encore-bundle
npm install --save-dev
I'm not sure why this is not working. Any suggestion would be appreciated.
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:
composer require symfony/webpack-encore-bundle
npm install --save-dev
new \Symfony\WebpackEncoreBundle\WebpackEncoreBundle()
to your AppKernel.phpAdd to your config file
webpack_encore:
output_path: "%kernel.root_dir%/../web/build/"
clear cache
I don't know why the Symfony team just assumed everyone would know those 2 steps. Hope it helps
Just run the following 2 cmds:
composer require symfony/webpack-encore-bundle
composer remove symfony/webpack-encore-pack
This fixed the issue for me, apparently they had upgraded webpack encore package with symfony 4;
Here's some reading:
https://symfony.com/blog/encore-0-21-0-webpack-4-support-copy-files-support-webpackencorebundle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With