Answer the question
In order to leave comments, you need to log in
Webpack 4 and Production Mode?
Hello, I set up Webpack 4 to build the project (4.29.0). In general, I figured everything out, but I can’t understand one moment with the build mode.
In webpack, there is a choice of how to include it, for the build I choose "webpack --mode production", the js file is compressed out of the box and everything seems to be fine.
1) But is everything really good? or is it better to use your settings for js compressions?
The issue with the process.env.NODE_ENV variable is also tormenting, in the webpack config it is equal to undefined.
Googling found a solution on how to configure the config for the desired mode
module.exports = (env, argv) => {
const devMode = argv.mode !== 'production'
// ....
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question