Skip to content

ci: track bundle size on pull requests - #138

Merged
atinux merged 1 commit into
mainfrom
ci/bundle-size
Nov 6, 2026
Merged

atinux merged 1 commit into
mainfrom
ci/bundle-size

Conversation

@atinux

@atinux atinux commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Written by an AI agent on behalf of @atinux.

content-wind had no way to see how a pull request changes the bundle size. This adds the same two workflows as comarkdown/comark-docs, using nuxt-bundle-analyzer.

What changed

  • bundle-size.yml: on every PR to main, builds the base commit and the PR side by side with nuxt-bundle-analyzer@0.1.6 --no-serve and uploads each run as an artifact.
  • bundle-size-comment.yml: identical to comark-docs. It runs on workflow_run from main with a write token (so fork PRs work too), uploads both runs to bundle.nuxt.dev and posts or updates one comment on the PR.

Compared with comark-docs, bundle-size.yml analyzes the repo root (there is no playground/), inlines the setup (Node 24, corepack for the pinned pnpm, pnpm install --frozen-lockfile) since there is no .github/actions/setup, and drops the GITHUB_TOKEN and 8 GB heap that comark's content snapshot needed.

Evidence

Ran locally in an orb (Node 26), not yet on GitHub:

$ NUXT_TELEMETRY_DISABLED=1 npx --yes nuxt-bundle-analyzer@0.1.6 --name pr --no-serve
Σ Total size: 12.5 MB (3.78 MB gzip)
[nuxt-bundle-analyzer] ✔ Bundle analysis pr written to node_modules/.cache/nuxt-bundle-analyzer/pr (client.json, meta.json, nitro.json, nuxt.json).
exit=0

comment on that run used as both base and pr (--output instead of --post):

## Bundle size

Client 164.6 kB (no change) · Server 1.86 MB (no change)

No route loads more or less before it renders.

actionlint reports no issues on either file.

Details

  • GitHub only triggers workflow_run from the default branch, so this PR will run bundle-size but get no comment. The first comment appears on PRs opened after this is merged.
  • If bundle.nuxt.dev does not accept uploads from this repo, the upload step is continue-on-error and the comment is posted without the comparison link.

ELI5

Every pull request now builds the site twice, once before and once after the change, and a bot comments with how much bigger or smaller the site got.

@vercel

vercel Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
content-wind Ready Ready Preview Nov 6, 2026 3:13pm UTC

Request Review

@atinux
atinux merged commit cd35a45 into main Nov 6, 2026
4 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.

1 participant