{"id":22860,"library":"vite-plugin-svelte-md","title":"vite-plugin-svelte-md","description":"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.","status":"active","version":"0.6.0","language":"javascript","source_language":"en","source_url":"https://github.com/ota-meshi/vite-plugin-svelte-md","tags":["javascript","vite","vite-plugin","svelte","markdown","markdown-it","markdown-exit"],"install":[{"cmd":"npm install vite-plugin-svelte-md","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-svelte-md","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-svelte-md","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency, plugin only works within Vite projects","package":"vite","optional":false}],"imports":[{"note":"ESM-only since v0.3.0. CommonJS require() will throw an error.","wrong":"const svelteMd = require('vite-plugin-svelte-md')","symbol":"default","correct":"import svelteMd from 'vite-plugin-svelte-md'"}],"quickstart":{"code":"import { defineConfig } from 'vite';\nimport { svelte } from '@sveltejs/vite-plugin-svelte';\nimport svelteMd from 'vite-plugin-svelte-md';\n\nexport default defineConfig({\n  plugins: [\n    svelteMd(),\n    svelte({\n      extensions: ['.svelte', '.md'],\n    }),\n  ],\n});","lang":"typescript","description":"Minimal Vite config with Svelte to process .svelte and .md files using vite-plugin-svelte-md."},"warnings":[{"fix":"Use ESM imports and update Node to 20+.","message":"ESM-only since v0.3.0; Node >=20 required.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Update to v0.6.0 or later.","message":"Replaced deprecated `context=\"module\"` with `module` attribute in Svelte 5.","severity":"deprecated","affected_versions":">=0.6.0"},{"fix":"Convert frontmatter to YAML format.","message":"Replaced gray-matter with yaml parser in v0.5.0; JS/JSON frontmatter no longer supported.","severity":"breaking","affected_versions":">=0.5.0"},{"fix":"Update plugins for markdown-exit compatibility if they relied on markdown-it specifics.","message":"Replaced markdown-it with markdown-exit in v0.4.0; async plugins now supported.","severity":"breaking","affected_versions":">=0.4.0"},{"fix":"Set svelte({ extensions: ['.svelte', '.md'] }) in Vite config.","message":"Must add '.md' to Svelte plugin's extensions list to process .md files.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Switch to import syntax or set type: 'module' in package.json.","cause":"Using require() with ESM-only package since v0.3.0.","error":"ERR_REQUIRE_ESM: require() of ES Module not supported"},{"fix":"Ensure svelte({ extensions: ['.md'] }) is configured.","cause":".md extension not registered with the Svelte plugin.","error":"Unknown file extension \".md\""}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}