Compile Markdown to SolidJS component.
[WIP]
Install
pnpm i -D vite-plugin-markdown-solid
Add it to vite.config.ts
[!NOTE]
Markdown()
should be placed beforeSolid()
// vite.config.ts
import { defineConfig } from 'vite'
import markdown from 'vite-plugin-markdown-solid'
import solid from 'vite-plugin-solid'
export default defineConfig({
plugins: [
markdown(),
solid({ extensions: ['.md'] }),
],
})
See the type definitions.
See the playground.
declare module '*.md' {
import type { Component } from 'solid-js'
const Component: Component
export default Component
}
MIT License © 2024-PRESENT Jiakun Zhao