-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
110 lines (103 loc) · 2.55 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
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/// <reference types="vitest/config" />
import path from 'node:path';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { VitePWA } from 'vite-plugin-pwa';
const ReactCompilerConfig = {};
// https://vitejs.dev/config/
export default defineConfig({
base: '/english_trainer/',
plugins: [
react({
babel: {
plugins: [['babel-plugin-react-compiler', ReactCompilerConfig]],
},
}),
VitePWA({
srcDir: 'src',
filename: 'service-worker.js',
registerType: 'prompt',
injectRegister: false,
pwaAssets: {
disabled: false,
config: true,
},
manifest: {
name: 'English Trainer',
short_name: 'English Trainer',
description: 'Personal English trainer for you',
orientation: 'portrait',
icons: [
{ src: 'images/512.png', type: 'image/png', sizes: '512x512' },
{ src: 'images/512-maskable.png', type: 'image/png', sizes: '512x512', purpose: 'maskable' },
],
display: 'standalone',
id: 'english_trainer',
theme_color: '#ffffff',
background_color: '#ffffff',
},
workbox: {
globPatterns: ['**/*.{js,css,html,svg,png,ico}'],
cleanupOutdatedCaches: true,
clientsClaim: true,
},
devOptions: {
enabled: false,
navigateFallback: 'index.html',
suppressWarnings: true,
type: 'module',
},
}),
],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
},
},
test: {
// globals: true, // Remove `cleanup()` from `setupTests.ts` if `globals: true`
environment: 'happy-dom',
setupFiles: ['./src/setupTests.ts'],
pool: 'threads',
poolOptions: {
threads: {
useAtomics: true,
isolate: true,
},
},
// clearMocks: true,
// restoreMocks: true,
// mockReset: true,
// cache: false,
watch: false,
update: false,
css: false,
coverage: {
clean: true,
include: ['src/**'],
extension: ['.ts', '.tsx'],
exclude: [
'src/test-utils',
'src/**/__mocks__',
'src/**/*.test.tsx',
'src/**/*.test.ts',
'src/App.tsx',
'src/main.tsx',
'src/router.tsx',
],
provider: 'v8',
thresholds: {
statements: 90,
branches: 90,
functions: 90,
lines: 90,
},
watermarks: {
statements: [90, 95],
branches: [90, 95],
functions: [90, 95],
lines: [90, 95],
},
},
},
});