# Share a Bundle Analyzer Report — Treemap on a Link, Not a Screenshot

Canonical: https://commareports.com/share-bundle-analyzer-report
Published: 2026-08-23

> webpack-bundle-analyzer and rollup-plugin-visualizer write one self-contained HTML treemap. Publish it to Comma: the treemap stays zoomable, the 400 KB dependency gets a comment thread, and each build is a revision.

# Share a bundle analyzer report

Everybody agrees the bundle is too big and nobody looks at the treemap. The
reason is mechanical: the report is a file at `dist/report.html` on the
machine that ran the build, and the way it reaches other people is a
screenshot — a cropped picture of a visualization whose entire value is that
you can zoom into it.

The file is already self-contained. It just needs an address.

## Publish it

```bash
npx webpack-bundle-analyzer -m static -r report.html stats.json

curl -fsS -X PATCH \
  "https://commareports.com/api/v1/reports/$COMMA_REPORT_ID" \
  -H "Authorization: Bearer $COMMA_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d "$(jq -n --rawfile html report.html \
        --arg title "Bundle — web — $(git rev-parse --short HEAD)" \
        '{title: $title, html: $html}')"
```

For Vite or Rollup, `rollup-plugin-visualizer` writes `stats.html` with the
same self-contained shape — swap the first line and keep the rest.

PATCH rather than POST is the important half. One report id per app means one
URL that always shows the current bundle, with every previous build sitting
in the revision history behind it. That is the difference between a size
report and a size _trend_.

## What the URL changes

- **The treemap stays a treemap.** Zoom, hover, gzip toggle — scripts run
  inside the sandboxed iframe. See
  [interactive HTML reports](/interactive-html-reports).
- **A dependency gets a thread.** Highlight the box, pin "this is moment.js,
  replaced in PR 812". See [commenting on HTML](/comment-on-html).
- **Regressions are visible as a diff.** Two revisions, one comparison.
- **A weekly digest posts itself.** A [routine](/docs/routines) can rebuild
  and republish on a cron so size creep surfaces without anyone remembering.

## Limits

- **HTML body: 5 MB.** Analyzer output for a large monorepo app can approach
  it; publish per entry point if it does.
- **Scripts run, sandboxed:** `allow-scripts`, no `allow-same-origin`.
- **60 requests/minute per token.** Use a
  [scoped token](/docs/api-tokens) with `reports:write` only.

## Try it

Comma is free — unlimited reports, unlimited commenters, unlimited revision
history.

**[Publish a bundle report →](https://commareports.com/)**

### Related

- [Share a Lighthouse report](/share-lighthouse-report) — the other half of front-end performance
- [Publish from CI](/docs/ci) · [GitHub Actions](/ci/github-actions-html-report)
- [Coverage reports](/share-coverage-report) · [Comment on HTML](/comment-on-html)
