3 ms·
> tree-shaking Always fascinated when I hear that JS term for what's essentially dead code elimination.
by groestl 4y ago
> tree-shaking
Always fascinated when I hear that JS term for what's essentially dead code elimination.
- scott_w 4y agoAs far as I understand it, that's because it's different. Dead code elimination analyses the code and removes paths that can't be executed. Tree shaking only looks at the imports and removes code that isn't imported from the bundle. If code is imported but not executed, then tree shaking won't remove this code, even though it is dead code. Using a different term is reasonable to avoid confusion, in this case.