# Tree Shaking

*noun*

say it: **“TREE SHAY-king”** **/triː ˈʃeɪkɪŋ/**

When a build tool leaves out the code you imported but never use, so the finished files are smaller.

## What is **Tree Shaking** in JavaScript?

**Tree Shaking** — Removing exports that a build can determine are unused.

## In a sentence

- “Thanks to **tree shaking**, using one function from a big date library added only a few lines to my build.”
- “I switched to named imports so **tree shaking** could drop the parts of the library I never call.”

Level: Freelancer · [More JavaScript terms at this level](https://www.ask-codey.com/glossary?category=javascript&level=4)

Updated: November 9, 2026

## In other subjects

- [Tree Shaking in Angular](https://www.ask-codey.com/glossary/tree-shaking-angular)

Source: https://www.ask-codey.com/glossary/tree-shaking
