Skip to content

Conversation

Timeless0911
Copy link
Contributor

@Timeless0911 Timeless0911 commented Sep 23, 2025

Summary

Add 'auto' for --config-loader cli options to use Node.js's native loader to load configuration files first, and fallback to using jiti if it fails.

Breaking change:

The default value changes from jiti to native.

More details, see RFC web-infra-dev/rsbuild#6188

Related Links

Checklist

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

@Copilot Copilot AI review requested due to automatic review settings September 23, 2025 04:37
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 pull request introduces a new 'auto' option for the --config-loader CLI parameter and changes the default from 'jiti' to 'auto'. The auto mode attempts to use Node.js's native loader first and falls back to jiti if it fails.

  • Add 'auto' as a new config loader option that tries native loader first, then falls back to jiti
  • Change the default config loader from 'jiti' to 'auto'
  • Update documentation to reflect the new options and provide guidance on Node.js native loader limitations

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/core/src/config.ts Add 'auto' to ConfigLoader type definition
packages/core/src/cli/commands.ts Update CLI option description and change default to 'auto'
website/docs/en/guide/basic/cli.mdx Update English CLI documentation to include 'auto' option
website/docs/zh/guide/basic/cli.mdx Update Chinese CLI documentation to include 'auto' option
website/docs/en/guide/basic/configure-rslib.mdx Update English configuration guide with new loader options and limitations
website/docs/zh/guide/basic/configure-rslib.mdx Update Chinese configuration guide with new loader options and limitations
tests/integration/cli/build/rslib.config.auto.mts Add test configuration file for auto loader functionality
tests/integration/cli/build/path.json Add JSON file for test configuration
tests/integration/cli/build/build.test.ts Add test case for auto loader fallback behavior

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

Copy link

netlify bot commented Sep 23, 2025

Deploy Preview for rslib ready!

Name Link
🔨 Latest commit b465b5a
🔍 Latest deploy log https://app.netlify.com/projects/rslib/deploys/68d23a3507565400089c16d9
😎 Deploy Preview https://deploy-preview-1240--rslib.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.

@Timeless0911 Timeless0911 merged commit 7674ab6 into main Sep 23, 2025
14 checks passed
@Timeless0911 Timeless0911 deleted the auto-config-loader branch September 23, 2025 07:05
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