chore: update file size snapshot path#6692
Conversation
✅ 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.
💡 Codex Review
rsbuild/packages/core/src/plugins/fileSize.ts
Lines 203 to 204 in 91bf5f3
After loadPreviousSizes was changed to return FileSizeCache | null, the diff branch still accesses previousSizes[environmentName] without a null guard. With strict null checks enabled ("strict": true in node_modules/@rsbuild/config/tsconfig.json), TypeScript reports “Object is possibly 'null'” here and compilation fails for this plugin. Add a null check or assert non-null before indexing so the build can typecheck.
ℹ️ 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".
There was a problem hiding this comment.
Pull request overview
This PR reorganizes the file size cache location and improves cache handling semantics. The cache file is moved from the root of .cache/ into a dedicated rsbuild/ subdirectory, and the cache loading function now returns null instead of an empty object when no cache exists.
- Cache file path updated from
node_modules/.cache/file-sizes-cache.jsontonode_modules/.cache/rsbuild/file-sizes.json loadPreviousSizesreturn type changed from{}tonullwhen cache is unavailable
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| website/docs/en/config/performance/print-file-size.mdx | Documentation updated to reflect new cache file path |
| packages/core/src/plugins/fileSize.ts | Cache path updated in getCacheFilePath and return type improved in loadPreviousSizes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Summary
Checklist