Angular bundle size tracking that works with ng build
Angular applications can grow in structurally surprising ways: lazy-loaded feature modules accidentally imported eagerly, shared components pulled into more chunks than expected, or a component library bundling icon sets you did not ask for. The Angular CLI has emitted a webpack stats file via --stats-json for years, but without a system to store and diff those files across commits, they get generated once for a one-off audit and then forgotten. dendrobundle collects that stats file on each CI run and surfaces regressions before they reach production.
Set it up for Angular
The Angular CLI's ng build --stats-json flag writes a stats.json into your output directory alongside the built assets. That is the file you POST to dendrobundle — no additional tooling required.
# 1. build with the stats file (works with both the esbuild and webpack builders)
ng build --stats-json
# 2. submit the snapshot (adjust the dist path to your app)
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 @dist/your-app/stats.jsonFull details on the supported formats and CI integration pages.
Angular bundle tracking — FAQ
- Does this work with the new esbuild-based Angular builder?
- Yes. Angular switched to an esbuild builder as the default in Angular 17, and ng build --stats-json still works with it — the CLI generates a stats-compatible JSON even when esbuild is the underlying compiler. If you have pinned to the webpack builder, the native webpack stats file is produced the same way it always was.
- My app uses lazy-loaded modules. Will dendrobundle show which chunks grew?
- Yes, and this is one of the most valuable use cases for Angular. The stats file includes all emitted chunks, including named lazy chunks for each lazy-loaded route module. dendrobundle stores each chunk as a separate asset entry, so you can see exactly which route module grew between commits, not just the total.
- We use Nx or Angular workspaces with multiple projects. How does this scale?
- Create one dendrobundle project per built application (not per library). Each application has its own stats file, size history, and budget. A shared library that grows shows up as modules in every consuming app, so the regression is reflected in each app that uses it.
- Can I set different budgets for different chunks, like main vs vendor?
- Budgets are per-project (total bundle) and per-asset. You can set a threshold for the total size and separate thresholds for individual named assets, so you can cap vendor.js or a particular lazy chunk without constraining the whole build.
Add your Angular project to dendrobundle's free Community tier — three projects, no card — and get a size history running from your next ng build.
create a free account