Skip to content

Conversation

9aoy
Copy link
Contributor

@9aoy 9aoy commented Sep 29, 2025

Summary

update default externalsType as commonjs-import.

https://rspack.rs/config/externals#externalstypecommonjs-import

Related Links

Checklist

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

@Copilot Copilot AI review requested due to automatic review settings September 29, 2025 07:31
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 updates the default externals type from dynamic selection between 'commonjs'/'import' or 'commonjs'/'module-import' to a fixed 'commonjs-import' type across all configurations. The change simplifies external module handling by using a single consistent format that supports both CommonJS and ES module imports.

  • Replaces conditional dependency type logic with fixed 'commonjs-import' external type
  • Sets default externalsType configuration to 'commonjs-import'
  • Updates built-in module handling to use builtinModules array instead of isBuiltin function

Reviewed Changes

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

File Description
packages/core/src/core/plugins/external.ts Updates external module resolution logic to use 'commonjs-import' type consistently and refactors built-in module detection
packages/core/tests/core/snapshots/rsbuild.test.ts.snap Updates test snapshots to reflect new externalsType configuration and expanded built-in modules list

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

Copy link

netlify bot commented Sep 29, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit 08d5ee3
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/68da35e5bc281900088ea240
😎 Deploy Preview https://deploy-preview-605--rstest-dev.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.

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