chore: change

This commit is contained in:
2023-03-28 08:25:18 +08:00
parent 163e29dfd1
commit f394f48853
9 changed files with 184 additions and 205 deletions

View File

@ -1,11 +1,33 @@
import { fileURLToPath } from 'url'
import { resolve } from 'path'
import { defineConfig } from 'vitepress'
import vueJsxPlugin from '@vitejs/plugin-vue-jsx'
import { VitePluginVitepressDemo } from 'vite-plugin-vitepress-demo'
import { getNav } from './config/nav'
import { getSidebar } from './config/sidebar'
import { getRewrites } from './config/rewrites'
const baseSrc = fileURLToPath(new URL('./', import.meta.url))
export default defineConfig({
title: 'vue3组件库站点',
rewrites: getRewrites(),
srcExclude: ['**/node_modules/**', '**/demos/**', '**/tests/**', '**/README.md'],
mpa: true,
themeConfig: {
nav: getNav(),
sidebar: getSidebar()
},
vite: {
plugins: [
vueJsxPlugin(),
VitePluginVitepressDemo({
glob: ['**/demos/**/*.vue']
})
],
resolve: {
alias: {
'antd-tiny-vue': resolve(baseSrc, '../../components')
}
}
}
})

View File

@ -0,0 +1,5 @@
export const getRewrites = (): Record<string, string> => {
return {
// '/site/index.md': '/index.md'
}
}

View File

@ -2,7 +2,8 @@ import type { Theme } from 'vitepress'
// eslint-disable-next-line import/no-named-as-default
import DefaultTheme from 'vitepress/theme'
import { AntdTheme } from 'vite-plugin-vitepress-demo/theme'
import Antd from '../../../components'
// @ts-expect-error this is a local module
import Antd from 'antd-tiny-vue'
export default {
...DefaultTheme,