Context
next.config.ts includes withBundleAnalyzer but it only runs when ANALYZE=true (manual). There is no CI check for bundle size regressions.
Impact: Performance regressions can ship silently. No baseline to compare against.
Proposed approach
- Add
@next/bundle-analyzer output to CI artifacts
- Use
size-limit or bundlewatch to set thresholds
- Post bundle size diff as PR comment (for preview PRs)
- Warn if main JS bundle exceeds a defined threshold (e.g., 200KB gzipped)
Acceptance criteria
Context
next.config.tsincludeswithBundleAnalyzerbut it only runs whenANALYZE=true(manual). There is no CI check for bundle size regressions.Impact: Performance regressions can ship silently. No baseline to compare against.
Proposed approach
@next/bundle-analyzeroutput to CI artifactssize-limitorbundlewatchto set thresholdsAcceptance criteria