Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/liuyunhe/vite-plugin-mdx


https://github.com/liuyunhe/vite-plugin-mdx

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# Vite Plugin MDX

## Getting Started

1. Install:
```
npm install @shepardliu/vite-plugin-mdx -D
```
or
```
yarn add @shepardliu/vite-plugin-mdx -D
```

2. Add the plugin to your `vite.config.js`.

```js
// vite.config.js

import mdx from '@shepardliu/vite-plugin-mdx'

const options = {
framework: 'react' // react or vue3
}

export default {
plugins: [mdx(options)]
}
```

3. You can now write `.mdx` files.

```mdx-js
// hello.mdx

# Hello MDX & Vite

This is a plugin of MDX for vite
```

```javascript
// App.jsx

import React from 'react'

import Hello from './hello.mdx'

function App() {
return (




)
}

export default App

```