Webpack configurations setup for separate environment | React Tutorials

2 years ago
16

Setup Webpack configurations for a separate environment
------------------------------------------------------------------------------------------
Steps need to do…..

1. First need to setup webpack environment
2. In package.json file, update script section with below lines
"scripts":
"start": "webpack-dev-server --open --config webpack.dev.js",
"build": "webpack --config webpack.prod.js"

3. Add 3 files
a) webpack.prod.js // for production environment
b) webpack.dev.js // for development environment
c) webpack.common.js // for common properties what we use in both environment

4. Use ‘npm install’ to add below plugins
npm install Path,
npm install webpack-merge,
npm install html-webpack-plugin

Loading comments...