Cache Vendor Code with Rollup's manualChunks for Stable Long‑Term Builds
Learn how Rollup's manualChunks option separates vendor code into a stable chunk, improving long‑term caching and reducing unnecessary downloads.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how Rollup's manualChunks option separates vendor code into a stable chunk, improving long‑term caching and reducing unnecessary downloads.
Use Rollup's output.manualChunks to split node_modules into a stable vendor chunk, keeping library code cached across deploys while your app code changes.
Rollup's manualChunks lets you split stable vendor dependencies from churning app code so browsers keep cached third-party code across deploys. Here's a working config, how to verify it, and when splitting backfires.
Reduce initial bundle size by using Rollup's dynamic import() and manualChunks to isolate vendor libraries and lazy-load feature modules on demand.
A production vite build emits Vite's documented warning that a generated chunk exceeds the size threshold after minification (500 kB by default, adjustable via build.chunkSizeWarningLimit ). The flagged output is a single vendor-style chunk, and the goal is to reduce its real impact on users rather than merely silence the warning. The constraint is that Vite
Our Rollup build uses format "es" with two entry points and dynamic imports, so Rollup automatically factors shared modules into shared chunks. We need repeatable, cache-friendly output: [hash] placeholders in chunkFileNames should only change when the code that chunk contains actually changes. The trade-off is between two documented approaches. Default chun