yaml-frontmatter-loader

YAML Frontmatter loader for webpack. Converts YAML in files to JSON. You should chain it with json-loader.

Install

npm install yaml-frontmatter-loader

Usage

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' ]
      }
    ]
  }
}