process.env前端环境变量配置教程
npm install process
VUE_APP_TITLE='dev'
NODE_ENV = 'development'
VUE_APP_TITLE = 'development'
/*请求接口地址*/
VUE_APP_INTERFACE_URL="https://xxx"
/*首页地址*/
VUE_APP_URL="http://xxx"
/*proxy代理地址*/
VUE_APP_PROXYURL='http://xxx'
NODE_ENV = production
VUE_APP_TITLE = 'prod'
/*请求接口地址*/
VUE_APP_INTERFACE_URL="https://xxx"
/*首页地址*/
VUE_APP_URL="http://xxx"
package.json
"scripts": {
"dev": "vue-cli-service serve --mode dev",
"build": "vue-cli-service build --mode dev",
"lint": "vue-cli-service lint",
"build-sit": "vue-cli-service build --mode sit",
"build-uat": "vue-cli-service build --mode uat",
"build-pre": "vue-cli-service build --mode pre",
"build-prod": "vue-cli-service build --mode prod"
},
console.log(process.env.NODE_NEV)
评论