3.2.3 • Published 4 years ago

vite-plugin-react-mdrender v3.2.3

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

使用文档

安装

yarn add vite-plugin-react-mdrender

使用

vite-config.ts中引入

const mdRender from 'vite-plugin-react-mdrender'

{
  plugins: [ mdRender() ]
}

在 vite global.d.ts 文件加入

declare module '*.md';

markdown 书写要求

  • 常规 markdown 语法
  • 代码片段(jsx/tsx)

markdown 文件(demo.md)

## 这是一个 title

<demo src="./demo.jsx" />
import React from 'react';

const Demo = () => {
  return <div>这是一个demo</div>;
};
export default Demo;

加载 markdown 文件

import Md from 'demo.md';

const App = () => {
  return <Md />;
};
3.2.2

4 years ago

3.2.1

4 years ago

3.2.3

4 years ago

3.2.0

4 years ago

3.1.0

4 years ago

3.0.0

4 years ago

1.9.0

4 years ago

1.8.1

4 years ago

1.7.1

4 years ago

1.6.1

4 years ago

1.5.1

4 years ago

1.4.1

4 years ago

2.0.0

4 years ago

1.3.1

4 years ago

1.2.1

4 years ago

1.1.1

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago