YAML Frontmatter loader for webpack. Converts YAML in files to JSON. You should chain it with json-loader.
npm install yaml-frontmatter-loader
var json = require("json-loader!yaml-frontmatter-loader!./file.md");
// => returns file.md as javascript object
##
webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.md$/,
use: [ 'json-loader', 'yaml-frontmatter-loader' ]
}
]
}
}