What does tree shaking do in a modern build tool?
- A Reorders the DOM tree
- B Removes unused exports from the final bundle
- C Compresses images
- D Sorts CSS rules
Answer
Removes unused exports from the final bundle
Tree shaking relies on the static structure of ES module imports and exports, which is why CommonJS modules are harder to shake.





