Skip to content

Conversation

@chenjiahan
Copy link
Member

Summary

Updated getPublicPathto use isDev instead of isProd for determining the asset prefix, ensuring output.assetPrefix is used in production and none modes.

Based on the semantics and usage of the existing configuration, output.assetPrefix is ​​conceptually closer to configuring the asset path of none mode. This means that if users build in none mode, they should be able to use output.assetPrefix to specify the asset prefix.

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings June 3, 2025 13:42
@netlify
Copy link

netlify bot commented Jun 3, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 6c1c9d2
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/683efd0b0645690008c6de20
😎 Deploy Preview https://deploy-preview-5352--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: 69 (🔴 down 14 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (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 updates both documentation and code to ensure that output.assetPrefix is applied in production and none modes by switching the logic from an isProd check to an isDev check.

  • Updated docs in both Chinese and English to reflect the supported modes.
  • Changed the public path logic in packages/core/src/plugins/output.ts to use the isDev flag.
  • Added a new end-to-end test to validate output.assetPrefix behavior in none mode.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
website/docs/zh/config/output/asset-prefix.mdx Updated mode description to clarify production and none modes usage.
website/docs/zh/config/mode.mdx Updated to reference correct assetPrefix options for each mode.
website/docs/zh/config/dev/asset-prefix.mdx Modified to reflect updated mode clarifications.
website/docs/en/config/output/asset-prefix.mdx Updated mode description and code examples in TypeScript.
website/docs/en/config/mode.mdx Updated to reference correct assetPrefix options for each mode.
website/docs/en/config/dev/asset-prefix.mdx Modified to reflect updated mode clarifications using TypeScript.
packages/core/src/plugins/output.ts Changed public path logic from using isProd to isDev.
e2e/cases/assets/asset-prefix/index.test.ts Added test verifying that output.assetPrefix is used in none mode.
Comments suppressed due to low confidence (1)

packages/core/src/plugins/output.ts:30

  • [nitpick] The parameter 'isDev' is used to decide whether to use output.assetPrefix by negating it. Consider renaming it (or adding a clarifying comment) to better reflect that the condition applies to both production and none modes.
if (!isDev) {

@chenjiahan chenjiahan merged commit 482a509 into main Jun 3, 2025
11 checks passed
@chenjiahan chenjiahan deleted the none_mode_asset_prefix_0603 branch June 3, 2025 13:54
@chenjiahan chenjiahan mentioned this pull request Jun 4, 2025
@chenjiahan chenjiahan mentioned this pull request Jun 26, 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