Skip to content

Conversation

yifancong
Copy link
Contributor

@yifancong yifancong commented Sep 30, 2025

Summary

  • Fix the require() ESM problem when node < 20.19
  • The @rsbuild/plugin-check-syntax prebundle has error, so move to dependencies.
  • When in cjs artifacts,need to use the proxy.cjs, and use proxy-esm.js in esm artifact.
  • Optimize the e2e tests little problems

Related Links

#1339

@Copilot Copilot AI review requested due to automatic review settings September 30, 2025 14:25
Copy link

netlify bot commented Sep 30, 2025

Deploy Preview for rsdoctor ready!

Name Link
🔨 Latest commit dbb2102
🔍 Latest deploy log https://app.netlify.com/projects/rsdoctor/deploys/68e9f0449c07b700088c9e25
😎 Deploy Preview https://deploy-preview-1340--rsdoctor.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@Copilot 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 fixes ESM compatibility issues for Node.js versions below 18.19 by updating import statements and resolving loader paths more robustly.

  • Replaced fs-extra/esm imports with standard fs-extra imports
  • Updated file operations to use Node.js built-in fs methods instead of fs-extra in some cases
  • Added fallback logic for loader path resolution to handle both ESM and CJS environments
  • Moved @rsbuild/plugin-check-syntax from devDependencies to dependencies to avoid prebundling issues

Reviewed Changes

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

Show a summary per file
File Description
packages/utils/src/build/file/index.ts Changed fs-extra import from ESM-specific to standard import
packages/sdk/src/sdk/sdk/index.ts Replaced fs-extra method with Node.js built-in fs methods
packages/sdk/src/sdk/sdk/core.ts Changed from sync to async fs-extra method
packages/core/src/inner-plugins/plugins/loader.ts Added fallback logic to resolve proxy loader paths
packages/core/src/build-utils/build/utils/loader.ts Updated fs-extra import from ESM-specific to standard
packages/core/rslib.config.ts Added comment about ESM file handling
packages/core/prebundle.config.mjs Removed @rsbuild/plugin-check-syntax from prebundle dependencies
packages/core/package.json Moved @rsbuild/plugin-check-syntax to production dependencies
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@yifancong yifancong force-pushed the fix/fs-extra-problem branch from 036d347 to fce67ee Compare October 9, 2025 13:01
LingyuCoder
LingyuCoder previously approved these changes Oct 10, 2025
@yifancong yifancong changed the title fix: the require() ESM problem when node < 18.19 fix: the require() ESM problem when node < 20.19 Oct 11, 2025
@yifancong yifancong requested a review from fi3ework October 11, 2025 05:55
@yifancong yifancong enabled auto-merge (squash) October 11, 2025 06:02
@yifancong yifancong merged commit c1300da into main Oct 11, 2025
8 checks passed
@yifancong yifancong deleted the fix/fs-extra-problem branch October 11, 2025 06:02
@yifancong yifancong mentioned this pull request Oct 11, 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.

3 participants