Magento 2:如何禁用“缩小CSS JS”设置?


11

我去了管理面板。

然后我去了

商店>配置>高级>开发人员> CSS设置

商店>配置>高级>开发人员> JavaScript设置

并启用最小化CSS和Javascript。

现在,我网站的CSS和JS无法正常工作。我的管理面板和网站已损坏。如何禁用此设置?

Answers:


27

访问您的MySQL并使用以下命令:

UPDATE `core_config_data` SET `value`='0' WHERE `path`='dev/js/merge_files';
UPDATE `core_config_data` SET `value`='0' WHERE `path`='dev/js/enable_js_bundling';
UPDATE `core_config_data` SET `value`='0' WHERE `path`='dev/js/minify_files';
UPDATE `core_config_data` SET `value`='0' WHERE `path`='dev/css/merge_css_files';
UPDATE `core_config_data` SET `value`='0' WHERE `path`='dev/css/minify_files';

或者,您可以在终端中使用Magerun

magerun config:store:set dev/js/merge_files 0
magerun config:store:set dev/js/enable_js_bundling 0
magerun config:store:set dev/js/minify_files 0
magerun config:store:set dev/css/merge_css_files 0
magerun config:store:set dev/css/minify_files 0

然后运行以下命令以再次部署:

alias mage="php -d memory_limit=-1 -f bin/magento"

mage cache:flush &
mage indexer:reindex &
mage setup:upgrade &&
mage deploy:mode:set developer &&
mage setup:static-content:deploy -f &&
chmod -R 775 pub/static/ pub/media/ var/

感谢您的回答。我运行mysql脚本,并成功运行。它将表中的某些值从1更改为0。我现在需要运行setup:upgrade吗?
kashish

我建议运行所有这些最后命令
RafaelCorrêaGomes

哦好的。尝试一下。
kashish

如果我处于开发人员模式,则无需运行setup:static-content:deploy。对吗?
kashish '17

您不需要,但我建议您跑步
RafaelCorrêaGomes

2
php bin/magento config:set dev/js/merge_files 0
php bin/magento config:set dev/js/enable_js_bundling 0
php bin/magento config:set dev/js/minify_files 0
php bin/magento config:set dev/css/merge_css_files 0
php bin/magento config:set dev/css/minify_files 0
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.