Rollup manualChunks: Splitting Vendor Code for Real Caching Wins
Learn how Rollup's manualChunks option separates vendor libraries from application code, improving browser cache reuse and reducing re-downloads on every deploy.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how Rollup's manualChunks option separates vendor libraries from application code, improving browser cache reuse and reducing re-downloads on every deploy.
Stop shipping unused code. Learn how Rollup's tree shaking uses ESM static analysis to prune dead code and how to avoid the common 'side effect' pitfalls that break production apps.
Spot and fix Rollup tree‑shaking failures that leave unused code in your bundle. Follow a step‑by‑step diagnostic checklist, example config, and verification steps to reduce bundle size.
Learn how Rollup's preserveModules option keeps your ES module file structure intact while allowing tree‑shaking of external dependencies.
Diagnose Rollup circular dependency warnings by reading the module chain, extracting shared code to a leaf module, deferring with dynamic import, or externalizing third-party cycles.
Learn how Rollup's manualChunks option separates vendor code into a stable chunk, improving long‑term caching and reducing unnecessary downloads.
A decision guide for publishing a library with Rollup: why dual es + cjs output is the practical default, how external and sideEffects settings make or break tree-shaking, and how to validate the result.
Rollup's tree-shaking works because ES modules are statically analyzable. Here's how it prunes unused code, a verifiable example, and the side-effect and CommonJS pitfalls that defeat it.
Rollup’s sideEffects flag lets you prune unused code, but it must be used carefully. Learn how to set the flag, test bundle size gains, and avoid breaking your app.