You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry if this is in the wrong place; I wasn't certain where/who else to ask. Contained within the deployment.md file is a section detailing:
Node.js Module
--target experemintal-nodejs-module
If you're deploying WebAssembly into Node.js as a JavaScript module,
then you'll want to pass the --target experimental-nodejs-module flag to wasm-bindgen.
Like the "node" strategy, this method of deployment does not
require any further postprocessing. The generated JS shims can be imported
just like any other Node module.
Note that this method requires a version of Node.js with WebAssembly and module support,
which is currently Node 12 and above.
Currently experimental. Target is expected to be changed before stabilization.
... that suggests passing --target experimental-nodejs-module to wasm-bindgen may allow for the generation of non-webpack-exclusive JS modules.
The only problem is, wasm-pack doesn't seem to support that flag value (although bundler, web, nodejs, deno, no-modules all seem to work fine). I'm not crystal-clear HOW to pass a flag directly to wasm-bindgen (as every example I find seems to be leveraging wasm-pack, and I cannot figure out where the reference to bindgen is occurring).
Any suggestions would be most welcome?
The text was updated successfully, but these errors were encountered:
NerdyDeedsLLC
changed the title
QUESTION: How does one leverage the
QUESTION: How does one leverage the --target experimental-nodejs-module flag
Nov 6, 2024
NerdyDeedsLLC
changed the title
QUESTION: How does one leverage the --target experimental-nodejs-module flag
QUESTION: How does one leverage the --target experimental-nodejs-module flag?
Nov 6, 2024
Hey gang:
Sorry if this is in the wrong place; I wasn't certain where/who else to ask. Contained within the
deployment.md
file is a section detailing:... that suggests passing
--target experimental-nodejs-module
towasm-bindgen
may allow for the generation of non-webpack-exclusive JS modules.The only problem is,
wasm-pack
doesn't seem to support that flag value (althoughbundler
,web
,nodejs
,deno
,no-modules
all seem to work fine). I'm not crystal-clear HOW to pass a flag directly towasm-bindgen
(as every example I find seems to be leveragingwasm-pack
, and I cannot figure out where the reference tobindgen
is occurring).Any suggestions would be most welcome?
The text was updated successfully, but these errors were encountered: