-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
81 lines (74 loc) · 1.8 KB
/
Copy pathvite.config.ts
File metadata and controls
81 lines (74 loc) · 1.8 KB
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
/// <reference types="vitest" />
import path from 'path'
import { defineConfig } from 'vite'
import Vue from '@vitejs/plugin-vue'
import Pages from 'vite-plugin-pages'
import Components from 'unplugin-vue-components/vite'
import AutoImport from 'unplugin-auto-import/vite'
import { VantResolver } from 'unplugin-vue-components/resolvers'
export default defineConfig({
resolve: {
alias: {
'~/': `${path.resolve(__dirname, 'src')}/`,
},
conditions: process.env.VITEST ? ['node'] : [],
},
plugins: [
Vue(),
Pages({
dirs: 'src/views',
exclude: ['**/components/*.vue'],
onRoutesGenerated(routes) {
routes.push({ path: '/address', redirect: '/address/shipAddress' })
},
}),
AutoImport({
imports: [
'vue',
'vue-router',
'pinia',
{
'vue-router': ['createRouter', 'createWebHistory'],
'axios': [
['default', 'axios'],
],
'@testing-library/vue': [
'fireEvent',
'render',
'waitFor',
'screen',
],
'@pinia/testing': ['createTestingPinia'],
'vant': ['Toast', 'Dialog'],
},
],
dirs: [
'./src/network/**',
'./src/stores/**',
'./src/utils/**',
],
vueTemplate: true,
}),
Components({
resolvers: [VantResolver()],
dirs: ['src/components', 'src/views'],
include: [/\.vue$/, /\.vue\?vue/],
}),
],
test: {
globals: true,
environment: 'jsdom',
deps: {
inline: ['vant'],
},
setupFiles: path.resolve(__dirname, 'test/vitest-setup'),
coverage: {
include: ['src/**/*'],
exclude: ['src/network/**'],
lines: 80,
functions: 80,
branches: 80,
statements: 80,
},
},
})