Minimal example making webpack and wasm/Emscripten work together.
Build instructions:
- Clone this gist
npm install
npm 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
Following my previous comment, I digged in a bit more:
First, I think it's important to mention that I'm working with a webpack config created by create-react-app that I override using https://github.com/timarney/react-app-rewired
With this webpack override config
I get two files are generated in the build:
/public/static/media/rPPG_asm.6074f4a1.wasm
which containsand
/public/static/wasm/dad54818a8426f637a10e1e56c6659b5.wasm
which contains the actual wasm
Thing is, the path provided in the
LocateFile
function is this one/public/static/media/rPPG_asm.6074f4a1.wasm
so the glue code tries to load that as valid WASM hence the magic number error.What am I missing here ? :)