edus44 / vue-cli-plugin-yaml

Add YAML support to Webpack using yaml-loader

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vue-cli-plugin-yaml

Add YAML support to Webpack using yaml-loader

Install

yarn add --dev vue-cli-plugin-yaml

npm install --save-dev vue-cli-plugin-yaml

There is no need to configure anything else

Usage

# src/config.yml

apiKey: abcd
// 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"

About

Add YAML support to Webpack using yaml-loader

License:MIT License


Languages

Language:JavaScript 100.0%