Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be with ESM and Vite 5+ #462

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ npm i -D vite-plugin-markdown@vite-1
### Config

```js
const mdPlugin = require('vite-plugin-markdown')
import mdPlugin from 'vite-plugin-markdown'

module.exports = {
plugins: [mdPlugin(options)]
Expand Down
57 changes: 27 additions & 30 deletions examples/react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "vite-plugin-markdown-sample-react",
"private": true,
"type": "module",
"version": "0.0.0",
"scripts": {
"dev": "vite",
Expand Down
12 changes: 6 additions & 6 deletions examples/react/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// @ts-check
const reactRefresh = require('@vitejs/plugin-react-refresh')
const { plugin: mdPlugin, Mode } = require('vite-plugin-markdown')
import { defineConfig } from 'vite'
import reactRefresh from '@vitejs/plugin-react-refresh'
import mdPlugin, { Mode } from 'vite-plugin-markdown'

/**
* @type { import('vite').UserConfig }
*/
const config = {
plugins: [reactRefresh, mdPlugin({ mode: [Mode.HTML, Mode.MARKDOWN, Mode.TOC, Mode.REACT] })]
}
export default defineConfig({
plugins: [reactRefresh, mdPlugin({ mode: [Mode.HTML, Mode.MARKDOWN, Mode.TOC, Mode.REACT] })],
})

module.exports = config
71 changes: 33 additions & 38 deletions examples/vue/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "vite-plugin-markdown-sample-vue",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build"
Expand Down
7 changes: 3 additions & 4 deletions examples/vue/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import VuePlugin from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'
import plugin, { Mode } from 'vite-plugin-markdown'

/**
* @type { import('vite').UserConfig }
*/
const config = {
export default defineConfig({
plugins: [VuePlugin(), plugin({ mode: [Mode.HTML, Mode.TOC, Mode.VUE] })],
}

module.exports = config
})
Loading
Loading