JavaScript

What is Tree Shaking?

Hard
4
Added
Dead code elimination during bundling. Removes unused exports via static analysis.

Solution Code

JavaScript
// webpack.config.js
optimization: { usedExports: true }
Explanation
Requires ES modules. Works best with side-effect-free code.

Guided Hints

Common pitfalls
Measuring effectiveness