Magento 2 : Does javascript bundling make any difference?

php bin/magento config:set dev/js/move_script_to_bottom 1
php bin/magento cache:flush
//THis is navigation menu will break with 'function require not //definted error
php bin/magento config:set dev/js/merge_files 1
php bin/magento cache:flush
Javascript merging turned on generates merged files

Merging does not happen during static content deploy, it happens during main page render

All kind of bundling, be it buit-in bundling or be it using tools like magepack, happens during static content deploy phase.

php bin/magento config:set dev/js/enable_js_bundling  1
php bin/magento cache:flush
php bin/magento setup:static-content:deploy
Built in bundling

Through tools, you collect information on javascript modules that are common to all pages and javascript modules that are page specific. Bundles include only what is needed on the given page.

php bin/magento setup:static-content:deploy;
magepack generate
magepack bundle
/* This also requires you to install magepack magento extension along with the magepack npm package */



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store