-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
47 lines (45 loc) · 1.52 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
/*
* @Author: JocelynGu6799 [email protected]
* @Date: 2024-03-22 15:21:08
* @LastEditors: gjy1025 [email protected]
* @LastEditTime: 2024-03-24 18:11:21
* @FilePath: \AIGC-vue3-ts\vite.config.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite'
import AutoImport from 'unplugin-auto-import/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
// https://vitejs.dev/config/
import { VantResolver } from '@vant/auto-import-resolver';
export default defineConfig({
plugins: [
vue(),
AutoImport({
imports: ['vue','vue-router'],
// resolvers: [ElementPlusResolver(),VantResolver()]
resolvers: [ElementPlusResolver()]
}),
Components({
// 指定组件位置,默认是src/components
dirs: ['src'],
// 组件的有效文件扩展名。
extensions: ["vue"],
// 搜索子目录
deep: true,
// ui库解析器,也可以自定义
// resolvers: [VantResolver()],
// 配置文件生成位置
dts: 'src/components.d.ts',
// resolvers: [ElementPlusResolver(),VantResolver()],
resolvers: [ElementPlusResolver()],
})
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
})