Docs
Report JavaScript bundle sizes from CI in about ten minutes.
1. Create a project and API key
- Sign up and create an organization.
- Create a project (Dashboard โ Projects).
- Open API keys, create a key, and copy it once.
- 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)
- Set GitHub repo on the project to
owner/repo. - Paste a GitHub PAT on the organization (Settings), or set
BUNDLEBUDDY_GITHUB_TOKENon the server. - 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.
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.
BundleBuddy
+203 KB versus the latest shipped build (1.17 MB โ 1.37 MB).
What changed
chart.jsNo budget violations.
View this build Latest shipped build