Skip to content

fix: ensure output.distPath can be merged correctly#6369

Merged
chenjiahan merged 3 commits intomainfrom
merge_dist_path_1015
Oct 16, 2025
Merged

fix: ensure output.distPath can be merged correctly#6369
chenjiahan merged 3 commits intomainfrom
merge_dist_path_1015

Conversation

@chenjiahan
Copy link
Member

Summary

This PR moves the normalizeConfigStructure helper to the merge Rsbuild configuration phase, ensuring that the output.distPath config can be merged correctly. See the newly added test cases for details.

Checklist

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

Copilot AI review requested due to automatic review settings October 15, 2025 15:01
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 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 normalizeConfigStructure function from defaultConfig.ts to mergeConfig.ts and integrated it into the merge process
  • Removed special-case handling for output.copy from the merge function since normalization now handles structure consistency
  • Updated initConfigs.ts and normalizeConfig to 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.

@netlify
Copy link

netlify bot commented Oct 15, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 1b161d8
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68f05632739f6c000934efcb
😎 Deploy Preview https://deploy-preview-6369--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: 59 (🟢 up 3 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
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

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.

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

Timeless0911
Timeless0911 previously approved these changes Oct 15, 2025
@chenjiahan chenjiahan merged commit 2342454 into main Oct 16, 2025
11 checks passed
@chenjiahan chenjiahan deleted the merge_dist_path_1015 branch October 16, 2025 02:31
@chenjiahan chenjiahan mentioned this pull request Oct 30, 2025
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.

2 participants