Skip to content

Bundler output#51

Merged
WorldSEnder merged 9 commits into
mainfrom
bundler-output
Jul 17, 2026
Merged

Bundler output#51
WorldSEnder merged 9 commits into
mainfrom
bundler-output

Conversation

@WorldSEnder

@WorldSEnder WorldSEnder commented Jul 16, 2026

Copy link
Copy Markdown
Owner

This enables a webpack compatible output. For now, this depends on two experimental options in webpack, asyncWebAssembly and sourceImport. asyncWebAssembly can most likely be replaced with syncWebAssembly on some downstream configurations and is not as required as this comment makes it seem. sourceImport is wired into the javascript emitted from js.rs though in the __wasm_split.js file. Other syntax there should be possible, but fetch is not supported in node environments, so this is the only way I can see to load but not instantiate a wasm module for now.

Partially resolves #4, other environments such as bun or simple node/commonjs are not in this PR.

does not use wasm-pack, to avoid having to
upstream changes and the dependency on
wasm-split. The correct wasm-bindgen version
is figured out automatically, similar to how it
is done in the test-runner.
the internal testing of the generated webpack
module is not contained
this is (unsurprisingly) a lot more fiddly on
javascript side. We need: import.source, since
we can't rely on `fetch` in node.
previously would always succeed after loading,
no matter the function behaviour.
@WorldSEnder
WorldSEnder merged commit deb4459 into main Jul 17, 2026
7 checks passed
@WorldSEnder
WorldSEnder deleted the bundler-output branch July 20, 2026 13:05
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.

Support non-web wasm targets

1 participant