-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvitest.config.ts
46 lines (45 loc) · 1.28 KB
/
vitest.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 VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
import vue from '@vitejs/plugin-vue'
import { dirname, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import AutoImport from 'unplugin-auto-import/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import Components from 'unplugin-vue-components/vite'
import { configDefaults, defineConfig } from 'vitest/config'
export default defineConfig({
plugins: [
vue(),
AutoImport({
eslintrc: {
enabled: true,
filepath: 'types/.eslintrc-auto-import.json',
},
resolvers: [ElementPlusResolver()],
dts: 'types/auto-imports.d.ts',
}),
Components({
resolvers: [ElementPlusResolver()],
dts: 'types/components.d.ts',
}),
VueI18nPlugin({
/* options */
// locale messages resource pre-compile option
include: resolve(dirname(fileURLToPath(import.meta.url)), './src/locales/**'),
}),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
test: {
environment: 'jsdom',
exclude: [...configDefaults.exclude, 'e2e/*'],
root: fileURLToPath(new URL('./', import.meta.url)),
server: {
deps: {
inline: ['element-plus'],
},
},
},
})