菜单

Some important command in Magento2 after you change the mode to production

2022年07月19日 - magento

From the Magento root directory, switch to production mode:

bin/magento deploy:mode:set production

Enable JavaScript bundling:

bin/magento config:set dev/js/enable_js_bundling 1

Optimize bundling by minifying JavaScript files:

bin/magento config:set dev/js/minify_files 1

Enable cache busting on static file URLs. This ensures users get the latest version of the assets anytime they update:

bin/magento config:set dev/static/sign 1

To configure JavaScript bundling, you must disable Javascript file merging. Bundling will not work as the merging of files excludes bundling:

bin/magento config:set dev/js/merge_files 0

Enable move JavaScript to bottom :

bin/magento config:set dev/js/move_script_to_bottom 1

Deploy Static content for specific Theme

php bin/magento setup:static-content:deploy --theme {Vendor}/{theme} en_US

发表评论

电子邮件地址不会被公开。 必填项已用*标注