This repository has been archived by the owner on Jan 5, 2024. It is now read-only.
generated from logue/vite-vue2-ts-starter
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathvitest.config.ts
61 lines (58 loc) · 1.65 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { fileURLToPath, URL } from 'node:url';
import vue from '@vitejs/plugin-vue2';
import { configDefaults, defineConfig } from 'vitest/config';
import { VuetifyResolver } from 'unplugin-vue-components/resolvers';
import Components from 'unplugin-vue-components/vite';
/**
* Vitest Configure
*
* @see {@link https://vitest.dev/config/}
*/
export default defineConfig({
// plugins
plugins: [
// Vue2
// https://github.com/vitejs/vite-plugin-vue2
vue(),
// unplugin-vue-components
// https://github.com/antfu/unplugin-vue-components
Components({
// generate `components.d.ts` global declarations
// https://github.com/antfu/unplugin-vue-components#typescript
dts: true,
// auto import for directives
directives: false,
// resolvers for custom components
resolvers: [
// Vuetify
VuetifyResolver(),
],
// https://github.com/antfu/unplugin-vue-components#types-for-global-registered-components
types: [
{
from: 'vue-router',
names: ['RouterLink', 'RouterView'],
},
],
}),
],
// Resolver
resolve: {
// https://vitejs.dev/config/shared-options.html#resolve-alias
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'~': fileURLToPath(new URL('./node_modules', import.meta.url)),
},
},
test: {
// https://vitest.dev/guide/#configuring-vitest
environment: 'jsdom',
globals: true,
exclude: [...configDefaults.exclude, 'e2e/*'],
root: fileURLToPath(new URL('./', import.meta.url)),
silent: true,
// deps: {
// inline: [/vuetify/],
// },
},
} as any);