Add different targets in your
"build:test": "webpack -p --config ./src/webpack.config.js", "build:prod": "webpack -p --define process.env.NODE_ENV='\"production\"' --config ./src/webpack.config.js",
Of course I am assuming you have
npm install webpack --save-dev. Now you can run
npm run build:test etc.
Using this variable is super easy as well: