//webpack 配置如下:if(env.production) {
plugins.push(
new MiniCssExtractPlugin({
filename: path.posix.join(__dirname, '../dist/style.css')
}),
new webpack.DefinePlugin({ 'process.env': {
NODE_ENV: '"production"'
}
})
)
}
console.log('值='+process.env.NODE_ENV)圖片描述通過DefinePlugin賦值,值顯示為undefined,不知道是出了什么原因?
webpeack配置的全局變量為undefined?
富國滬深
2018-08-18 17:30:14