frontmatter-markdown-loader is the Webpack Loader for: FrontMatter (.md) which returns Compiled HTML + Attributes.

A markdown file something.md:

---
subject: Hello
tags:
  - tag1
  - tag2
---
# Title

message

is loadable as:

import fm from "something.md"

fm.attributes //=> { subject: "Hello", tags: ["tag1", "tag2"] }
fm.html //=> "<h1>Title</h1>\n<p>message</p>\n"

And there are some convenience features for Vue stack 😉

# Setup

The module is published on npmjs.org (opens new window).

npm i -D frontmatter-markdown-loader
yarn add -D frontmatter-markdown-loader

# Configure Webpack

Add this loader setting to your Webpack's config.

{
  test: /\.md$/,
  loader: 'frontmatter-markdown-loader'
}

You can change test as you need.