Browser & Web Performance · Middle · Question 35 of 75
What does tree shaking rely on to remove unused code?
- ✓Correct answer: Static ES module
import/exportsyntax, which can be analyzed at build time - 2The
deferattribute - 3Runtime profiling in the browser
Explanation
CommonJS require is dynamic, so bundlers often can't prove code is unused. Side effects in modules also block removal.