generated from varletjs/varlet-app-template
-
Notifications
You must be signed in to change notification settings - Fork 4
/
vite.config.ts
87 lines (73 loc) · 1.76 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import vue from '@vitejs/plugin-vue'
import jsx from '@vitejs/plugin-vue-jsx'
import autoImport from 'unplugin-auto-import/vite'
import components from 'unplugin-vue-components/vite'
import compression from 'vite-plugin-compression2'
import progress from 'vite-plugin-progress'
import unoCSS from 'unocss/vite'
import { fileURLToPath, URL } from 'node:url'
import { VarletImportResolver } from '@varlet/import-resolver'
import { defineConfig } from 'vitest/config'
// Use as needed
// import eruda from 'vite-plugin-eruda'
// import { analyzer } from 'vite-bundle-analyzer'
export default defineConfig({
base: './',
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
server: {
host: '0.0.0.0',
port: 10086
},
build: {
target: ['ios12']
},
test: {
environment: 'jsdom',
coverage: {
provider: 'istanbul'
},
setupFiles: ['tests/setup.ts'],
include: ['tests/**/*.spec.ts'],
server: {
deps: {
inline: ['@varlet/ui']
}
}
},
plugins: [
vue({
template: {
transformAssetUrls: {
img: ['src'],
video: ['src'],
audio: ['src'],
'var-image': ['src'],
'var-avatar': ['src'],
'var-card': ['src'],
'var-app-bar': ['image']
}
}
}),
jsx(),
components({
resolvers: [VarletImportResolver()]
}),
autoImport({
imports: ['vue', 'vue-router', 'pinia', 'vue-i18n'],
resolvers: [VarletImportResolver({ autoImport: true })],
eslintrc: { enabled: true }
}),
compression({
include: [/\.html$/, /\.css$/, /\.js$/, /\.ttf$/],
skipIfLargerOrEqual: true
}),
progress(),
unoCSS()
// analyzer()
// eruda()
]
})