Description
It seems that the current WebAssembly integration imposes some restriction: #647.
💬 RFC
In order to provide the best integration we want wasm to be part of the ES module graph, and treated as any other ES module. It has some issues at the moment, you can find more details here https://github.com/WebAssembly/esm-integration (that we can avoid with some transformations).
Parcel don't necessarily need to expose the importObject
since it can be automatically wired for the user.
I propose you to use https://github.com/xtuc/webassemblyjs (disclaimer: i'm the author) to decode the wasm and apply transformations if needed (remove the start func, runtime, optimization etc).
🔦 Context
I'm currently working on the WebAssembly integration in Webpack.
💻 Examples
-
wasm decoding and introspection: https://github.com/webpack/webpack/blob/master/lib/wasm/WebAssemblyParser.js
-
transformation example: https://github.com/webpack/webpack/blob/master/lib/wasm/WebAssemblyGenerator.js