vue-markdown-loader is a Webpack loader designed to convert Markdown files into Vue 2 components, utilizing the popular `markdown-it` parsing library. The current stable version is 2.5.0. The package has seen limited updates and its README explicitly advises developers to consider "other better choices," suggesting it is in maintenance mode or effectively deprecated for new projects. It differentiates itself by enabling direct embedding of Vue `<script>` and `<style>` blocks within Markdown content, offering features like hot reloading, code highlighting, and flexible `markdown-it` configuration options. Its typical release cadence is infrequent, with the last major update (v2.0.0) focusing on automatic script/style extraction. It's primarily used for rendering dynamic documentation or content pages within Vue applications built with Webpack, requiring peer dependencies like `vue-loader` and `vue-template-compiler` for its operation.
npm install vue-markdown-loaderVerified import paths — ran on the pinned version, not inferred.
This webpack.config.js demonstrates how to integrate `vue-markdown-loader` with `vue-loader` v15+ for compiling Markdown files into Vue components, including key options like `raw` and `preventExtract`.
Consider alternatives like `vmark`, `ware-loader`, or `vue-md-loader` for new projects, as suggested in the package's documentation.
If you do not want this automatic extraction behavior, set the `preventExtract: true` option in your loader configuration.
Ensure your `webpack.config.js` or `vue.config.js` includes `{ loader: 'vue-markdown-loader/lib/markdown-compiler', options: { raw: true } }` in the loader chain for `.md` files.Add `const VueLoaderPlugin = require('vue-loader/lib/plugin');` to your webpack config and instantiate `new VueLoaderPlugin()` in the `plugins` array. Ensure `vue-loader` and `vue-template-compiler` versions are compatible.Verify that your webpack rule for `.md` files uses `vue-markdown-loader/lib/markdown-compiler` and includes `options: { raw: true }`. Also, ensure `vue-loader` is applied after `vue-markdown-loader` in the chain.If you want to prevent automatic extraction and handle scripts/styles manually (e.g., through `vue-loader`), set the `preventExtract: true` option in `vue-markdown-loader`'s options.