fix(file-size): use config hash for snapshot filename to avoid collisions#6710
fix(file-size): use config hash for snapshot filename to avoid collisions#6710chenjiahan merged 2 commits intomainfrom
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR fixes a collision issue that occurs when multiple Rsbuild config files are used in the same project. By adding a hash of the config file path to the snapshot filename, each configuration now has its own unique snapshot file, preventing conflicts.
- Added hash-based snapshot filenames to avoid collisions when using multiple Rsbuild config files
- Updated documentation to reflect the new snapshot filename format (
file-sizes-[hash].json) - Refactored snapshot path handling to be more flexible and maintainable
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
packages/core/src/plugins/fileSize.ts |
Implements hash-based snapshot filenames by importing the hash helper, updating getSnapshotPath to accept a hash parameter, refactoring loadPrevSnapshots and saveSnapshots to use the snapshot path directly, and computing the hash from the config file path when diff mode is enabled |
website/docs/en/config/performance/print-file-size.mdx |
Updates documentation to reflect the new snapshot filename format with hash suffix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Summary
When multiple Rsbuild config files are used, the file size snapshots could collide. This change adds a hash of the config file path to the snapshot filename to ensure uniqueness.
Related Links
Checklist