Splitting Vendor Code in Rollup with output.manualChunks
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.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
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 ES-module-native design enables aggressive tree-shaking and automatic code-splitting. A reproducible example shows both mechanisms, plus the sideEffects and CommonJS pitfalls.
Learn how Rollup analyzes ES module graphs to drop unused exports, see a minimal configuration example, and understand the limits and common pitfalls that affect tree-shaking effectiveness.
Learn how to turn on Rollup’s built‑in tree‑shaking, verify that unused exports are removed, and recover if needed code is dropped.
Learn how to use Rollup’s output.plugins hook to generate deterministic, readable filenames for code‑split chunks while avoiding collisions and preserving cache‑busting benefits.
Rollup's tree shaking uses ES Module static structure to drop unused exports. Learn how the treeshake config tunes aggressiveness, why sideEffects flags matter, and how to verify the output in CI.
A systematic diagnostic sequence for Rollup's three most common failures: unresolved modules, missing exports, and unexpected bundle bloat — with fixes tied to each finding.
Learn how to use Rollup's code splitting and dynamic imports to reduce redundant downloads and optimize browser caching for multi-entry applications.
A decision guide to Rollup code splitting: when to use entry-point chunks, a manualChunks function, or preserveModules, with working configs and validation steps.