Symfony6中的资产 - 清单。
我正在学习Symfony,跟随Tuto。问题是,是与Symfony5一起使用,我正在使用Symfony6。 图托说要在公共目录中创建一个资产文件夹,我做到了:
当我使用twig调用我的bootstrap.css时: < link href =“ {{Assets('Assets/css/css/bootstrap.min.css')}}}}}}“ rel =“ stylesheet”>
我得到此错误: 在渲染模板的渲染过程中抛出了一个例外(“资产清单文件”/Applications/mamp/htdocs/laboutiquefr/public/public/build/manifest.json不存在。您是否忘记忘记使用NPM构建资产还是纱?”)。
我的问题是:
- 如何修复此清单。
- 我看到一个带有Symfony6的资产文件夹,该文件夹与Symfony5的tuto上不存在。我应该使用这个文件夹吗?
非常感谢。
I'm learning Symfony, following a tuto. Problem is, it is with Symfony5 and i'm using Symfony6.
The tuto says to create an assets folder in public directory, which I did :
When I use Twig to call my bootstrap.css like this :<link href="{{ assets('assets/css/bootstrap.min.css' )}}" rel="stylesheet">
I get this error :An exception has been thrown during the rendering of a template ("Asset manifest file "/Applications/MAMP/htdocs/laboutiquefr/public/build/manifest.json" does not exist. Did you forget to build the assets with npm or yarn?").
My questions are :
- How do I fix this manifest.json error ?
- I see an assets folder with Symfony6, which is not on the tuto with Symfony5. Should I use this folder instead ?
Thank you very much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用命令使用命令来更新CSS/JS/映像时,需要构建资产。
在使用YARN或
NPM运行手表
时,这应该建立您的资产(并创建清单。引用这些资产)。
You need to build asset when updating css/js/images by using the command:
yarn encore dev --watch
when using yarn ornpm run watch
when using npm.This should build your assets (and create a manifest.json referencing those assets).