Browser & Web Performance · Middle · Question 35 of 75

What does tree shaking rely on to remove unused code?

Explanation

CommonJS require is dynamic, so bundlers often can't prove code is unused. Side effects in modules also block removal.

Further reading

Problem with a question

Browser & Web Performance · Middle · question 35

Test yourself

Take the Browser & Web Performance · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz