-
Notifications
You must be signed in to change notification settings - Fork 148
Expand file tree
/
Copy pathvite.config.ts
More file actions
41 lines (40 loc) · 1.31 KB
/
Copy pathvite.config.ts
File metadata and controls
41 lines (40 loc) · 1.31 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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import legacy from '@vitejs/plugin-legacy';
export default defineConfig({
base: './',
plugins: [
react(),
legacy({
targets: ['defaults', 'not IE 11', 'Chrome >= 60', 'Firefox >= 60', 'Safari >= 12', 'Edge >= 79'],
additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
modernPolyfills: true,
}),
],
optimizeDeps: {
exclude: ['lucide-react'],
},
build: {
// The app intentionally ships as a single-screen SPA with legacy browser support.
// Keep the warning threshold aligned with the current split chunks so Vite still
// reports genuinely outsized future bundles without flagging the expected entry.
chunkSizeWarningLimit: 2500,
rolldownOptions: {
checks: {
// The legacy plugin dominates production build time by design; this diagnostic
// is useful when profiling, but too noisy for normal release builds.
pluginTimings: false,
},
output: {
manualChunks(id) {
if (id.includes('node_modules/react-dom') || id.includes('node_modules/react/')) {
return 'react-vendor';
}
if (id.includes('node_modules/lucide-react')) {
return 'ui-vendor';
}
},
},
},
},
});