Building and running the application

Using the cpp-wasm-loader library eliminates the need for a build step to generate a Wasm module, but we still need to bundle up our application for distribution. In the scripts section of package.json, there's a build and start script. Running the build script executes the webpack command that generates the bundle. To ensure this is working correctly, open a terminal instance in the /webpack-example folder and run the following command:

npm run build

It may take a minute to build the project the first time you run it. This can be attributed to the Wasm compilation step. However, subsequent builds should be much faster. If the build was successful, you should see a newly created /dist folder with these contents:

├── /assets
│ ├── background.jpg
│ └── spaceship.svg
├── index.html
├── main.css
├── main.js
└── main.wasm
..................Content has been hidden....................

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