next.js
7225f678 - turbopack: document chunking defaults as minified sizes (#102540)

Commit
2 days ago
turbopack: document chunking defaults as minified sizes (#102540) ### What? The Turbopack chunking size defaults are now documented, and defined in code, as *minified* sizes. When chunk items are measured unminified, the defaults are multiplied by 2.5 (`experimental.turbopackMinifyBeforeChunking: false`, or minification turned off). **The resolved values are unchanged for every configuration.** Only the documented base and the direction of the scaling are different. | Option | Default | Unminified (×2.5) | |---|---:|---:| | `minChunkSize` | 20,000 | 50,000 | | `maxMergeChunkSize` | 80,000 | 200,000 | | `maxChunkSize` | 400,000 | 1,000,000 | | `minComponentChunkSize` | 8,000 | 20,000 | | `requestCost` | 80,000 | 200,000 | | `minServerChunkSize` | 1,600 | 4,000 | | `maxMergeServerChunkSize` | 40,000 | 100,000 | | `maxServerChunkSize` | 4,000,000 | 10,000,000 | ### Why? `turbopackMinifyBeforeChunking` is on by default since #102377. Before this change, the docs and JSDoc listed the unminified sizes (e.g. `maxChunkSize: 1000000`) and then explained that in the default configuration they are scaled down to 40%. In other words, none of the documented numbers applied unless you opted out. As @bgw put it in the [#102377 review](https://github.com/vercel/next.js/pull/102377#discussion_r4725075723), this should be flipped: make the defaults the smaller values, and multiply them by 2.5 when the option is disabled. After the next release the option will be removed. <!-- NEXT_JS_LLM --> <!-- fleet f0961053-7ba9-483f-a687-c98399d2ed19 --> --------- Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by: Luke Sandberg <210140+lukesandberg@users.noreply.github.com>
Author
Parents
Loading