-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
49 lines (45 loc) · 1.08 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
import { resolve } from 'node:path'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import unoCSS from 'unocss/vite'
import { FileSystemIconLoader as iconLoader } from 'unplugin-icons/loaders'
import iconsResolver from 'unplugin-icons/resolver'
import icons from 'unplugin-icons/vite'
import components from 'unplugin-vue-components/vite'
import { defineConfig } from 'vite'
const pathResolve = (dir: string) => {
return resolve(process.cwd(), '.', dir)
}
const config = defineConfig({
resolve: {
alias: {
'@': pathResolve('src')
}
},
plugins: [
vue(),
vueJsx(),
unoCSS(),
icons({
autoInstall: false,
scale: 1,
compiler: 'vue3',
defaultClass: '',
defaultStyle: '',
customCollections: {
vi: iconLoader(pathResolve('src/icons'))
}
}),
components({
dirs: ['src/components'],
dts: 'src/types/components.d.ts',
resolvers: [
iconsResolver({
prefix: false,
customCollections: ['vi']
})
]
})
]
})
export default config