Skip to content

ci: add bundle analysis to frontend CI pipeline#91

Merged
snowrugar-beep merged 1 commit into
VertexChainLabs:mainfrom
YaronZaki:fix/issue-39-bundle-analysis-ci
Jun 28, 2026
Merged

ci: add bundle analysis to frontend CI pipeline#91
snowrugar-beep merged 1 commit into
VertexChainLabs:mainfrom
YaronZaki:fix/issue-39-bundle-analysis-ci

Conversation

@YaronZaki

Copy link
Copy Markdown
Contributor

Summary

The frontend CI pipeline built Next.js successfully but never ran bundle analysis, so bundle size regressions (e.g. from accidentally importing a large library) went completely undetected. The @next/bundle-analyzer package was already installed in analytics/ and configured in analytics/next.config.ts via ANALYZE=true — it just was not wired into CI.

This PR enables bundle analysis on every CI run, uploads the report as an artifact, and adds a chunk size threshold check that fails the build if any JS chunk exceeds 500 KB.

Changes

  • Set ANALYZE: true on the Next.js build step so @next/bundle-analyzer generates the report
  • Added a bundle size threshold check step that scans all .next/static/chunks/*.js files and fails if any exceeds 500,000 bytes
  • Added Upload bundle analysis report artifact step (retains .next/analyze/ and .next/static/ for 30 days, runs on success and failure)
  • Kept the existing build artifact upload unchanged

Testing

  • CI workflow YAML validated (no syntax errors)
  • Bundle analysis report generated locally with ANALYZE=true npm run build
  • Size threshold script tested against .next/static/chunks/ output

Closes #39

@snowrugar-beep snowrugar-beep left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@snowrugar-beep snowrugar-beep merged commit 33a67ab into VertexChainLabs:main Jun 28, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: add bundle analysis to frontend CI pipeline

2 participants