fix #2741: add staging environment via NODE_ENV

This commit is contained in:
Peter Pan 2018-02-02 11:16:17 +08:00
parent 1582df149d
commit 13b74b8f36
2 changed files with 2 additions and 2 deletions

View File

@ -92,7 +92,7 @@ module.exports = function webpackClientConfig() {
new webpack.DefinePlugin(
Object.assign(env, {
'process.env.NODE_ENV': JSON.stringify(
env.NODE_ENV || (this.options.dev ? 'development' : 'production')
this.options.env.NODE_ENV || (this.options.dev ? 'development' : 'production')
),
'process.env.VUE_ENV': JSON.stringify('client'),
'process.mode': JSON.stringify(this.options.mode),

View File

@ -47,7 +47,7 @@ module.exports = function webpackServerConfig() {
new webpack.DefinePlugin(
Object.assign(env, {
'process.env.NODE_ENV': JSON.stringify(
env.NODE_ENV || (this.options.dev ? 'development' : 'production')
this.options.env.NODE_ENV || (this.options.dev ? 'development' : 'production')
),
'process.env.VUE_ENV': JSON.stringify('server'),
'process.mode': JSON.stringify(this.options.mode),