Rollup tree-shaking removes dead code, but unused exports often persist. This guide diagnoses the conditions, provides a cause table, ordered checks, and fixes to reclaim bundle size.
Deno executes TypeScript files natively without a separate compile step. This guide covers running .ts files directly, adding permissions, enabling static checks with --check, importing remote modules, and handling startup latency and cache issues.
Use Vite library mode and Rollup externals to ship a component library that consumers can tree-shake, without shipping React or Vue inside your bundle.
Configure Rollup with format es and preserveModules true to emit a directory of ES files that mirrors your source, enabling downstream tree‑shaking without bundling the whole library.
A practical audit for Rollup bundles: identify exports that survive tree shaking, decide between moduleSideEffects and /*@__PURE__*/ annotations, and verify the result without breaking side-effect code.
Decide between Vite's esnext ESM target and legacy fallback bundles. Compare build size, speed, and browser support with a practical configuration and validation checklist.
Learn how Vite’s native ES module serving eliminates bundling in development, giving near‑instant start and precise Hot Module Replacement, with a concrete setup example and notes on browser support and monorepo considerations.