Compiling to Wasm

After populating the file, we need to compile it down to Wasm for use in the JavaScript portion of the application. Run the build task by selecting Tasks | Run Build Task... from the menu or using the keyboard shortcut Cmd/Ctrl + Shift + B. If the build was successful, you'll see a file named main.wasm in the /src/assets folder. If an error occurred, the terminal should provide details on how to resolve it.

If you're not using VS Code, open a terminal instance in the /cook-the-books folder and run the following command:

emcc lib/main.c -Os -s WASM=1 -s SIDE_MODULE=1 -s BINARYEN_ASYNC_COMPILATION=0 -o src/assets/main.wasm

That's it for the C code. Let's move on to the JavaScript portion.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset