angular.courses
DIOP0401BundleCI gate

Initial bundle grew past the allowed limit

The initial download of the last `ng build --stats-json` is larger than the previous recorded build by more than `--max-initial-growth` allows.

What it means

Diopter records every build's stats (esbuild metafile or webpack stats) in .devframe/diopter/bundle-history.json and compares the initial download (entry files plus everything they import statically) with the previous build. A regression usually means a lazy route lost its loadComponent, or a dependency got imported from the main entry.

The report shows the chunk-by-chunk diff and the initial bundle broken down by npm package.

How to fix it

Find the chunk that grew in the Bundle tab, then lazy-load the new feature or drop the dependency that pulled the size in. Keep .devframe/ cached between CI runs so there is a previous build to compare with.

What it looks like

As printed by diopter check; the UI and the Markdown report show the same finding with its location.

[DIOP0401] Initial bundle grew by 39.1 kB (278.4 kB → 317.4 kB) since e3de162, above the allowed 5%.
  fix: Check the biggest chunk changes in the report; lazy-load the new feature or drop the dependency that pulled the size in.
In CI
diopter check --max-initial-growth <5%|20kb>.
In the UI
The Bundle tab, from diopter next to your dev server, or the static report from diopter build.
For agents
MCP tool get-bundle / compare-bundles (diopter mcp).

Learn more