mirror of
https://github.com/unjs/unplugin.git
synced 2025-12-08 20:26:33 +00:00
docs: fix twoslash
This commit is contained in:
parent
d01c332cf2
commit
f58a9a23bb
@ -1,13 +1,11 @@
|
||||
import path from 'path'
|
||||
import { transformerTwoslash } from '@shikijs/vitepress-twoslash'
|
||||
import MarkdownItGitHubAlerts from 'markdown-it-github-alerts'
|
||||
|
||||
import { defineConfig } from 'vitepress'
|
||||
import { groupIconMdPlugin } from 'vitepress-plugin-group-icons'
|
||||
import { description, ogImage, title } from './constance'
|
||||
import { description, ogImage, title } from './constant'
|
||||
import { repositoryMeta } from './data/meta'
|
||||
|
||||
import vite from './vite.config'
|
||||
|
||||
// https://vitepress.dev/reference/site-config
|
||||
export default defineConfig({
|
||||
title,
|
||||
@ -77,14 +75,19 @@ export default defineConfig({
|
||||
['meta', { name: 'viewport', content: 'width=device-width, initial-scale=1.0, viewport-fit=cover' }],
|
||||
],
|
||||
markdown: {
|
||||
config: (md: any) => {
|
||||
config: (md) => {
|
||||
md.use(MarkdownItGitHubAlerts)
|
||||
md.use(groupIconMdPlugin)
|
||||
},
|
||||
codeTransformers: [
|
||||
transformerTwoslash(),
|
||||
transformerTwoslash({
|
||||
twoslashOptions: {
|
||||
compilerOptions: { paths: {
|
||||
unplugin: [path.resolve(import.meta.dirname, '../../src/index.ts')],
|
||||
} },
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
ignoreDeadLinks: true,
|
||||
vite: vite as any,
|
||||
})
|
||||
|
||||
@ -3,5 +3,5 @@
|
||||
"compilerOptions": {
|
||||
"lib": ["DOM", "ESNext"]
|
||||
},
|
||||
"include": [".vitepress/**/*", "../src/globals.d.ts"]
|
||||
"include": ["**/*", ".**/*", "../src/globals.d.ts"]
|
||||
}
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import Unocss from 'unocss/vite'
|
||||
import Icons from 'unplugin-icons/vite'
|
||||
import Components from 'unplugin-vue-components/vite'
|
||||
import { defineConfig } from 'vite'
|
||||
import { groupIconVitePlugin, localIconLoader } from 'vitepress-plugin-group-icons'
|
||||
import { MarkdownTransform } from './plugins/markdownTransform'
|
||||
import { MarkdownTransform } from './.vitepress/plugins/markdownTransform'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
@ -15,13 +14,13 @@ export default defineConfig({
|
||||
dts: '.vitepress/components.d.ts',
|
||||
}),
|
||||
// @ts-expect-error mismatch vite version
|
||||
Unocss(fileURLToPath(new URL('./uno.config.ts', import.meta.url))),
|
||||
Unocss(),
|
||||
Icons(),
|
||||
groupIconVitePlugin({
|
||||
customIcon: {
|
||||
farm: localIconLoader(import.meta.url, './assets/farm.svg'),
|
||||
rolldown: localIconLoader(import.meta.url, './assets/rolldown.svg'),
|
||||
rspack: localIconLoader(import.meta.url, './assets/rspack.svg'),
|
||||
farm: localIconLoader(import.meta.url, '.vitepress/assets/farm.svg'),
|
||||
rolldown: localIconLoader(import.meta.url, '.vitepress/assets/rolldown.svg'),
|
||||
rspack: localIconLoader(import.meta.url, '.vitepress/assets/rspack.svg'),
|
||||
},
|
||||
}),
|
||||
],
|
||||
Loading…
x
Reference in New Issue
Block a user