forked from huhusmang/Subscription-Management
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
49 lines (48 loc) · 1.42 KB
/
vite.config.ts
File metadata and controls
49 lines (48 loc) · 1.42 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
import path from "path"
import react from "@vitejs/plugin-react"
import { defineConfig } from "vite"
// https://vite.dev/config/
export default defineConfig(() => {
return {
plugins: [react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
server: {
proxy: {
'/api': {
target: 'http://localhost:3001',
changeOrigin: true,
},
},
},
build: {
// Use esbuild for faster builds and better CSP compatibility
minify: 'esbuild' as const,
// Ensure proper chunking for production
rollupOptions: {
output: {
manualChunks: {
// Vendor libraries
'vendor-react': ['react', 'react-dom'],
'vendor-ui': ['@radix-ui/react-dialog', '@radix-ui/react-dropdown-menu', '@radix-ui/react-select', '@radix-ui/react-tabs'],
'vendor-charts': ['recharts'],
'vendor-utils': ['zustand', 'date-fns', 'lucide-react'],
// App chunks
'charts': [
'./src/components/charts/CategoryPieChart.tsx',
'./src/components/charts/ExpenseTrendChart.tsx',
'./src/components/charts/YearlyTrendChart.tsx'
]
},
},
},
// Increase chunk size warning limit since we're optimizing
chunkSizeWarningLimit: 1000,
},
// Configure for production deployment
base: '/',
}
})