-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
58 lines (57 loc) · 1.53 KB
/
vite.config.js
File metadata and controls
58 lines (57 loc) · 1.53 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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
esbuild: {
loader: 'jsx',
include: /src\/.*\.[jt]sx?$/,
exclude: []
},
optimizeDeps: {
esbuildOptions: {
loader: {
'.js': 'jsx',
},
},
},
build: {
rollupOptions: {
output: {
manualChunks(id) {
// Vendor chunks
if (id.includes('node_modules')) {
// React ecosystem
if (id.includes('react') || id.includes('react-dom') || id.includes('react-router')) {
return 'react-vendor';
}
// UI libraries
if (id.includes('@mui') || id.includes('@emotion')) {
return 'mui-vendor';
}
// Icons
if (id.includes('react-icons')) {
return 'icons-vendor';
}
// Analytics
if (id.includes('@vercel') || id.includes('react-ga4')) {
return 'analytics-vendor';
}
// Other large libraries
if (id.includes('axios') || id.includes('firebase')) {
return 'utility-vendor';
}
if (id.includes('tinymce')) {
return 'editor-vendor';
}
// Everything else goes to vendor
return 'vendor';
}
}
}
},
chunkSizeWarningLimit: 1000, // Increase limit to 1000kB
target: 'esnext',
minify: 'esbuild'
}
})