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.
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.
How Rollup decides which modules to drop, why package.json sideEffects is a trust boundary, and the checks that catch a wrong declaration before users do.
Vite's speed comes from two decisions: serving source as native ES modules and pre-bundling dependencies once. Here's how both work, how to verify them, and where they break down.
An architecture note on Vite's HMR: why serving native ES modules instead of a bundle makes updates near-instant, where the trust boundaries sit, and the circular-import and dev/prod divergence failure modes to watch for.