feat: add support for 'none' preset in splitChunks#7099
Conversation
Summary of ChangesHello @chenjiahan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Deploying rsbuild with
|
| Latest commit: |
48eea42
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9d1ceb2c.rsbuild-v2.pages.dev |
| Branch Preview URL: | https://preset-none-0131.rsbuild-v2.pages.dev |
There was a problem hiding this comment.
Code Review
This pull request introduces a new 'none' preset for the splitChunks configuration. This allows users to disable all of Rsbuild's built-in chunk splitting rules, providing more control to rely on Rspack defaults or a fully custom configuration. The changes are well-implemented across the core logic, type definitions, and documentation. A new end-to-end test has been added to verify the new functionality, ensuring that no preset-based chunks are generated when using 'none'. The code is clean, and the documentation updates are clear and consistent in both English and Chinese. Overall, this is a solid feature addition that enhances the flexibility of chunk splitting in Rsbuild.
There was a problem hiding this comment.
Pull request overview
This PR adds a new splitChunks.preset value 'none' so users can disable Rsbuild’s built-in split-chunk presets and rely on more bare Rspack-style behavior or fully custom options.
Changes:
- Extend
SplitChunksPresetandpluginSplitChunkslogic to support a'none'preset (including server/worker handling). - Update English and Chinese
splitChunksdocumentation to document the new preset and its defaults. - Add an e2e case (
e2e/cases/split-chunks/preset-none) verifying that whenpreset: 'none'is used, the usual React/router/polyfill vendor chunks are not created.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
packages/core/src/types/config.ts |
Adds 'none' to the SplitChunksPreset union and documents its behavior in the type-level comment. |
packages/core/src/plugins/splitChunks.ts |
Wires the 'none' preset into getSplitChunksByPreset, adjusts default preset handling for server/worker builds, and updates a Web Worker-related comment. |
website/docs/en/config/split-chunks.mdx |
Documents the 'none' preset in English, updates the splitChunks.preset type and default description, and explains how 'none' should behave. |
website/docs/zh/config/split-chunks.mdx |
Same as the English doc, but for the Chinese documentation. |
e2e/cases/split-chunks/preset-none/src/index.js |
Minimal React entry that pulls in react and react-router-dom to exercise splitChunks behavior under the new preset. |
e2e/cases/split-chunks/preset-none/src/App.jsx |
Simple React component used by the new e2e case. |
e2e/cases/split-chunks/preset-none/rsbuild.config.ts |
Rsbuild config enabling React, polyfills, and setting splitChunks.preset = 'none' for the new e2e scenario. |
e2e/cases/split-chunks/preset-none/index.test.ts |
e2e test asserting that with preset: 'none', the build does not emit lib-react, lib-router, or lib-polyfill chunks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 48eea42382
ℹ️ 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".
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Introduces a new split chunks preset option
'none', allowing users to disable all built-in chunk splitting rules and rely solely on Rspack defaults or custom settings.Checklist