web-devproductivity
Tree Shaking
Tree shaking is a dead code elimination technique used by modern bundlers like Webpack, Rollup, and esbuild to remove unused exports from the final JavaScript bundle. It relies on the static structure of ES module import/export syntax to determine which code is actually referenced and safely discard the rest. For tree shaking to work effectively, libraries must use ESM format and avoid side effects in their module initialization, which is why the sideEffects field in package.json matters.
#web-dev#productivity