feat(wasm)!: support wasm modules in ESM output with compile and preserve modes#1726
feat(wasm)!: support wasm modules in ESM output with compile and preserve modes#1726elecmonkey wants to merge 18 commits into
Conversation
Deploying rslib with
|
| Latest commit: |
2e3625e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a9223171.rslib.pages.dev |
| Branch Preview URL: | https://feat-wasm-phase-1.rslib.pages.dev |
|
The |
a47243f to
7c9f9c7
Compare
|
Temporarily marked as draft cuz I observe some outputs related to source phase imports are incorrect. I’m trying to fix these issues in Rspack: web-infra-dev/rspack#14673 & web-infra-dev/rspack#14674 |
312fb2a to
6fa95ff
Compare
7c36c3d to
d002906
Compare
d002906 to
0a7b5fb
Compare
70f157b to
5ccbcef
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de0e3cb7db
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3981846376
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40c2fbbddc
ℹ️ 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".
c8068de to
2e3625e
Compare
Summary
Add a
wasmlibrary option to control how.wasmmodules are handled in ESM output.wasm.mode:'compile'— Rspack parses the.wasmmodule and generates the JS glue and runtime to load it.'preserve'— keep.wasmas a real ESM import and emit the binary. In bundle mode the binary is emitted as a content-hashed asset; in bundleless mode it keeps the source-relative path and original filename.When
modeis unset, it defaults to'compile'forbundle: trueand'preserve'forbundle: false. The option is only effective forformat: 'esm'.Includes integration tests covering compile/preserve × bundle/bundleless, and a new WebAssembly guide (EN + ZH) documenting the modes, supported import forms (static, dynamic,
import source,import.source()), andwasm-bindgenusage.Checklist