How to set min chunk size with turbopack? #92879
SummaryOur waterfall is a ton of small chunks that spend most time waiting for server.
How can we merge those chunks? Additional informationUsing "slow 4G" throttling ExampleNo response |
Replies: 2 comments 2 replies
|
There's no direct // next.config.js
module.exports = {
experimental: {
turbopackChunkingHeuristics: {
requestCost: 1000000, // bump toward the max to bias hard toward merging
},
},
}Raising it tells the algorithm "each extra request is expensive," so it merges more aggressively into fewer, bigger chunks instead of leaving you with the long tail of small ones you're seeing in the waterfall. That's exactly the tradeoff you want under throttled conditions like your slow 4G test, fewer round trips beats smaller individual payloads once RTT dominates. If it's specifically your homepage/entry route that's suffering, there are two more knobs in the same block worth knowing: |
|
Starting with 16.3, One of those options is indeed,
|


Starting with 16.3,
turbopackChunkingoptions were added, by this PR #96398One of those options is indeed,
minChunkSize: