We will first add the Webpack Dev Server:
- Once you installed the webpack-dev-server dependency, we need to add a new script to start the application in our package.json:
"scripts": { "start": "webpack-dev-server --mode development --open", "build-development": "webpack --mode development", "build": "webpack --mode production" }
File: package.json
- As you know, the --mode flag specifies the mode we want (the default is production), and the --open flag opens the browser when we start the application. Now you can run the application with the npm start command:
- Your application was opened using port 8080, which is the default ...