Skip to content

Commit 82bd63f

Browse files
committed
feat(webpack): switch webpack config to use env string
BREAKING CHANGE: webpack env is now controlled by --env production or NODE_ENV.
1 parent 1e1f80a commit 82bd63f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

webpack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
},
2121
"scripts": {
2222
"start": "webpack-dev-server",
23-
"build": "rimraf dist && webpack --mode=production",
23+
"build": "rimraf dist && webpack --env production",
2424
}
2525
}

webpack/webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const HtmlWebpackPlugin = require('html-webpack-plugin');
22

3-
module.exports = function(env, { mode }) {
4-
const production = mode === 'production';
3+
module.exports = function(env) {
4+
const production = env === 'production' || process.env.NODE_ENV === 'production';
55
return {
66
mode: production ? 'production' : 'development',
77
devtool: production ? 'source-maps' : 'inline-source-map',

0 commit comments

Comments
 (0)