-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.shared.ts
75 lines (73 loc) · 1.75 KB
/
vite.shared.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
import react from '@vitejs/plugin-react-swc';
import checker from 'vite-plugin-checker';
import { UserConfig } from 'vite';
import fullReload from 'vite-plugin-full-reload';
import tsconfigPaths from 'vite-tsconfig-paths';
const config: UserConfig = {
resolve: {
extensions: ['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json', '.d.ts']
},
// clear screen is needed for styles to be reloaded properly
clearScreen: true,
base: './',
esbuild: {
jsxFactory: 'h',
jsxFragment: 'Fragment',
jsxInject: `import React from 'react'`
},
define: {
global: {}
},
plugins: [
tsconfigPaths(),
react({}),
checker({
eslint: {
lintCommand: 'eslint "./src/**/*.{ts,tsx}"'
},
typescript: true
}),
fullReload('./**/*', {
root: __dirname,
delay: 0,
always: true
})
],
server: {
host: true,
hmr: {
overlay: false
},
port: 3000,
strictPort: true,
open: true
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: "src/setupTests.ts",
mockReset: true,
passWithNoTests: true,
watch: false,
coverage: {
reporter: [
[
'json',
{
file: 'coverage.json'
}
],
['html']
],
reportsDirectory: 'coverage',
provider: 'v8',
enabled: true,
clean: true,
cleanOnRerun: true
}
},
build: {
outDir: 'build'
}
};
export default config;