Capítulo 421 de 456
Experimental config (experimental.turbopackChunking) that tunes how Turbopack splits client-side JS into chunks in production — trade-off between initial page load performance and navigation performance.
minChunkSize (default 50000): avoids more than one chunk smaller than this size by merging; higher = fewer/larger chunks.maxChunkCountPerGroup (default 40): max chunks per chunk group (route or dynamic import); lower = more aggressive merging.maxMergeChunkSize (default 200000): a chunk larger than this is never merged with others.clusters: array of RegExp arrays grouping routes commonly visited together; chunks shared within a cluster merge more eagerly.firstPageLoadPriority (0-1): weight given to first page load benefit; higher merges more eagerly.priorityRoutes / priorityBoost (default 1.5): routes likely to be entry points get their bundles merged more aggressively.requestCost (default 200000): estimated cost in bytes of an extra request; higher biases toward fewer/larger chunks.const nextConfig = {
experimental: {
turbopackChunking: {
minChunkSize: 50000,
maxChunkCountPerGroup: 40,
maxMergeChunkSize: 200000,
},
},
} satisfies NextConfig
clusters e priorityRoutes deixam você ensinar o chunker sobre padrões reais de navegação do seu site.