All you need to know about JavaScript code splitting

Modern sites often combine all of their JavaScript into a single, large main.js script. This regularly contains the scripts for all your pages or routes, even if users only need a small portion for the page they’re viewing. 

When JavaScript is served this way, the loading performance of your web pages can suffer – especially with responsive web design on mobile devices. So let’s fix it by implementing JavaScript code splitting.

 What problem does code splitting solve? 

When a web browser sees a