fix: ensure output.distPath can be merged correctly#6369
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors configuration normalization to ensure proper merging of output.distPath when specified as a string. The change moves the normalizeConfigStructure logic from the initialization phase into the merge phase, allowing configuration properties like output.distPath and output.copy to be normalized before merging rather than after.
Key Changes
- Moved
normalizeConfigStructurefunction fromdefaultConfig.tstomergeConfig.tsand integrated it into the merge process - Removed special-case handling for
output.copyfrom themergefunction since normalization now handles structure consistency - Updated
initConfigs.tsandnormalizeConfigto use the new normalization approach
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/core/tests/mergeConfig.test.ts | Added test cases verifying correct merging behavior for output.copy and output.distPath configurations |
| packages/core/src/provider/initConfigs.ts | Removed normalizeConfigStructure import and call since normalization now happens during merge |
| packages/core/src/mergeConfig.ts | Added normalizeConfigStructure function and integrated it into mergeRsbuildConfig to normalize configs before merging |
| packages/core/src/defaultConfig.ts | Removed normalizeConfigStructure function and moved publicDir normalization logic into normalizeConfig |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
✅ 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.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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

Summary
This PR moves the
normalizeConfigStructurehelper to the merge Rsbuild configuration phase, ensuring that theoutput.distPathconfig can be merged correctly. See the newly added test cases for details.Checklist