未知的"encore_entry_link_tags"使用Webpack Encore ^ 0.21.0时的功能 [英] Unknown "encore_entry_link_tags" function when using Webpack Encore ^0.21.0

查看:91
本文介绍了未知的"encore_entry_link_tags"使用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

我做了什么:

  1. 更新我的php版本以匹配Webpack Encore软件包(> 7.1.9)的要求
  2. 运行composer require symfony/webpack-encore-bundle
  3. 更新package.json 0.21.0上的encore版本
  4. 运行npm install --save-dev
  5. 清除缓存
  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. 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:

  1. 更新我的php版本以匹配Webpack Encore软件包(> 7.1.9)的要求
  2. 运行composer require symfony/webpack-encore-bundle
  3. 更新package.json 0.21.0上的encore版本
  4. 运行npm install --save-dev
  5. new \Symfony\WebpackEncoreBundle\WebpackEncoreBundle()添加到您的AppKernel.php
  6. 添加到您的配置文件

  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/"

  • 清除缓存

  • 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屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆