-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
61 lines (51 loc) · 1.32 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
import { defineConfig } from 'vite'
import { VarletImportResolver } from '@varlet/import-resolver'
import { fileURLToPath, URL } from 'node:url'
import vue from '@vitejs/plugin-vue'
import icon from '@varlet/unplugin-icon-builder/vite'
import autoImport from 'unplugin-auto-import/vite'
import components from 'unplugin-vue-components/vite'
import vueRouter from 'unplugin-vue-router/vite'
import unoCSS from 'unocss/vite'
export default defineConfig(() => ({
base: './',
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
plugins: [
vue({
template: {
transformAssetUrls: {
img: ['src'],
video: ['src'],
audio: ['src'],
'var-image': ['src'],
'var-avatar': ['src'],
'var-card': ['src'],
'var-app-bar': ['image'],
},
},
}),
components({
resolvers: [VarletImportResolver()],
}),
autoImport({
imports: ['vue', 'vue-router', 'pinia'],
resolvers: [VarletImportResolver({ autoImport: true })],
eslintrc: { enabled: true },
}),
icon({ dir: 'src/assets/icons', onDemand: true }),
vueRouter(),
unoCSS(),
],
clearScreen: false,
server: {
port: 1420,
strictPort: true,
watch: {
ignored: ['**/src-tauri/**'],
},
},
}))