Rollup Popularized the Term Tree Shaking
Ask a JavaScript developer why their production bundle is smaller than the sum of its dependencies and you will usually hear the phrase tree shaking. The term became standard vocabulary because of Rollup, the ES module bundler Rich Harris created in 2015, and specifically because of an article he published in December 2015 titled Tree-shaking versus dead code elimination. Harris, who later created Svelte, was working as a front end developer at The Guardian at the time and wanted a bundler that produced flat, efficient distributables for JavaScript libraries.
The underlying idea depends on a property of ES modules that older module systems never had: their structure is static. Imports and exports are declared at the top level and cannot be assembled conditionally at runtime. A bundler can therefore parse a module graph, see exactly which exported names are referenced, and determine which declarations are reachable from the entry point. Everything else can be dropped. If your library exports forty utility functions and an application imports two, a good ES module bundler should ship two.
That is a different operation from the dead code elimination compilers have performed for decades. Classic dead code elimination works inside a function or a module, removing statements that cannot affect the result, such as code after an unconditional return or branches guarded by a constant false. Tree shaking works across module boundaries, following the graph of imports and exports to remove entire declarations and, recursively, the modules that only existed to support them. Harris used the tree metaphor deliberately: shake the dependency tree and the dead leaves fall off. The distinction mattered because it explained why the technique needed module level information and why CommonJS, with its dynamic require calls and mutable exports, made the analysis so much harder.
The practical consequences reach further than the name. Library authors learned to avoid top level side effects, because a module that mutates a global or registers itself on import cannot be safely skipped. The sideEffects field in package.json exists so bundlers know which files are safe to omit. Pure annotations tell minifiers that a function call can be discarded if its result is unused. Barrel files that re-export everything from a directory became a known hazard, since a naive bundler may pull in far more than the single component a consumer wanted. None of these conventions make sense without the module level reachability analysis that tree shaking describes.
Rollup's influence also spread through the tools built on top of it. Vite uses Rollup for production builds while relying on esbuild for fast development serving, which means a very large share of modern front end projects run Rollup's tree shaking algorithm at build time without ever invoking the Rollup CLI directly. Rollup itself kept evolving: version 4 replaced its parser with a native Rust implementation built on SWC for speed, and Rolldown, a Rust port of Rollup, is positioned as its successor inside Vite. The lineage is a useful reminder that build tooling changes brands faster than it changes ideas.
For a senior developer, the actionable part is verification. Do not assume tree shaking happened because the documentation says it should. Add a bundle analyzer to the build, import one function from a large library in a throwaway entry file, and inspect what actually lands in the output. Check whether your package publishes an ES module build alongside CommonJS, because the CommonJS entry point often defeats the analysis. Check whether internal modules have side effects that force the bundler to keep them. Measure the delta when you switch a barrel import to a direct path import. These checks take minutes and routinely find wasted kilobytes that no framework upgrade would have recovered.
The term itself is a small piece of engineering culture that turned out to be unusually durable. Dead code elimination was accurate but abstract. Tree shaking gave developers a mental image they could reason about, and the image shaped how libraries are written, how package metadata is structured, and how build tools are compared. Naming a technique well is its own kind of contribution, and in this case the name traveled much further than the bundler that introduced it.