Skip to content

ikeq/vite-plugin-markdown-to-js

Repository files navigation

vite-plugin-markdown-to-js npm

Markdown to script.

// vite.config.js
import markdownToJs, { transformImports, transformVue } from 'vite-plugin-markdown-to-js';

export default {
  plugins: [
    markdownToJs({
      transforms: [
        transformImports({ defaultPrefix: 'demo', base: './' }),
        transformVue({
          importsAsComponents: true,
        }),
      ],
      render(output, env) {
        return [
          `<template><div>${output.html}</div></template>`,
          output.script,
          output.style
        ].join('\n');
      },
      markedOptions: {},
    }),
  ],
};

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published