-
-
Notifications
You must be signed in to change notification settings - Fork 46
/
vite.config.ts
57 lines (53 loc) · 1.42 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
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vite'
import Components from 'unplugin-vue-components/vite'
import { presetAttributify, presetUno } from 'unocss'
import Unocss from 'unocss/vite'
export default defineConfig({
logLevel: 'info',
optimizeDeps: {
exclude: [
'@vueuse/core',
'vitepress',
],
},
server: {
hmr: {
overlay: false,
},
},
resolve: {
alias: [
{
find: /^.*\/VPNavBarTitle\.vue$/,
replacement: fileURLToPath(
new URL('./.vitepress/theme/components/vp/NavBarTitle.vue', import.meta.url),
),
},
{
find: /^.*\/VPTeamMembersItem\.vue$/,
replacement: fileURLToPath(
new URL('./.vitepress/theme/components/vp/TeamMembersItem.vue', import.meta.url),
),
},
],
},
plugins: [
// https://github.com/antfu/vite-plugin-components
Components({
dirs: [
'.vitepress/theme/components',
],
// allow auto load markdown components under `./src/components/`
extensions: ['vue', 'md'],
// allow auto import and register components used in markdown
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
// generate `components.d.ts` for ts support with Volar
dts: '.vitepress/components.d.ts',
}),
// https://github.com/unocss/unocss
Unocss({
presets: [presetUno(), presetAttributify()],
}),
],
})