BundleBuddy

Docs

Report JavaScript bundle sizes from CI in about ten minutes.

1. Create a project and API key

  1. Sign up and create an organization.
  2. Create a project (Dashboard โ†’ Projects).
  3. Open API keys, create a key, and copy it once.
  4. Copy the project Project ID from the project page.

2. Report from CI

Set env vars, then run the CLI against your build output. The CLI posts to https://app.bundlebuddy.io. Set BUNDLEBUDDY_URL or pass --url to use another host.

export BUNDLEBUDDY_API_KEY=bb_...
export BUNDLEBUDDY_PROJECT_ID=...

npx @bundlebuddy/cli report --path ./dist

GitHub Actions

- name: Report bundle sizes
  env:
    BUNDLEBUDDY_API_KEY: ${{ secrets.BUNDLEBUDDY_API_KEY }}
    BUNDLEBUDDY_PROJECT_ID: ${{ vars.BUNDLEBUDDY_PROJECT_ID }}
  run: npx @bundlebuddy/cli report --path ./dist --fail-on-budget

3. Size budgets (Starter+)

In the project UI, add a budget (total, file, or module). Mark budgets with Fail CI, then use --fail-on-budget so the CLI exits non-zero when limits are exceeded. Email alerts go to owners and admins.

4. Pull request comments (Pro)

  1. Set GitHub repo on the project to owner/repo.
  2. Paste a GitHub PAT on the organization (Settings), or set BUNDLEBUDDY_GITHUB_TOKEN on the server.
  3. Report with a PR number:
- name: Report bundle sizes on PR
  if: github.event_name == 'pull_request'
  env:
    BUNDLEBUDDY_API_KEY: ${{ secrets.BUNDLEBUDDY_API_KEY }}
    BUNDLEBUDDY_PROJECT_ID: ${{ vars.BUNDLEBUDDY_PROJECT_ID }}
  run: npx @bundlebuddy/cli report --path ./dist --pr ${{ github.event.pull_request.number }}

Each report posts a comment that compares the pull request with the latest shipped build and lists files that were added or removed.

bundlebuddy commented on the pull request Author

BundleBuddy

+203 KB versus the latest shipped build (1.17 MB โ†’ 1.37 MB).

This pull request Latest shipped Change
Total 1.37 MB 1.17 MB +203 KB (+17%)
Gzip 329 KB 281 KB +48 KB (+17%)

What changed

File Size
Added chart.js 196 KB

No budget violations.

5. Module diagnosis (Pro)

Pass webpack/Vite/Rollup stats.json with --stats for an accurate treemap. If you only have source maps, use --source-map for an approximate breakdown.

npx @bundlebuddy/cli report --path ./dist --stats ./dist/stats.json
npx @bundlebuddy/cli report --path ./dist --source-map ./dist/main.js.map

6. Live URL crawl

Set a project live URL and crawl on demand (or daily in production). Free includes one saved live URL per organization; paid plans allow live URLs on all projects. Totals chart on Free; file/module diagnosis on paid plans.

See pricing ยท Sign up