Skip to content

feat: support shorter string value for output.distPath#6352

Merged
chenjiahan merged 1 commit intomainfrom
dist_path_string_1013
Oct 13, 2025
Merged

feat: support shorter string value for output.distPath#6352
chenjiahan merged 1 commit intomainfrom
dist_path_string_1013

Conversation

@chenjiahan
Copy link
Member

@chenjiahan chenjiahan commented Oct 13, 2025

Summary

This PR adds support for using a string value for output.distPath as a shorthand for output.distPath.root, since I noticed that in many cases, users only need to custom the root path — and using a string feels more intuitive in such scenarios.

export default {
  output: {
    distPath: 'dist-custom',
  },
};

Checklist

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

Copilot AI review requested due to automatic review settings October 13, 2025 08:57
@netlify
Copy link

netlify bot commented Oct 13, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 0f25563
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68ecbf07700d3400080af935
😎 Deploy Preview https://deploy-preview-6352--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: 63 (🟢 up 9 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

This PR adds support for using a string value for output.distPath as a shorthand for output.distPath.root, making the configuration more intuitive when users only need to customize the root path.

Key changes:

  • Updated type definitions to allow string values for distPath
  • Added normalization logic to convert string values to object form
  • Updated documentation with examples and version history

Reviewed Changes

Copilot reviewed 47 out of 47 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/core/src/types/config.ts Updated type definition to allow string or object for distPath
packages/core/src/defaultConfig.ts Added normalizeConfigStructure function to handle string distPath conversion
packages/core/src/provider/initConfigs.ts Updated to use new normalization function
packages/core/src/createContext.ts Simplified getAbsoluteDistPath function signature
website/docs/en/config/output/dist-path.mdx Added documentation for string type support
website/docs/zh/config/output/dist-path.mdx Added Chinese documentation for string type support
e2e/cases/assets/custom-dist-path-string/* New test case for string distPath functionality
Various e2e test files Updated test configurations to use new string syntax

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

@chenjiahan chenjiahan merged commit fd30e57 into main Oct 13, 2025
13 checks passed
@chenjiahan chenjiahan deleted the dist_path_string_1013 branch October 13, 2025 09:37
@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.

1 participant