vue-cli-plugin-yaml
Version:
Add YAML support to Webpack using yaml-loader
31 lines (20 loc) • 520 B
Markdown
Add YAML support to Webpack using yaml-loader
```
yarn add --dev vue-cli-plugin-yaml
```
There is no need to configure anything else
```yaml
apiKey: abcd
```
```js
// src/main.js
import config from './config.yml'
import config from './config' // extension can be omitted
console.log(config) // { "apiKey": "abcd" }
import { apiKey } from '@/config' // Using @ alias for src
console.log(apiKey) // "abcd"
```