Code Splitting and Lazy Loading Modules
Breaking a JavaScript bundle into smaller chunks loaded on demand, using dynamic import() to reduce the initial page load's JavaScript payload.
Code splitting is the practice of breaking a JavaScript application's bundle into multiple smaller chunks that are loaded on demand, rather than shipping one enormous bundle containing every possible feature's code upfront, regardless of whether the current user actually needs most of it on initial page load. Since unnecessary JavaScript directly delays a page becoming interactive, this is one of the most impactful, practical frontend performance techniques, and it's built on a specific native language feature: dynamic import().
Code splitting is like a restaurant that doesn't print and hand every guest its entire encyclopedic menu including seasonal items, off-menu specials, and the dessert list all at once — it hands you the core menu immediately so you can start ordering right away, and only brings out the dessert menu (a separate chunk) later, specifically once you actually ask for it.