如何在Shopware开发环境中禁用all.js bundle的JavaScript压缩?
解决Shopware禁用JS压缩时的配置错误
问题描述
为阻止Shopware压缩all.js bundle中的JavaScript代码,按照指引在config/packages/shopware.yaml中添加了以下配置:
shopware: storefront: bundle: minify: false
部署时触发错误:
无法识别"shopware"下的"storefront"选项。可用选项包括:"admin_worker"、"api"、"auto_update"、"cache"、"cart"、"cdn"、"dal"、"deployment"、"feature"、"filesystem"、"html_sanitizer"、"increment"、"logger"、"media"、"sales_channel_context"、"sitemap"、"store"。
解决方案
错误源于配置路径错误,storefront相关配置不属于shopware根节点的子选项,正确操作如下:
- 打开或创建
config/packages/storefront.yaml文件 - 在其中添加正确配置:
storefront: bundle: minify: false - 删除
shopware.yaml中之前添加的错误配置段 - 执行缓存清理命令后重新部署:
bin/console cache:clear
内容的提问来源于stack exchange,提问作者user24603331
相关产品推荐
相关产品推荐

