| 1 | import type { ArgumentsType } from '@antfu/utils' |
| 2 | import type Vue from '@vitejs/plugin-vue' |
| 3 | import type VueJsx from '@vitejs/plugin-vue-jsx' |
| 4 | import type { VitePluginConfig as UnoCSSConfig } from 'unocss/vite' |
| 5 | import type Icons from 'unplugin-icons/vite' |
| 6 | import type Components from 'unplugin-vue-components/vite' |
| 7 | import type Markdown from 'unplugin-vue-markdown/vite' |
| 8 | import type { ViteInspectOptions } from 'vite-plugin-inspect' |
| 9 | import type RemoteAssets from 'vite-plugin-remote-assets' |
| 10 | import type { ViteStaticCopyOptions } from 'vite-plugin-static-copy' |
| 11 | import type ServerRef from 'vite-plugin-vue-server-ref' |
| 12 | |
| 13 | export interface SlidevPluginOptions { |
| 14 | vue?: ArgumentsType<typeof Vue>[0] |
| 15 | vuejsx?: ArgumentsType<typeof VueJsx>[0] |
| 16 | markdown?: ArgumentsType<typeof Markdown>[0] |
| 17 | components?: ArgumentsType<typeof Components>[0] |
| 18 | icons?: ArgumentsType<typeof Icons>[0] |
| 19 | remoteAssets?: ArgumentsType<typeof RemoteAssets>[0] |
| 20 | serverRef?: ArgumentsType<typeof ServerRef>[0] |
| 21 | unocss?: UnoCSSConfig |
| 22 | staticCopy?: ViteStaticCopyOptions |
| 23 | inspect?: ViteInspectOptions |
| 24 | } |
| 25 | |
| 26 | // extend vite.config.ts |
| 27 | declare module 'vite' { |
| 28 | interface UserConfig { |
| 29 | /** |
| 30 | * Custom internal plugin options for Slidev (advanced) |
| 31 | * |
| 32 | * See https://github.com/slidevjs/slidev/blob/main/packages/slidev/node/options.ts#L50 |
| 33 | */ |
| 34 | slidev?: SlidevPluginOptions |
| 35 | } |
| 36 | } |
| 37 |