To run the React application, we need to install webpack 4 (while writing this book, the current stable version of webpack is version 4) and webpack CLI as devDependencies. Let's get started:
- Install these packages from npm using the following command:
npm install --save-dev webpack webpack-cli
- The next step is to include these packages inside the package.json file and have them run in our start and build scripts. To do this, add the start and build scripts to our package.json file:
{ "name": "movieList", "version": "1.0.0", "description": "", "main": "index.js", "scripts": {_ "start": "webpack --mode development",+ "build": "webpack --mode production", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": ...