diff --git a/examples/wasm2js/README.md b/examples/wasm2js/README.md index 8db5c7a14..8a343b13a 100644 --- a/examples/wasm2js/README.md +++ b/examples/wasm2js/README.md @@ -14,4 +14,4 @@ $ ./build.sh (or running the commands on Windows manually) -and then visiting http://localhost:8080 in a browser should run the example! +and then visiting http://localhost:8000 in a browser should run the example! diff --git a/examples/wasm2js/build.sh b/examples/wasm2js/build.sh index 9100b26cd..deb7d1d1a 100755 --- a/examples/wasm2js/build.sh +++ b/examples/wasm2js/build.sh @@ -3,13 +3,12 @@ set -ex # Compile our wasm module and run `wasm-bindgen` -wasm-pack build +wasm-pack build --target web # Run the `wasm2js` tool from `binaryen` wasm2js pkg/wasm2js_bg.wasm -o pkg/wasm2js_bg.js -# Move our original wasm out of the way to avoid cofusing Webpack. -mv pkg/wasm2js_bg.wasm pkg/wasm2js_bg.bak.wasm +# Update our JS shim to require the JS file instead +sed -i 's/wasm2js_bg.wasm/wasm2js_bg.js/' pkg/wasm2js.js -npm install -npm run serve +http diff --git a/examples/wasm2js/index.html b/examples/wasm2js/index.html index 675fa94dc..cee977295 100644 --- a/examples/wasm2js/index.html +++ b/examples/wasm2js/index.html @@ -5,4 +5,5 @@
Open up the developer console to see "Hello, World!"
+