A 410 KB vendor chunk that invalidated on every dependency update, of which 280 KB was a date library used in two places.
build: {
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules/chart.js')) return 'charts'
if (id.includes('node_modules')) return 'vendor'
},
},
},
}
// vendor 410 KB → 118 KB
// charts 292 KB, loaded on two routes only
Splitting a rarely-used heavy dependency into its own chunk is the version of this that pays; splitting by package name in general produces dozens of small requests and is worse. The date library was the other half of the story — replacing it with the platform’s own formatting removed 280 KB entirely, which no amount of chunking would have matched.