Minimal example making webpack and wasm/Emscripten work together.
Build instructions:
- Clone this gist
npm installnpm start- Open
http://localhost:8080 - Look at console
Note: Docker is required to build this project.
I filed a bug with webpack to make this integration easier.
More questions? Hit me up on Twitter.
License Apache-2.0
<3 Surma
Came back to add another update, used this technique to successfully load a
.wasmfile from a location other than the same directory as the.jsfile that Emscripten generates to load said.wasmfile.My issues was effectively the same as this question:
https://stackoverflow.com/questions/46332699/how-can-i-load-wasm-files-stored-in-a-subdirectory
Some differences I experienced / gotchas:
publicPathfor the file-loader config is incorrect fetch requests for the.wasmfile will fail (404) causing the streaming compilation to fail (expected magic word 00 61 73 6d) as it tired to load the response, so double check that this is correct.exports-loader, not sure if this will cause issues later, hopefully not!Many Thanks!