-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.base.config.ts
46 lines (45 loc) · 1.17 KB
/
vite.base.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
import path, { resolve } from 'node:path'
import Vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite'
import AutoImport from 'unplugin-auto-import/vite'
import VueRouter from 'unplugin-vue-router/vite'
import { VueRouterAutoImports } from 'unplugin-vue-router'
export default {
resolve: {
alias: {
'~/': `${resolve(__dirname)}/src/`,
'@/': `${path.resolve(__dirname, 'src')}/`,
},
},
build: {
chunkSizeWarningLimit: 5000,
},
plugins: [
Vue(),
// ResolvedOptions: https://github.com/posva/unplugin-vue-router/blob/main/playground/vite.config.ts
VueRouter({
dts: 'src/typings/typed-router.d.ts',
}),
// https://github.com/antfu/unplugin-auto-import
AutoImport({
imports: [
'vue',
'@vueuse/core',
VueRouterAutoImports,
{
// add any other imports you were relying on
'vue-router/auto': ['useLink'],
},
],
dts: 'src/typings/auto-imports.d.ts',
dirs: [
'./src/composables',
],
vueTemplate: true,
}),
Components({
// 指定组件位置
dts: 'src/typings/components.d.ts',
}),
],
}