https://github.com/aircity/vue-cli-plugin-env-yaml
vue-cli 3.x plugin to inject environment variables
https://github.com/aircity/vue-cli-plugin-env-yaml
env vue vue-cli yaml
Last synced: about 1 month ago
JSON representation
vue-cli 3.x plugin to inject environment variables
- Host: GitHub
- URL: https://github.com/aircity/vue-cli-plugin-env-yaml
- Owner: Aircity
- Created: 2018-10-08T12:44:58.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-09T03:38:03.000Z (over 7 years ago)
- Last Synced: 2025-03-12T19:03:10.091Z (about 1 year ago)
- Topics: env, vue, vue-cli, yaml
- Language: JavaScript
- Homepage:
- Size: 22.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vue-cli-plugin-env-yaml
This is a vue-cli 3.x plugin to inject environment variables.
## Environment variables injection
env.yaml:
```
baseURL:
DEV: dev.org
QA: qa.org
PRD: prd.org
```
npm run build
```
console.log(baseURL)
// => dev.org
```
npm run build:qa
```
console.log(baseURL)
// => qa.org
```
npm run build:prd
```
console.log(baseURL)
// => prd.org
```
## Getting started
:warning: Make sure you have vue-cli 3.x.x:
```
vue --version
```
If you don't have a project created with vue-cli 3.x yet:
```
vue create my-new-app
```
Navigate to the newly created project folder and add the cli plugin:
```
cd my-new-app
vue add @o3o/env-yaml
```
Start your app:
```
npm run serve
```