Eliminate duplicate Babel helper code by externalizing runtime helpers to @babel/runtime. This architecture note covers requirements, the minimal plugin design, trust boundaries, operational checks, and failure modes for @babel/plugin-transform-runtime.
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.