Allow override NODE_ENV with env config.

This allows debugging SSR hydration problems easier in production. (#727 and #574)
This commit is contained in:
Pooya Parsa 2017-05-21 14:18:22 +04:30
parent c6556c6b8b
commit 054df82200

View File

@ -46,7 +46,7 @@ export default function () {
config.plugins = (config.plugins || []).concat([
// Strip comments in Vue code
new webpack.DefinePlugin(Object.assign(env, {
'process.env.NODE_ENV': JSON.stringify(this.dev ? 'development' : 'production'),
'process.env.NODE_ENV': JSON.stringify(env.NODE_ENV || (this.dev ? 'development' : 'production')),
'process.BROWSER_BUILD': true,
'process.SERVER_BUILD': false,
'process.browser': true,