-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
32 lines (31 loc) · 1.01 KB
/
vite.config.ts
File metadata and controls
32 lines (31 loc) · 1.01 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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { visualizer } from 'rollup-plugin-visualizer';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
// Bundle analyzer - run 'npm run build' to generate stats.html
visualizer({
open: true, // Auto-open report in browser after build
filename: 'dist/stats.html', // Output location
gzipSize: true, // Show gzipped sizes
brotliSize: true, // Show brotli sizes
template: 'treemap', // Visualization type (treemap, sunburst, network)
}),
],
base: '/', // The repository name
build: {
rollupOptions: {
output: {
manualChunks: {
// Split vendor chunks for better caching
'react-vendor': ['react', 'react-dom', 'react-router-dom'],
'motion-vendor': ['framer-motion'],
},
},
},
// Keep default chunk size warning (500KB) — code splitting should keep chunks small
chunkSizeWarningLimit: 500,
},
});