yaml-frontmatter-loader

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

Configuration

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
         test: /\.md$/,
         use: [ 'json-loader', 'yaml-frontmatter-loader' ]
      }
    ]
  }
}

© JS Foundation and other contributors
Licensed under the Creative Commons Attribution License 4.0.
https://webpack.js.org/loaders/yaml-frontmatter-loader

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部