Open codevvvv9 opened 2 years ago
Register it correctly.
import { defineConfig } from 'vite';
import mdPlugin, {Mode} from 'vite-plugin-markdown';
export default defineConfig({
plugins: [
mdPlugin({ mode: [Mode.HTML, Mode.TOC, Mode.VUE] })
],
});
I tried that, but I got an error: TypeError: mdPlugin is not a function
. (Version 2.1.0)
console.log(mdPlugin)
shows it as
{
Mode: { TOC: 'toc', HTML: 'html', REACT: 'react', VUE: 'vue' },
plugin: [Function: plugin],
default: [Function: plugin]
}
Changing the import to
import {plugin as mdPlugin, Mode} from 'vite-plugin-markdown';
fixed it for me. I don't understand what is wrong there, though.
vite.config.ts is:
but npm run dev get error - Dynamic require of "vite-plugin-markdown" is not supported: