Tree Shaking Playground

Dodi’s scrap bin: a real toolkit package, four files. Pick what app.js uses, how it imports (named, kit.name, kit[key], require) and sideEffects; a model of…

Why it matters

Utility libraries (lodash, date-fns, icons) hold hundreds of functions when you use three. A bundler only dares to drop what it can prove is unused and does nothing when loaded: static imports, fixed names, and an honest sideEffects. That is the difference between a 12 KB and a 240 KB bundle.

The key idea

A bundler drops what it can prove is unused and has no effect

Common mistakes

Try it in this playground