Tree Shaking
Noun · Development
Definitions
A dead code elimination technique that removes unused exports from JavaScript bundles during the build step. Analyzes ES module import/export relationships to determine which code is actually used and drops the rest. The name comes from 'shaking a tree to drop dead leaves.' Requires ES modules (not CommonJS) for static analysis.
In plain English: Automatically removing unused code from your JavaScript bundle during the build, making the final file smaller.
Example: "Import only what you need: import { debounce } from 'lodash-es' tree-shakes away the other 99% of lodash you don't use."