Blanket core-js imports bloat bundles and risk overriding natives. Targeted modular imports with runtime feature detection give smaller builds and safer polyfills for web and Node 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.
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.
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.
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.