Skip to content

perf(CLI): change default config loader from jiti to auto#6406

Merged
chenjiahan merged 2 commits intomainfrom
config_loader_auto_1022
Oct 22, 2025
Merged

perf(CLI): change default config loader from jiti to auto#6406
chenjiahan merged 2 commits intomainfrom
config_loader_auto_1022

Conversation

@chenjiahan
Copy link
Member

Summary

Update the default config loader to 'auto' which first attempts to use Node.js native loader before falling back to jiti. This provides better performance when native TypeScript support is available while maintaining compatibility.

Checklist

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

Copilot AI review requested due to automatic review settings October 22, 2025 09:31
@netlify
Copy link

netlify bot commented Oct 22, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit d8a58c3
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68f8a65d1de4bb000875850d
😎 Deploy Preview https://deploy-preview-6406--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: 56 (🔴 down 11 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 default config loader from jiti to auto for improved performance. The auto loader attempts to use Node.js native TypeScript support first before falling back to jiti, providing better performance when native support is available while maintaining backward compatibility.

Key Changes:

  • Changed the default CLI --config-loader option from 'jiti' to 'auto'
  • Updated documentation to reflect auto as the default loader
  • Refactored config loading logic to wrap jiti fallback in proper conditional check

Reviewed Changes

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

File Description
packages/core/src/cli/commands.ts Changed default config loader from 'jiti' to 'auto'
packages/core/src/loadConfig.ts Refactored jiti fallback logic and added Boolean wrapper for useNative flag
website/docs/en/guide/configuration/rsbuild.mdx Updated English documentation to list 'auto' as default loader
website/docs/zh/guide/configuration/rsbuild.mdx Updated Chinese documentation to list 'auto' as default loader

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

@chenjiahan chenjiahan merged commit 3a45792 into main Oct 22, 2025
11 checks passed
@chenjiahan chenjiahan deleted the config_loader_auto_1022 branch October 22, 2025 09:52
@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