Skip to content

feat(plugin-react): enhance splitChunks option to support boolean type#6515

Merged
chenjiahan merged 2 commits intomainfrom
react_split_1106
Nov 6, 2025
Merged

feat(plugin-react): enhance splitChunks option to support boolean type#6515
chenjiahan merged 2 commits intomainfrom
react_split_1106

Conversation

@chenjiahan
Copy link
Member

@chenjiahan chenjiahan commented Nov 6, 2025

Summary

  • allow React plugins's splitChunks option to accept boolean value for simpler configuration
  • update documentation and add test case for boolean configuration

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings November 6, 2025 08:20
@netlify
Copy link

netlify bot commented Nov 6, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit ed9167c
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/690c5a9add99750008c1b7a0
😎 Deploy Preview https://deploy-preview-6515--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 62 (🔴 down 7 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 splitChunks option type to accept boolean | SplitReactChunkOptions
  • Changed the default value from undefined to true for 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.

@chenjiahan chenjiahan merged commit 3449e64 into main Nov 6, 2025
11 checks passed
@chenjiahan chenjiahan deleted the react_split_1106 branch November 6, 2025 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments