1a20490320
The original commit on this branch (9ed74ca, then cherry-picked as
f776ce7) predated ADR-0019 / PR #91, which switched the portal-shell
build to `@angular/localize` and started emitting one self-contained
bundle per locale under `dist/apps/portal-shell/browser/<locale>/`.
The script looked for `index.html` directly under the dist root and
failed with ENOENT on every modern build.
Fix
- `scripts/check-gzip-budgets.mjs`:
- Auto-detects layout: if `dist/index.html` exists → flat mode
(unchanged behaviour). Otherwise enumerate immediate
subdirectories with their own `index.html` and run the check
per locale.
- Budget thresholds apply *per locale* — each bundle is what the
user's browser actually downloads. Aggregating across locales
would understate the worst case.
- Violations across locales are collected and reported together
so a single CI run surfaces every breach; the locale tag is
prefixed to each violation message for clarity.
- `docs/decisions/0017-...md` §Confirmation: spell out the per-locale
check + cite ADR-0019 so a future reader of either ADR sees the
connection.
Verified locally on the production build:
- 2 locale bundles detected (en, fr).
- Initial JS total: ~141 KB / 300 KB budget ✓ (each locale).
- CSS total: 4.62 KB / 150 KB budget ✓ (each locale).
- Largest lazy chunk: 1.55 KB / 100 KB per-chunk budget ✓.