Gathering detailed insights and metrics for vite-plugin-solid-markdown
Gathering detailed insights and metrics for vite-plugin-solid-markdown
Gathering detailed insights and metrics for vite-plugin-solid-markdown
Gathering detailed insights and metrics for vite-plugin-solid-markdown
npm install vite-plugin-solid-markdown
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (59.99%)
JavaScript (18.68%)
CSS (11.25%)
HTML (5.89%)
MDX (4.2%)
Total Downloads
3,191
Last Day
2
Last Week
33
Last Month
196
Last Year
1,554
MIT License
14 Stars
31 Commits
1 Forks
2 Watchers
6 Branches
1 Contributors
Updated on May 06, 2025
Minified
Minified + Gzipped
Latest Version
0.0.7
Package Id
vite-plugin-solid-markdown@0.0.7
Unpacked Size
32.51 kB
Size
6.68 kB
File Count
19
NPM Version
10.8.2
Node Version
20.19.0
Published on
Apr 30, 2025
Cumulative downloads
Total Downloads
Last Day
-95.3%
2
Compared to previous day
Last Week
-48.4%
33
Compared to previous week
Last Month
192.5%
196
Compared to previous month
Last Year
61.4%
1,554
Compared to previous year
4
1
Compile Markdown to SolidJS component.
Install
1npm i vite-plugin-solid-markdown -D # yarn add vite-plugin-solid-markdown -D
Add it to vite.config.js
⚠️ Note:
md()
should be placed beforesolid()
1// vite.config.js 2import solid from 'solid-start/vite' 3import { defineConfig } from 'vite' 4import md from 'vite-plugin-solid-markdown' 5 6export default defineConfig({ 7 plugins: [ 8 md(), 9 solid({ 10 extensions: ['.mdx', '.md'], 11 }), 12 ], 13})
And import it as a normal Solid component
1 2import ReadMe from '../../README.md' 3 4export default function Home() { 5 return ( 6 <div> 7 <ReadMe /> 8 </div> 9 ) 10} 11
You can even use Solid components inside your markdown, for example
1import Counter from '~/components/Counter' 2 3<Counter />
Frontmatter will be parsed and inject into Solid's instance data frontmatter
field.
For example:
1export const name = 'My Cool App' 2export const title = 'Hello ' + name + '!' 3 4# This is {name}
Will be rendered as
1<h1>This is My Cool App</h1>
It will also be passed to the wrapper component's props if you have set wrapperComponent
option.
1// vite.config.js
2import solidPlugin from 'solid-start/vite'
3import { defineConfig } from 'vite'
4import Markdown from 'vite-plugin-solid-markdown'
5import remarkPrism from 'remark-prism'
6
7export default defineConfig({
8 plugins: [
9 solidPlugin({
10 extensions: ['.mdx', '.md'],
11 }),
12 Markdown({
13 wrapperClasses: 'prose prose-sm m-auto text-left',
14 remarkPlugins: [remarkPrism],
15 // more options will be added in the future
16 }),
17 ],
18})
See the tsdoc for more advanced options.
See Rehype plugins for more rehype plugins.
See Remark plugins for more remark plugins.
See the /example.
Or the pre-configured starter template Vitesse.
1declare module '*.md' { 2 import type { Component } from 'solid-js' 3 const Component: Component 4 export default Component 5}
MIT License © 2020-PRESENT xbmlz
No vulnerabilities found.
No security vulnerabilities found.