-
Notifications
You must be signed in to change notification settings - Fork 391
Expand file tree
/
Copy pathvite.config.ts
More file actions
64 lines (55 loc) · 1.69 KB
/
vite.config.ts
File metadata and controls
64 lines (55 loc) · 1.69 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
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
plugins: [react()],
base: env.VITE_BASE_PATH || '/',
server: {
port: 3000,
open: false,
},
preview: {
port: 4173,
},
build: {
chunkSizeWarningLimit: 700,
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules/recharts')) {
return 'charts-vendor';
}
if (id.includes('node_modules/@react-google-maps/api')) {
return 'maps-vendor';
}
if (id.includes('node_modules/react-bootstrap-icons')) {
return 'icons-vendor';
}
if (id.includes('node_modules/react-toastify')) {
return 'toast-vendor';
}
if (id.includes('node_modules/reactstrap') || id.includes('node_modules/@popperjs/core')) {
return 'ui-vendor';
}
if (id.includes('node_modules/@reduxjs/toolkit') || id.includes('node_modules/react-redux')) {
return 'state-vendor';
}
if (id.includes('node_modules/react-router') || id.includes('node_modules/react-router-dom')) {
return 'router-vendor';
}
if (id.includes('node_modules/react') || id.includes('node_modules/react-dom')) {
return 'react-vendor';
}
},
},
},
},
test: {
environment: 'jsdom',
setupFiles: './src/test/setup.ts',
css: true,
globals: true,
},
};
});