ODE_ENV=production webpack --mode production --progress code example
Example: set env production webpack build
// webpack.config.js
module.exports = env => {
const isProduction = env.NODE_ENV === 'production'
// ...
return {
// ...
}
}
// package.json
{
...
"scripts": {
"build": "webpack --env.NODE_ENV=production"
},
...
}