Skip to catalogue

tree shaking

Tree shaking removes unused code that a bundler can prove is unnecessary.

Use this when A bundle contains a large dependency even though the app uses little of it.

without the term

“We only use two functions from this library but the bundle analyzer shows the whole thing is included. Can you get the unused parts out of the build?”

with the term · How do you ask a model for tree shaking?

Investigate tree shaking for this dependency. Compare the built bundle before and after the import change and verify required side effects still run.

XBlueskyLinkedIn

What is tree shaking?

The bundler drops exports that no code uses, but only when it can prove removing them is safe. Module format and side effects decide what it can remove.

Why does tree shaking matter when vibe coding?

Import syntax alone does not prove which bytes reach the browser.

How do you do tree shaking?

Inspect the bundle graph and side-effect metadata before changing import structure.

What goes wrong with tree shaking?

Assuming every barrel export prevents tree shaking or marking real side effects as removable.

adjacent

reviewed

report a correction