Hiprup

What is code splitting?

Code splitting breaks a large bundle into smaller chunks loaded on demand, so users download only what they need.

  • Dynamic import() — load a module when it's actually used.

  • Route-based — load each page's code when the user navigates there.

  • Benefit — faster initial load and less wasted bandwidth.

Automatic: bundlers like Webpack and Vite create the split chunks from dynamic imports.

dynamic import() is the mechanism. Route-based splitting is the most impactful (each page loads independently).

Bundlers (Webpack, Vite) handle the actual splitting. The result: faster initial load because users download only what they need.

What is code splitting? | Hiprup