feat(plugin-react): enhance splitChunks option to support boolean type#6515
feat(plugin-react): enhance splitChunks option to support boolean type#6515chenjiahan merged 2 commits intomainfrom
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
Here are some automated review suggestions for this pull request.
ℹ️ 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 enhances the splitChunks option in @rsbuild/plugin-react to accept a boolean value in addition to the existing object configuration. When set to false, it disables all React-related chunk splitting; when set to true (the new default), it enables splitting for both React and router dependencies.
Key changes:
- Extended the
splitChunksoption type to acceptboolean | SplitReactChunkOptions - Changed the default value from
undefinedtotruefor consistent behavior - Updated documentation in both English and Chinese to demonstrate the new boolean usage
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/plugin-react/src/index.ts | Updated type definition and default value for splitChunks option to support boolean values |
| packages/plugin-react/src/splitChunks.ts | Added logic to handle boolean splitChunks values and normalize them to object configuration |
| e2e/cases/plugin-react/split-chunk/index.test.ts | Added test case for splitChunks: false behavior |
| website/docs/en/plugins/list/plugin-react.mdx | Updated documentation with boolean type and enhanced examples |
| website/docs/zh/plugins/list/plugin-react.mdx | Updated Chinese documentation with boolean type and enhanced examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Summary
splitChunksoption to accept boolean value for simpler configurationChecklist