fix: update chunk name for per-package preset#7102
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 refines the chunk naming strategy for 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
|
There was a problem hiding this comment.
Code Review
This pull request updates the chunk naming format for the per-package preset to use hyphens and underscores instead of dots, which improves readability. The implementation is correct, and the e2e tests and documentation have been updated accordingly. However, I've noticed that the unit tests for the modified getPackageNameFromModulePath function were not updated, which could lead to test failures. I've left a comment with a suggestion to fix this.
Deploying rsbuild with
|
| Latest commit: |
0c6c264
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://df6922f1.rsbuild-v2.pages.dev |
| Branch Preview URL: | https://split-chunks-per-pkg-0131.rsbuild-v2.pages.dev |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0c6c264dce
ℹ️ 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 updates the chunk naming format for the per-package preset from dot-separated names (e.g., npm.react, npm.babel.runtime) to hyphen/underscore-separated names (e.g., npm-react, npm-babel_runtime).
Changes:
- Modified
getPackageNameFromModulePathfunction to generate chunk names with hyphens and underscores instead of dots - Updated E2E tests to expect the new naming format
- Enhanced documentation to include examples of the new chunk names
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/core/src/plugins/splitChunks.ts | Simplified the chunk name generation logic to use template literals with hyphen/underscore separators |
| e2e/cases/split-chunks/preset-per-package/index.test.ts | Updated test assertions to check for the new hyphen-based naming format |
| e2e/cases/split-chunks/legacy-by-module/index.test.ts | Updated test assertions to check for the new hyphen-based naming format |
| website/docs/en/config/split-chunks.mdx | Added examples showing the new chunk naming format (npm-react.js, npm-babel_runtime.js) |
| website/docs/zh/config/split-chunks.mdx | Added examples showing the new chunk naming format (npm-react.js, npm-babel_runtime.js) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Changed the output chunk naming format in
per-packagepreset fromnpm.reacttonpm-react(and for scoped packages, from e.g.npm.babel.runtimetonpm-babel_runtime).Checklist