September 2017
Intermediate to advanced
120 pages
2h 47m
English
If we run the webpack command directly, we need to set up the path to the webpack executable and look up the right command-line options every time we run the build. Instead, we will create an entry in the scripts section of package.json that describes the build command, so we’ll be able to build the project with the correct options by typing only npm build.
Before we create the build command, we need to install a utility called cross-env to set environment variables in a way that works both for Windows and Unix systems:
| | $ npm i --save-dev cross-env |
Once you’ve downloaded cross-env, open package.json, and in the scripts section, create a new entry to run the build. When it installs an executable, npm places the ...
Read now
Unlock full access