Webpack loader for YAML files that directly gives you an object to work with.
npm install --save-dev uwx/tiny-yaml-loader
const json = require('tiny-yaml-loader!./file.yml');
main.js
const json = require('./file.yml');
webpack.config.js
module.exports = {
module: {
loaders: [
{
test: /\.yml$/,
loader: 'tiny-yaml-loader'
}
]
}
}
Based on okonet/yaml-loader and webpack-contrib/json-loader, with code from francois2metz/yaml-loader/add_tests