Subscribe

DevelopmentNews

How Turbopack chunks your JavaScript

Turbopack’s chunking speeds up page loads and enables sharing code across pages. We shipped new experimental features to improve chunking in Next.js 16.3.

Published By Sam Poder · 1 min read

Open the network tab of this page and you’ll see a list of JavaScript files with seemingly random names:

Click on one of them, unminify it, and you’ll find something like this:

That's a chunk. Turbopack generates dozens of them for your Next.js app, holding your own code, the packages you depend on, and the runtime that wires it all together.

“Chunking” is the process of deciding which code goes into which chunk. There are a lot of ways to do chunking, each with their own tradeoffs.

Let's start with the simplest approach: one chunk containing all the JavaScript your app uses.

All 355 modules in one chunk, loaded on every page.

This is an excerpt. The full article is published by Next.js Blog.

Continue reading at Next.js Blog