feat: support displaying the total size diff#6706
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
This PR adds support for displaying size difference information in the total row of the file size output, complementing the existing per-file diff display. The implementation tracks total sizes across builds and shows diffs for both regular and gzipped sizes when diff mode is enabled.
Key Changes
- Introduced
SizeSnapshottype to encapsulate file sizes along with aggregate total and gzip sizes - Extended diff display to show total size changes (e.g.,
Total: 191.8 kB (+191.6 kB)) - Added gzip total diff display in detail mode for comprehensive size tracking
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi, I'd like to know, whether this feature supports multiple configurations? Docs https://rsbuild.rs/config/performance/print-file-size mention only one file |
|
This feature works across multiple environments, but it doesn't support multiple Rsbuild configurations yet. I can add support for that. |

Summary
Add support for displaying the total size diff:
File (web) Size Gzip dist/static/css/index.54800c1b.css 0.34 kB (+0.34 kB) 0.25 kB (+0.25 kB) dist/index.html 0.37 kB (+0.12 kB) 0.25 kB (+0.05 kB) dist/static/js/index.f31cb805.js 1.3 kB (+1.3 kB) 0.76 kB (+0.74 kB) dist/static/js/lib-react.6cc087e6.js 189.8 kB (+189.8 kB) 59.9 kB (+59.9 kB) Total: 191.8 kB (+191.6 kB) 61.2 kB (+61.0 kB)Checklist