1.0.2 • Published 4 years ago

yaml-flat-loader v1.0.2

Weekly downloads
481
License
MIT
Repository
github
Last release
4 years ago

yaml-flat-loader Build Status

YAML Loader (flat!) for webpack

Converts YAML to valid flat JSON. If you want to JS Object, chain it with json-loader.

Install

$ npm install yaml-flat-loader

Usage

hello.yml

hello:
  world:
    webpack

webpack.config.js

module: {
  rules: [
    {
      test: /\.yml$/,
      use: [{ loader: 'json-loader' }, { loader: 'yaml-flat-loader' }]
    }
  ]
}

and then.

import hello from './hello.yml'

console.log(hello)
//  { 'hello.world': 'webpack' }

License

MIT © akameco