Rollup Tree-Shaking: An Architecture Note on Dead-Code Elimination
Tree-shaking is a static-analysis contract, not a minifier toggle. Here is the smallest Rollup design that satisfies it, plus checks and failure modes.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Tree-shaking is a static-analysis contract, not a minifier toggle. Here is the smallest Rollup design that satisfies it, plus checks and failure modes.
Learn how Notion Relations and Rollups automate cross‑table aggregates like task counts and completion percentages for lightweight project tracking.
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.
Learn how Rollup's tree shaking removes unused code through static analysis of ES Modules and how to avoid common pitfalls like side effects and CommonJS dependencies.
Learn how to configure Rollup’s built‑in tree‑shaking to drop dead exports, understand its limits, and verify that the bundle really shrinks.
Automatic Chunking Behavior Rollup automatically creates separate chunks for modules imported via dynamic import() . However, the internal algorithm used to determine which modules share a chunk remains opaque, and the tool does not enforce a default maximum chunk size. Constraints and Uncertainty While output.manualChunks allows for explicit grouping, it re
Asset Resolution Divergence Vite's development server handles asset resolution from memory using root-relative paths. However, the production build process uses Rollup to rewrite asset URLs based on the base configuration in vite.config.js . This creates a discrepancy when an application is hosted under a subpath (e.g., /my-app/ ) or a CDN prefix rather than
Goal Reduce notification noise in a Rollup build pipeline while preserving critical alerts. The onwarn hook allows selective suppression of warning messages such as circular dependencies, but the exact scope of suppression remains unclear. Constraints The hook must call the provided warn() for warnings that should still surface. Suppressing too many codes ma