md-vue-loader

Webpack loader to import markdown files as a Vue component
905 4
Install
npm install md-vue-loader
Latest Version:2.0.0
Vue:2
License:MIT
Last Updated:Oct 11, 2025
Links: GitHub  ·  npm
Maintainer: hirokiosame

mdvue-loader

Webpack loader to import markdown files as Vue components. Compatible with vue-loader v15.

npm install --save-dev mdvue-loader

webpack.config.js

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

Inline demos

You can inline vue codeblocks as inline demos by enabling the buildDemos option.

{
  loader: 'mdvue-loader',
  options: {
    buildDemos: true
  }
}

Pass in a function with the following signature to control how the component is inlined: function (demoTag, files)

Multi-file demos

Demos can be multi-file by:

  1. Naming a codeblock by prepending it with the filename in underscores
  2. Importing that file via the doc alias
<template>
  <hello-world />
</template>

<script>
import HelloWorld from 'doc/HelloWorld.vue';

export default {
  components: {
    HelloWorld
  }
}
</script>

HelloWorld.vue

<template>
  <div>
    Hello World
  </div>
</template>

Related Packages

vue-markdown-loader

markdown file to vue component loader.

81,231 693
@vusion/md-vue-loader

Webpack loader for converting Markdown files to alive Vue components.

19,363 5
vue-antd-md-loader

markdown file to vue component loader.

7,756 7
v-markdown-loader

markdown file to vue component loader.

1,489 693
vue-md-loader

Webpack loader for converting Markdown files to ALIVE Vue components.

21,691 119

Version History

Version Released Vue License
2.0.0 ^2.6.11 MIT
1.1.0 ^2.5.13 MIT
1.0.1 ^2.5.13 MIT
1.0.0 ^2.5.13 MIT
Pre-releases (3)
Version Released Vue License
0.0.1-beta-3 ^2.5.13 MIT
0.0.1-beta-2 ^2.5.13 MIT
0.0.1-beta-1 MIT