How can I get the current environment in the code? For example, when I develop, I want to simulate the results of user input...such as the results of scanning a QR code...
I read a few webpack configuration files and it said that node_env can be obtained. But no matter how I configure it, it has no effect...
if(ENV=='dev'){
console.log('开发环境');
}
else{
console.log('生产环境');
}
thank you all.
怪我咯2017-05-16 13:41:23
webpack has a plug-in
new webpack.DefinePlugin({
'ENV': '"production"'
})