Why JavaScript bundle size matters more than it looks
Every audit we run turns up some version of this. JavaScript bundle size is easy to treat as a detail, and that is exactly why it is worth a few minutes of attention.
The question is rarely whether something can be built, but what it costs to keep running afterwards. It is worth deciding this deliberately rather than inheriting whatever the last person set up.
Why it matters
Every kilobyte of JavaScript costs more than a kilobyte of image. In practice this is a scheduling problem more than a technical one. The teams that stay on top of it are the ones who put it on a calendar rather than a wish list.
Most sites ship libraries for features they barely use. This is the sort of thing that compounds, quietly, in both directions. If two people in the business would answer this differently, that gap is the actual problem.
The mistakes we see most
Measure the bundle before optimising anything else. There is a version of this that is over-engineered, and it is worth avoiding. Anything you cannot measure here, you are deciding by taste, which is fine as long as everyone knows it.
What this looks like day to day
Code gets read far more often than it gets written, and usually by someone with less context than the author had. Three things worth confirming about JavaScript bundle size before you move on:
- Someone can say what the current setup is without going to look
- Most sites ship libraries for features they barely use — and you know whether that is true here
- There is a way to tell whether the last change to this helped
The point is not perfection, it is knowing which of these you have consciously chosen to skip.