-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
47 lines (46 loc) · 1.15 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
/* eslint-disable import/no-unresolved */
/* eslint-disable import/order */
/// <reference types="vitest" />
/// <reference types="vite/client" />
import react from '@vitejs/plugin-react' // react plugin
// import svgr from 'vite-plugin-svgr' // svgr plugin
import tsconfigPaths from 'vite-tsconfig-paths' // tsconfig paths plugin
import { defineConfig } from 'vite' // vitest config
export default defineConfig({
base: '/',
plugins: [react(), tsconfigPaths()],
server: {
port: 3000,
},
preview: {
port: 3000,
},
test: {
globals: true,
environment: 'jsdom',
// setupFiles: './src/testing/setup-tests.ts',
exclude: ['node_modules', '.dist', '.build','**/e2e/**'],
//这是测试覆盖率
coverage: {
include: ['src/**'],
},
},
// 优化依赖
optimizeDeps: {
// include: ['react/jsx-runtime'],
exclude: ['fsevents'], // 排除fsevents
},
// 构建
build: {
// 构建选项
rollupOptions: {
// input: {
// main: './index.html',
// },
external: ['fs/promises'],// 外部依赖
output:{
experimentalMinChunkSize: 1000, // 最小chunk大小
}
},
},
})