-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
58 lines (57 loc) · 1.69 KB
/
vite.config.ts
File metadata and controls
58 lines (57 loc) · 1.69 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';
import tailwindcss from '@tailwindcss/vite';
import tsconfigPaths from 'vite-tsconfig-paths';
import { fileURLToPath } from 'url';
// https://vite.dev/config/
export default defineConfig({
plugins: [react(), tailwindcss(), tsconfigPaths()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
optimizeDeps: {
exclude: ['@aintandem/sdk-core', '@aintandem/sdk-react']
},
build: {
rollupOptions: {
external: [],
output: {
// Safer chunk splitting - only split very large non-React dependencies
// Use a function-based approach for better granularity
manualChunks: (id) => {
// Split out the SDK (external dependency)
if (id.includes('node_modules/@aintandem/sdk')) {
return 'sdk';
}
// Split out lucide-react (large icon library, safe to split)
if (id.includes('node_modules/lucide-react')) {
return 'icons';
}
// Everything else goes into vendor chunks - let Vite handle the rest
// This avoids circular dependency issues between React ecosystem packages
}
}
}
},
server: {
host: '0.0.0.0',
proxy: {
'/api': {
target: 'http://flexy-orchestrator-3ef9a44e:9902',
changeOrigin: true
},
'/flexy': {
target: 'http://flexy-orchestrator-3ef9a44e:9902',
changeOrigin: true,
ws: true // Enable WebSocket proxying
},
'/code-server': {
target: 'http://flexy-orchestrator-3ef9a44e:9902',
changeOrigin: true,
ws: true
}
}
}
});