Problem Statement
Frontend CI builds but does not output or compare bundle sizes. Bundle size regressions (e.g., from adding a large dependency) go unnoticed until production.
Evidence
infrastructure/ci/frontend-build.yml — Build step has no bundle analysis
analytics/next.config.ts — Uses @next/bundle-analyzer (available but not used in CI)
Impact
Bundle size regressions go unnoticed. Performance degradation reaches users.
Proposed Solution
- Run @next/bundle-analyzer in the CI build step (set ANALYZE=true)
- Output bundle analysis as CI artifact
- Add size comparison check against previous build
- Fail build if bundle size exceeds threshold
Technical Requirements
- Must not significantly increase CI build time
- Must output readable report
- Must compare against baseline
Acceptance Criteria
- CI produces bundle analysis artifact
- Report is accessible from CI run
- Bundle size changes are visible in PR comments
- Build fails if size exceeds threshold
File Inventory
infrastructure/ci/frontend-build.yml
Dependencies
None.
Testing Strategy
- Run CI with bundle analysis, verify artifact is generated
Security Considerations
Source maps in bundle analysis should not expose internal paths.
Definition of Done
Problem Statement
Frontend CI builds but does not output or compare bundle sizes. Bundle size regressions (e.g., from adding a large dependency) go unnoticed until production.
Evidence
infrastructure/ci/frontend-build.yml— Build step has no bundle analysisanalytics/next.config.ts— Uses @next/bundle-analyzer (available but not used in CI)Impact
Bundle size regressions go unnoticed. Performance degradation reaches users.
Proposed Solution
Technical Requirements
Acceptance Criteria
File Inventory
infrastructure/ci/frontend-build.ymlDependencies
None.
Testing Strategy
Security Considerations
Source maps in bundle analysis should not expose internal paths.
Definition of Done