Skip to content

Conversation

@chenjiahan
Copy link
Member

@chenjiahan chenjiahan commented Jun 13, 2025

Summary

Set the charset option of swc-loader to ensure that the charset is consistent in all cases.

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings June 13, 2025 13:43
@chenjiahan chenjiahan marked this pull request as draft June 13, 2025 13:43
@netlify
Copy link

netlify bot commented Jun 13, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 46f3326
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/685170f45f43170008069c55
😎 Deploy Preview https://deploy-preview-5412--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: 81 (🔴 down 6 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 updates the SWC loader configuration to propagate the output charset from the normalized environment config.

  • Refactor getDefaultSwcConfig to accept an object including config
  • Add jsc.output.charset based on config.output.charset
  • Update all call sites to pass the new parameter object
Comments suppressed due to low confidence (3)

packages/core/src/plugins/swc.ts:65

  • [nitpick] The parameter named config shadows the outer config variable; consider renaming it (e.g., envConfig) for clarity.
function getDefaultSwcConfig({

packages/core/src/plugins/swc.ts:65

  • [nitpick] Consider adding or updating a JSDoc comment for getDefaultSwcConfig to document the new output.charset setting.
function getDefaultSwcConfig({

packages/core/src/plugins/swc.ts:89

  • There's no existing test verifying that output.charset is correctly set; consider adding a unit test to cover this new behavior.
output: {

@chenjiahan chenjiahan marked this pull request as ready for review June 17, 2025 13:42
@chenjiahan chenjiahan merged commit 50a6272 into main Jun 18, 2025
12 checks passed
@chenjiahan chenjiahan deleted the swc_loader_charset_0613 branch June 18, 2025 02:21
This was referenced Jun 20, 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