-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
59 lines (57 loc) · 1.49 KB
/
Copy pathvite.config.ts
File metadata and controls
59 lines (57 loc) · 1.49 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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tailwindcss from '@tailwindcss/vite';
import path from 'path';
const backendPort = process.env.PORT || 7777;
export default defineConfig({
plugins: [react(), tailwindcss()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
port: 5173,
proxy: {
'/api': `http://localhost:${backendPort}`,
'/ws': {
target: `ws://localhost:${backendPort}`,
ws: true,
},
},
watch: {
// Ignore git worktrees so agent file changes don't trigger HMR/reloads
ignored: ['**/.worktrees/**'],
},
},
build: {
outDir: 'dist',
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules/react-dom/') || id.includes('node_modules/react/')) {
return 'vendor-react';
}
if (
id.includes('node_modules/react-router/') ||
id.includes('node_modules/react-router-dom/')
) {
return 'vendor-router';
}
if (id.includes('node_modules/@xterm/')) {
return 'vendor-xterm';
}
if (id.includes('node_modules/@base-ui/')) {
return 'vendor-ui';
}
if (
id.includes('node_modules/monaco-editor/') ||
id.includes('node_modules/@monaco-editor/')
) {
return 'vendor-monaco';
}
},
},
},
},
});