fix: replace bundler with rspack in bundlerChain config#7143
fix: replace bundler with rspack in bundlerChain config#7143chenjiahan merged 2 commits intomainfrom
bundler with rspack in bundlerChain config#7143Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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 refactors the way Rspack instances and their associated plugins are accessed within the Highlights
Changelog
Activity
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 is a well-executed refactoring that simplifies how the Rspack instance is accessed within the modifyBundlerChain hook. It deprecates the old bundler property in favor of the rspack property on the utility object, making the API more consistent and straightforward. The bundler property is maintained as an alias to rspack for backward compatibility, which is a good practice. The internal plugins have been updated to use the new rspack property, serving as a clear example for migration. The type definitions are also updated correctly to reflect these changes. Overall, this is a solid improvement with no apparent issues.
There was a problem hiding this comment.
Pull request overview
This pull request refactors how Rspack instances are accessed via tools.bundlerChain by replacing the limited bundler object with direct access to the rspack module, while maintaining backward compatibility through deprecation.
Changes:
- Simplified type definitions by replacing the limited
bundlerobject withtypeof rspack - Updated all internal plugin files to use
rspackinstead ofbundler - Marked the
bundlerproperty as deprecated to guide users toward the new approach
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/core/src/types/hooks.ts |
Updated ModifyBundlerChainUtils to deprecate bundler and type it as typeof rspack instead of a limited plugin object |
packages/core/src/rspackConfig.ts |
Simplified implementation by passing rspack directly as bundler instead of destructuring specific plugins |
packages/core/src/plugins/sourceMap.ts |
Updated to use rspack parameter instead of bundler |
packages/core/src/plugins/define.ts |
Updated to use rspack parameter instead of bundler |
packages/core/src/plugins/basic.ts |
Updated to use rspack parameter instead of bundler |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Deploying rsbuild with
|
| Latest commit: |
333c278
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://25776358.rsbuild-v2.pages.dev |
| Branch Preview URL: | https://bundler-chain-params-0204.rsbuild-v2.pages.dev |
Summary
tools.bundlerChain, simplifying the usage from destructured plugin objects to the direct use of therspackobject.bundlerproperty as deprecated.Checklist