From 13b74b8f363ccbc5458ba1ce4affca166482378d Mon Sep 17 00:00:00 2001 From: Peter Pan Date: Fri, 2 Feb 2018 11:16:17 +0800 Subject: [PATCH] fix #2741: add staging environment via NODE_ENV --- lib/builder/webpack/client.config.js | 2 +- lib/builder/webpack/server.config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/builder/webpack/client.config.js b/lib/builder/webpack/client.config.js index d045553741..4d4be07f98 100644 --- a/lib/builder/webpack/client.config.js +++ b/lib/builder/webpack/client.config.js @@ -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), diff --git a/lib/builder/webpack/server.config.js b/lib/builder/webpack/server.config.js index 66faf84d58..e92939f81f 100644 --- a/lib/builder/webpack/server.config.js +++ b/lib/builder/webpack/server.config.js @@ -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),