forked from Jackiexiao/nolebase-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
62 lines (59 loc) · 1.75 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { defineConfig } from 'vite'
import Components from 'unplugin-vue-components/vite'
import UnoCSS from 'unocss/vite'
import Inspect from 'vite-plugin-inspect'
import { GitChangelog, GitChangelogMarkdownSection } from '@nolebase/vitepress-plugin-git-changelog/vite'
import { PageProperties, PagePropertiesMarkdownSection } from '@nolebase/vitepress-plugin-page-properties/vite'
import { ThumbnailHashImages } from '@nolebase/vitepress-plugin-thumbnail-hash/vite'
import { githubRepoLink } from './metadata'
export default defineConfig(async () => {
return {
assetsInclude: ['**/*.mov'],
optimizeDeps: {
// vitepress is aliased with replacement `join(DIST_CLIENT_PATH, '/index')`
// This needs to be excluded from optimization
exclude: [
'vitepress',
],
},
plugins: [
Inspect(),
GitChangelog({
repoURL: () => githubRepoLink,
}),
GitChangelogMarkdownSection({
getChangelogTitle: (): string => {
return '文件历史'
},
getContributorsTitle: (): string => {
return '贡献者'
},
excludes: [
'toc.md',
'index.md',
],
}),
PageProperties(),
PagePropertiesMarkdownSection({
excludes: [
'toc.md',
'index.md',
],
}),
ThumbnailHashImages(),
Components({
include: [/\.vue$/, /\.md$/],
dirs: '.vitepress/theme/components',
dts: '.vitepress/components.d.ts',
}),
UnoCSS(),
],
ssr: {
noExternal: [
'@nolebase/vitepress-plugin-enhanced-readabilities',
'@nolebase/vitepress-plugin-highlight-targeted-heading',
'@nolebase/vitepress-plugin-inline-link-preview',
],
},
}
})