September 2018
Intermediate to advanced
328 pages
9h 10m
English
We're only generating a Wasm module, so we can use the build task we set up in the previous chapter to compile our code. Select Tasks | Run Build Task… or use the keyboard shortcut Ctrl/Cmd + Shift + B to compile the code. If you're not using VS Code, open a CLI instance in the /chapter-06-interact-with-js folder and run the following command:
emcc js-without-glue.cpp -Os -s WASM=1 -s SIDE_MODULE=1 -s BINARYEN_ASYNC_COMPILATION=0 -o js-without-glue.wasm
Once complete, open a terminal in the /book-examples folder, and run the following command to start your local server:
serve -l 8080
Open up a browser and navigate to http://127.0.0.1:8080/chapter-06-interact-with-js/js-without-glue.html. You should see something ...
Read now
Unlock full access