-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
executable file
·78 lines (70 loc) · 2.39 KB
/
Copy pathvite.config.ts
File metadata and controls
executable file
·78 lines (70 loc) · 2.39 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import path from "path";
import { componentTagger } from "lovable-tagger";
import { sentryVitePlugin } from "@sentry/vite-plugin";
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => ({
server: {
host: "::",
port: 8080,
allowedHosts: [".agentico.dev", ".lovable.app", ".lovableproject.com"],
},
base: "/",
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
build: {
sourcemap: true, // Source map generation must be turned on
rollupOptions: {
output: {
manualChunks: (id) => {
// React and core dependencies - ensure React always stays together
if (id.includes('node_modules/react') ||
id.includes('node_modules/react-dom') ||
id.includes('node_modules/scheduler') ||
id.includes('node_modules/use-sync-external-store') ||
id.includes('node_modules/@tanstack/react-query')) {
return 'react-vendor';
}
// Router-related
if (id.includes('node_modules/react-router') ||
id.includes('node_modules/@remix-run')) {
return 'router';
}
// UI components from Radix
if (id.includes('node_modules/@radix-ui')) {
return 'ui-components';
}
// Form handling libraries
if (id.includes('node_modules/react-hook-form') ||
id.includes('node_modules/@hookform') ||
id.includes('node_modules/zod')) {
return 'form-components';
}
// Data management libraries
if (id.includes('node_modules/@tanstack/react-query')) {
return 'react-query';
}
// Supabase
if (id.includes('node_modules/@supabase/supabase-js')) {
return 'supabase';
}
// Charting libraries
if (id.includes('node_modules/recharts')) {
return 'charts';
}
// Utils and other libraries
if (id.includes('node_modules/date-fns') ||
id.includes('node_modules/clsx') ||
id.includes('node_modules/tailwind-merge')) {
return 'utils';
}
}
}
},
chunkSizeWarningLimit: 1000,
},
}));