VUE_APP_TITLE=My App
NODE_ENV=production
# 生产环境配置
ENV = 'production'
## 地址
VUE_APP_SERVER_URL = 'http://124.88.74.211:3000/internet'
VUE_APP_WS_URL = 'ws://127.0.0.1:8082/ws/internet/data'
console.log(process.env.VUE_APP_SERVER_URL)
# 生产环境配置
ENV = 'production'
## 地址
VUE_APP_SERVER_URL = 'http://127.0.0.1:3000/pwmsyplat'
VUE_APP_WS_URL = 'ws://127.0.0.1:8082/ws/internet/data'
console.log(process.env.VUE_APP_SERVER_URL)
除了 `VUE_APP_*` 变量之外,在你的应用代码中始终可用的还有两个特殊的变量:
- `NODE_ENV` - 会是 `"development"`、`"production"` 或 `"test"` 中的一个。具体的值取决于应用运行的[模式](https:
- `BASE_URL` - 会和 `vue.config.js` 中的 `publicPath` 选项相符,即你的应用会部署到的基础路径。
.local
也可以加在指定模式的环境文件上,比如 .env.development.local
将会在 development 模式下被载入,且被 git 忽略。