feat(core)!: use modern-module externals type for ESM - #1672
Conversation
Deploying rslib with
|
| Latest commit: |
5c23ae2
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f70bc5d9.rslib.pages.dev |
| Branch Preview URL: | https://david-modern-module-external.rslib.pages.dev |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 87ff22e106
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
bcf4bbe to
28f0e83
Compare
|
pending
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7baca3eb91
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
7baca3e to
5c23ae2
Compare
Summary
This PR changes the default ESM
externalsTypeto Rspack'smodern-modulefor all output targets. Staticimportexternals remain ESM imports, dynamicimport()externals remain dynamic, and CommonJSrequire()externals usecreateRequirefor Node-like targets or a barerequire()for other targets.It also removes the legacy CommonJS external warning path and the no-longer-needed
autoCjsNodeBuiltinRslibPlugin option.When external modules loaded through
createRequire()are bundled again, the consuming bundler must statically analyze this call pattern; Rspack supports it throughmodule.parser.javascript.createRequire.Related Links
https://rspack.rs/config/externals#externalstypemodern-module
https://rspack.rs/config/module-parser#javascriptcreaterequire
Checklist