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.
Mixing CoffeeScript with Node ES modules fails on output format, not syntax. Compile one file, inspect it, then choose pre-compilation or the register hook.
Rollup wraps every bundled module, including the ES module entry point, in a function where this is undefined under strict mode. An entry point that references top-level this while expecting the global object then produces the documented THIS_IS_UNDEFINED warning, and the runtime binding stays undefined even when the warning is filtered out. The context and
CoffeeScript default CommonJS module output incompatible with ES‑module bundlers The CoffeeScript compiler (v1.x) emits CommonJS require and module.exports statements by default. Production builds that bundle the generated JavaScript with tools configured for ES modules (e.g., Webpack, Rollup) often encounter runtime errors such as Uncaught ReferenceError: m
Module execution state not preserved across Turbo Drive visits Turbo Drive replaces the <body> while keeping the <head> intact during navigation, but <script type="module"> elements in the new page cause their modules to re-evaluate on every visit. This behavior can duplicate initialization side effects — such as event listener registration
Moving a local module-based project into a Pen I have a small front-end project that builds locally with Vite, where dependencies are imported using bare specifiers such as import _ from 'lodash' . I want to reproduce the same code as a CodePen Pen for sharing, but I am unclear which parts of the module workflow CodePen actually supports and which require re