ci: add per-package bundle size tracking to PRs#4338
Conversation
Add bundle size CI that measures each package's dist/ output, compares PR vs base branch, and posts a markdown table as a PR comment. - scripts/bundle-size-report.mjs: zero-dependency measurement & comparison script - .github/workflows/bundle-size.yml: build & measure workflow (pull_request) - .github/workflows/bundle-size-comment.yml: PR comment via workflow_run (fork-safe) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75a8ff04bd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (entry.isDirectory()) { | ||
| // Skip src/ directories (source maps / original source) | ||
| if (entry.name === 'src') continue; | ||
| total += dirSize(fullPath); |
There was a problem hiding this comment.
Count dist/src outputs in total dist size
The size calculation skips any directory named src, which means packages that emit their build output to dist/src (e.g., several packages’ main/exports entries point at dist/src/index.js) will report a totalDist of 0 or severely undercounted. In those cases the “Total dist” column and deltas become meaningless even when the compiled output changes, so bundle size regressions in those packages will be hidden.
Useful? React with 👍 / 👎.
Summary
dist/output, compares PR vs base branch, and posts a markdown comparison table as a PR commentpull_request→workflow_run) for fork securityFiles added
scripts/bundle-size-report.mjs— measurement & comparison script (discoverstype:pkgpackages, measures total dist + ESM gzip).github/workflows/bundle-size.yml— build & measure workflow.github/workflows/bundle-size-comment.yml— PR comment workflowTest plan
node --check)🤖 Generated with Claude Code