i developed react app,before that i built same app on webpack v3 now i upgrade to v4.
on v3 dev-server it worked fine but on v4 it is taking lot of time to build and every time its building whole project again(may be that's why)
my webpack.dev.js
const webpack = require('webpack'); const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); module.exports = { entry: './src/app.js', output: { path: path.join(__dirname, 'public'), filename: 'bundle.js' }, devtool: 'inline-source-map', module: { rules: [ { test: /\.js$/, exclude: /node_modules/, use: { loader: "babel-loader" } }, { test: /\.s?css$/, use: [ MiniCssExtractPlugin.loader, { loader: 'css-loader', options: { sourceMap: true, minimize:false, importLoaders: 1, } }, { loader: 'sass-loader', options: { sourceMap: true } } ] },{ test: /\.(gif|svg|jpg|png|ttf|eot|woff(2)?)(\?[a-z0-9=&.]+)?$/, loader: "file-loader", } ] }, plugins: [ new MiniCssExtractPlugin({ filename: 'styles.css', }), new HtmlWebpackPlugin({ template: './src/index.html', filename: 'index.html' }), new webpack.DefinePlugin({ 'process.env': { 'NODE_ENV': JSON.stringify('development') } }) ], devServer: { contentBase: path.join(__dirname, 'public'), historyApiFallback: true, host:'0.0.0.0', disableHostCheck: true, } }; and my scripts in package.json
"scripts": { "start": "node server/server.js", "build": "webpack --mode production --config=webpack.prod.js", "dev": "webpack --mode development --config=webpack.dev.js", "dev-server": "webpack-dev-server --config=webpack.dev.js" } it showing me error
ou are currently using minified code outside of NODE_ENV === 'production'. This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) to ensure you have the correct code for your production build.
but if console my process.env.NODE_ENV varialbe it showing me developement
i have two problems with dev-server on development mode
1) how can i reduce time of rebuilding on dev-server 2)on development mode also why it showing me production error.

developmentmode,webpackaddsnew DefinePlugin(process.env.NODE_ENV)on its own. So always specify mode, and don't explicitly useDefinePluginfor that. You can also specifymodein config itself.