Webpack 4 has two modes: production and development. In Webpack 3, you needed to create a config file for each one; now you can get the same result just with a single line. Let's add a script to get our application to start using the development mode:
{ "name": "webpack-zero-configuration", "version": "1.0.0", "description": "Webpack 4 Zero Configuration", "main": "index.js", "scripts": { "build-development": "webpack --mode development", "build": "webpack --mode production" }, "author": "Carlos Santana", "license": "MIT", "devDependencies": { "webpack": "^4.6.0", "webpack-cli": "^2.0.15" } }
If you run the npm run build-development command, now you will see that the bundle is not compressed at all: