Vite plugin that converts Markdown files into Svelte component templates, enabling use of Svelte components directly within Markdown content. Current stable version is 0.6.0, released in March 2025. The plugin uses markdown-exit (an async-compatible fork of markdown-it) and supports frontmatter with YAML only. It is distributed as ESM-only, requires Node >=20, and works with Vite 3–8. Key differentiators: seamless integration with SvelteKit and Vite, support for Svelte script tags and components inside Markdown, and head tag generation from frontmatter.
npm install vite-plugin-svelte-mdVerified import paths — ran on the pinned version, not inferred.
Minimal Vite config with Svelte to process .svelte and .md files using vite-plugin-svelte-md.
Use ESM imports and update Node to 20+.
Update to v0.6.0 or later.
Convert frontmatter to YAML format.
Update plugins for markdown-exit compatibility if they relied on markdown-it specifics.
Set svelte({ extensions: ['.svelte', '.md'] }) in Vite config.Switch to import syntax or set type: 'module' in package.json.
Ensure svelte({ extensions: ['.md'] }) is configured.