Skip to content

Commit 0f18612

Browse files
authored
refactor: externalize component plugin (#3)
1 parent ed39eb9 commit 0f18612

File tree

5 files changed

+12
-201
lines changed

5 files changed

+12
-201
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
},
4646
"dependencies": {
4747
"@antfu/utils": "^0.5.2",
48+
"@mdit-vue/plugin-component": "^0.1.1",
4849
"@rollup/pluginutils": "^4.2.1",
4950
"@types/markdown-it": "^12.2.3",
5051
"gray-matter": "^4.0.3",

pnpm-lock.yaml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/markdown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import MarkdownIt from 'markdown-it'
22
import matter from 'gray-matter'
33
import { toArray, uniq } from '@antfu/utils'
4+
import { componentPlugin } from '@mdit-vue/plugin-component'
45
import type { ResolvedOptions } from './types'
5-
import { componentPlugin } from './plugins/component'
66

77
const scriptSetupRE = /<\s*script([^>]*)\bsetup\b([^>]*)>([\s\S]*)<\/script>/mg
88
const defineExposeRE = /defineExpose\s*\(/mg

src/plugins/component.ts

Lines changed: 0 additions & 199 deletions
This file was deleted.

test/__snapshots__/transform.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`transform > Vue directives 1`] = `
44
"<template><div class=\\"markdown-body\\">
5-
<button @click=\\"onClick\\"></button>
5+
<p><button @click=\\"onClick\\"></button></p>
66
</div></template>
77
<script setup lang=\\"ts\\">
88
const frontmatter = {\\"name\\":\\"My Cool App\\"}

0 commit comments

Comments
 (0)