Payload Logo

Bundle Size Is a Decision Made Thousands of Times

Date Published

A pair of scissors cutting through white paper on a blue background

A utility library pulled in for one function, a component library imported wholesale for a single icon, a dependency that itself depends on three others nobody checked — each of these looks harmless in isolation, and a bundle analyzer is usually the first time anyone actually sees the accumulated total.

Tree-shaking helps, but only for code written in a way that's actually shakeable — a library with side effects at the module level, or one that isn't structured for it, ships in full regardless of how little of it gets used.

The practical habit that keeps this in check is treating bundle size as something to check regularly, not just once at a launch audit — a size budget enforced in CI catches the slow accumulation while it's still one commit's worth of regression, not a year's worth.