your code tries to load things such as path & fs and uses require()
that ain't so browser friendly...
could you create a bundle that don't depend on NodeJS stuff...?
i would pretty much more want it to depend on loading the wasm file over relative import from import.meta.url. and uses streaming instead.
it would also be nice if it used top level await.
const req = fetch(new URL('./xyz.wasm', import.meta.url))
const mod = await WebAssembly.instantiateStreaming(req, { ... })
export {
...
}
your code tries to load things such as path & fs and uses
require()that ain't so browser friendly...
could you create a bundle that don't depend on NodeJS stuff...?
i would pretty much more want it to depend on loading the wasm file over relative import from
import.meta.url. and uses streaming instead.it would also be nice if it used top level await.