/config/dev.env.js
/config/prod.env.js
var merge = require('webpack-merge')
var prodEnv = require('./prod.env')
module.exports = merge(prodEnv,{
NODE_ENV: '"development"'
})
,API_ROOT: '"//192.168.1.8/api"'
})
module.exports = {
NODE_ENV: '"production"'
}
// 配置API接口地址
var root = 'https://cnodejs.org/api/v1'
var root = process.env.API_ROOT
npm run dev
npm run build
process.env.NODE_ENV == 'production'; 生产环境
process.env.NODE_ENV == 'development'; 开发环境