Skip to content

What is Code-Splitting by Route?

Automatic chunking of JavaScript per route so visitors download only what the current page needs. SvelteKit splits at route boundaries by default, keeping dashboard code out of marketing pages and initial loads lean.

Example

Because routes split automatically, the interactive dashboard bundle never loads on a marketing page visit. Each section ships its own chunk, so first visits stay light even as the app grows.

What people get wrong

Importing dashboard utilities into shared layout code drags them into every chunk. Keep route-only imports inside route modules so the splitter can do its job.

Sources

Browse all Build & Render Performance terms →