Skip to content

feat: externalType support global #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2025

Conversation

fireairforce
Copy link
Member

@fireairforce fireairforce commented May 23, 2025

Now turbopack's externalType only support the following types:

  • CommonJs
  • EcmaScriptModule
  • Url(seems not be supported completely)

The type CommonJs and EcmaScriptModule only support to use require() or import() to deal the external module(it's friendly to the NodeJS or Edege Runtime enviroment, seems not friendly to the browser enviroment), so meybe we can support the externalType like 'global'(https://webpack.js.org/configuration/externals/#externalstypeglobal) or other externalType like https://webpack.js.org/configuration/externals/#externalstypevar, which can help us to set the external module into a global var.

@fireairforce fireairforce changed the title feat: externlType support Global feat: support more externalTypes May 28, 2025
@fireairforce fireairforce force-pushed the fix-output-assets-extension branch from eee1b8f to 6e0b78a Compare May 29, 2025 11:42
@fireairforce fireairforce marked this pull request as ready for review May 29, 2025 11:43
@fireairforce fireairforce changed the title feat: support more externalTypes feat: externalType support global May 29, 2025
CachedExternalType::Global => {
writeln!(
code,
// TODO: change after v15.4
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice comment

@xusd320 xusd320 merged commit 503e027 into utoo-patch-v15.3.2 May 29, 2025
10 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants