未知的"encore_entry_link_tags"使用Webpack Encore ^ 0.21.0时的功能 [英] Unknown "encore_entry_link_tags" function when using Webpack Encore ^0.21.0
问题描述
我想使用Webpack Encore的新版本来访问它提供的所有新功能.但是,按照
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
我做了什么:
- 更新我的php版本以匹配Webpack Encore软件包(> 7.1.9)的要求
- 运行
composer require symfony/webpack-encore-bundle
- 更新package.json 0.21.0上的encore版本
- 运行
npm install --save-dev
- 清除缓存
- Update my php version to match requierement of Webpack encore bundle (>7.1.9)
- run
composer require symfony/webpack-encore-bundle
- update the version of encore on the package.json 0.21.0
- run
npm install --save-dev
- clear cache
我不确定为什么这不起作用.任何建议将不胜感激.
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:
- 更新我的php版本以匹配Webpack Encore软件包(> 7.1.9)的要求
- 运行
composer require symfony/webpack-encore-bundle
- 更新package.json 0.21.0上的encore版本
- 运行
npm install --save-dev
- 将
new \Symfony\WebpackEncoreBundle\WebpackEncoreBundle()
添加到您的AppKernel.php -
添加到您的配置文件
- Update my php version to match requierement of Webpack encore bundle (>7.1.9)
- run
composer require symfony/webpack-encore-bundle
- update the version of encore on the package.json 0.21.0
- run
npm install --save-dev
- Add
new \Symfony\WebpackEncoreBundle\WebpackEncoreBundle()
to your AppKernel.php Add to your config file
webpack_encore:
output_path: "%kernel.root_dir%/../web/build/"
清除缓存
clear cache
我不知道为什么Symfony团队只是假设每个人都知道这两个步骤.希望对您有帮助
I don't know why the Symfony team just assumed everyone would know those 2 steps. Hope it helps
这篇关于未知的"encore_entry_link_tags"使用Webpack Encore ^ 0.21.0时的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!