Webpack 4 Zero Configuration
Webpack 4 does not need a configuration file by default. In the older versions, you had to have a configuration file. If you need to customize Webpack 4 to your project's needs, you can still create a configuration file, which will be much easier to configure.
Getting Ready
For this recipe, you need to create a new folder and install the following packages:
mkdir webpack-zero-configuration cd webpack-zero-configuration npm install --save-dev webpack webpack-cli
In your Webpack folder, you need to create a package.json
file, and for this, you can use the following command:
npm init -y
How to do it...
Let's now start the configuration:
- Open
package.json
, and add a newbuild
script:
{ "name": "webpack-zero-configuration", "version": "1.0.0", "description": "Webpack 4 Zero Configuration", "main": "index.js", "scripts": { "build": "webpack" }, "author": "Carlos Santana", "license": "MIT", "devDependencies": { "webpack": "^4...