JavaScript bundle size for small teams
There is no clever trick in this one, just a handful of decisions worth making deliberately. Most advice about JavaScript bundle size assumes a team that does not exist at your size. Here is the version that does not.
Most development decisions are really maintenance decisions wearing a different hat. Most teams find the first pass takes an afternoon and the maintenance takes minutes a month.
What to keep
Every kilobyte of JavaScript costs more than a kilobyte of image. In practice this is a scheduling problem more than a technical one. It rarely shows up as a line item, which is exactly why it slips.
What to drop
Process that exists to coordinate ten people is overhead when there are two of you. Small and consistent beats large and occasional here.
What good looks like
Measure the bundle before optimising anything else. In practice this is a scheduling problem more than a technical one. Write the reasoning down alongside the decision, because the reasoning is what changes first.
The short version
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
- Measure the bundle before optimising anything else — and you know whether that is true here
- There is a way to tell whether the last change to this helped
If you want a second opinion on how yours is set up, ask.