webpack bundle size history without the one-off audit habit

webpack already knows exactly what it put into every chunk, which modules contributed how many bytes, and which entry points are responsible for which assets. That information lives in the stats file it can emit on any build. The problem is not generating the data — it is that most teams only look at it when something is already wrong, running webpack-bundle-analyzer as a one-off and then closing the tab. dendrobundle stores every stats file as a snapshot tied to a commit and branch, so the history builds automatically and a regression becomes a diff between two specific commits.

Set it up for webpack

webpack writes its stats file when you pass --profile --json to the CLI, or when you configure stats output in webpack.config.js. The result is a single JSON file that dendrobundle parses server-side to extract asset and module data.

# 1. build + emit stats
npx webpack --profile --json > stats.json

# 2. submit the snapshot
curl -sS "https://dendrobundle.com/api/push?branch=$(git branch --show-current)&commit=$(git rev-parse HEAD)" \
  -H "Authorization: Bearer $DENDROBUNDLE_TOKEN" \
  -H "Content-Type: application/json" \
  -d @stats.json

Full details on the supported formats and CI integration pages.

webpack bundle tracking — FAQ

The stats file is several megabytes. Is there a size limit on the POST?
The ingest endpoint accepts large stats files — a 10–20 MB webpack stats JSON from a production app is normal and handled without modification. dendrobundle parses only the fields it needs (assets, chunks, modules, and their sizes) and discards the rest, so what is stored is much smaller than the raw file.
We use Module Federation across multiple webpack builds. How does this work?
Each federated build produces its own stats file and tracks as a separate dendrobundle project. The host and each remote have independent size histories and budgets. There is no built-in cross-project federation awareness today — each project is tracked as a self-contained bundle.
I already use webpack-bundle-analyzer. What does dendrobundle add?
webpack-bundle-analyzer is excellent for a point-in-time investigation, but it does not retain that information or compare it to last week’s build. dendrobundle keeps the history, draws the growth chart, runs budgets against every push, and emails you when an asset crosses a threshold. Many teams use both.
Do I need to modify my webpack config permanently?
No. A common CI pattern is to pass --json and write to a file only when a BUNDLE_STATS environment variable is set, leaving the production build command unchanged. Alternatively, emit stats on every build — it adds a few seconds and the file is not deployed, just POSTed to dendrobundle.

Connect your webpack project to dendrobundle's free Community tier — or drop a webpack-stats.json into dendrobundle.com/analyze for an immediate treemap with no account required.

create a free account