Maybe you have noticed that we are using import statements used for ES6 modules? There are many ways to make that work, but we choose a modern option, namely, utilizing webpack. We will need to do the following to set up webpack successfully:
- Install the npm libraries webpack and webpack-cli
- Create a webpack.config.js file and specify the entry point of your application
- Add an entry to the package.json file so that we can build and run our app with a simple npm start
- Add a HTTP server so that we can show the app
We can install the needed libraries by typing:
npm install webpack webpack-cli --save-dev
Thereafter, we need to create our config file, webpack.config.js, like so:
// dataflow/webpack.config.jsmodule.exports ...