提交 75a6ef06 编写于 作者: L Luis Fernando Alvarez D 提交者: Tim Neutkens

Moved NODE_ENV to our config (#6965)

Closes #6943 
上级 f89bd823
......@@ -129,9 +129,11 @@ export default function getBaseWebpackConfig (dir: string, {dev = false, debug =
'amp-toolbox-optimizer' // except this one
],
optimization: isServer ? {
nodeEnv: false,
splitChunks: false,
minimize: false
} : Object.assign({
nodeEnv: false,
runtimeChunk: __selectivePageBuilding ? false : {
name: CLIENT_STATIC_FILES_RUNTIME_WEBPACK
},
......@@ -253,6 +255,7 @@ export default function getBaseWebpackConfig (dir: string, {dev = false, debug =
[`process.env.${key}`]: JSON.stringify(config.env[key])
}
}, {})),
'process.env.NODE_ENV': JSON.stringify(webpackMode),
'process.crossOrigin': JSON.stringify(config.crossOrigin),
'process.browser': JSON.stringify(!isServer),
// This is used in client/dev-error-overlay/hot-dev-client.js to replace the dist directory
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册