YAML Loader (flat!) for webpack
Converts YAML to valid flat JSON. If you want to JS Object, chain it with json-loader.
$ npm install yaml-flat-loader
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' }
MIT © akameco