The example Webpack application extends the functionality of the C code we wrote in the Compiling C without the glue code section of Chapter 5, Creating and Loading a WebAssembly Module. Instead of showing a blue rectangle bouncing around a red background, we'll show an alien in a spaceship bouncing around the Horsehead Nebula. The collision detection functionality has been modified to accommodate for bouncing within a rectangle, so the movement of the spaceship will be random. The code for this section is located in the /chapter-09-node/webpack-example folder in the learn-webassembly repository. The file structure for the project is shown in the following code:
├── /src
│ ├── /assets
│ │ ├── background.jpg
│ │ └── spaceship.svg
│ ├── App.js
│ ├── index.html
│ ├── index.js
│ ├── main.c
│ └── styles.css
├── package.json
├── package-lock.json
└── webpack.config.js
We'll review the Webpack configuration file in a later section. For now, let's take a moment to discuss Webpack in more detail.