tree shaking

Removing code that is exported but never imported from the final bundle, so less code is shipped.

In more detail

Bundlers can do it for ES modules because their imports are known before the code runs, and it works best when a package declares that its files have no side effects. It matters most for code sent to browsers.

Related terms

Taught in

References