How to do it...

Let's now start the configuration:

  1. Open package.json, and add a new build 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.6.0",      "webpack-cli": "^2.0.15"    }  }
File: package.json
  1. Run the build script in your terminal:
    npm run build
  1. You will see this error:
The error you get in the terminal will look like this: ERROR in Entry module not found: Error: Can't resolver'./src' in '/Users/czantany/projects/React16Cookbook/Chapter9/Recipe1/webpack-zero-configuration' ...

Get React Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.