kilicmu

Vite plugin vue markdown resolver

### information

Version Version: 1.0.0-dev-0 Version Updated: 05/02/2021 By: kilicmu

DownloadsLast30Days: 23

npm i vite-plugin-vue-markdown-resolver
yarn add vite-plugin-vue-markdown-resolver

vite-plugin-vue-markdown-resolver

information

this is a plugin for vite. you can use it to import markdown files like vue components now, only supports @vue3

Quick Start

vite.config.ts:

import {defineConfig} from "vite"
import md from "vite-plugin-vue-markdown-resolver"

export default defineConfig({
    //...
    plugins: [
        md({})
    ],
    //...
})

App.vue

<template>
  <RulesDocs></RulesDocs>
</template>

<script lang="ts" setup>
import RulesDocs from "vite-plugin-vue-markdown-resolver/docs/rules.md"
</script>

configs:

  • plugin

you can set some awesome markdown-it plugin to control markdown rules. you can add your plugin like this:

import PWOOP from "plugin-without-options-or-params"
import PWO from "plugin-with-options"
import PWP from "plugin-with-params"
md({
    plugins: [
        PWOOP, // with out options
        {
            plugin: PWO
            options: {
                // some options
            }
        },
        {
            plugin: PWP,
            params: [
                '',
                {},
                // other params
            ]
        }

    ]
})
Tags: viteplugin

Copyright © 2020 vuejscomponent.com