-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
66 lines (64 loc) · 2.18 KB
/
Copy pathvite.config.ts
File metadata and controls
66 lines (64 loc) · 2.18 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
import { defineConfig } from 'vite';
import { resolve } from 'path';
const frontendDir = resolve(__dirname, 'src', 'frontend');
const distDir = resolve(__dirname, 'dist', 'src', 'frontend');
export default defineConfig({
root: frontendDir,
base: './',
build: {
outDir: distDir,
emptyOutDir: true,
target: 'es2020',
modulePreload: false,
rollupOptions: {
input: {
main: resolve(frontendDir, 'index.html'),
path: resolve(frontendDir, 'path.html'),
notemd: resolve(frontendDir, 'notemd.html'),
help: resolve(frontendDir, 'help.html'),
manual: resolve(frontendDir, 'manual.html'),
},
output: {
manualChunks(id) {
if (id.includes('node_modules')) return 'vendor';
if (id.includes('/libs/')) return 'vendor-libs';
if (id.includes('path_worker_bridge') || id.includes('workbench_state')) return 'path-workbench';
if (id.includes('path_worker') && !id.includes('bridge')) return 'path-worker';
if (id.includes('path_app')) return 'path-mode';
if (id.includes('workspace_panes') || id.includes('agent_workspace')) return 'agent-workspace';
if (id.includes('graph_state')) return 'graph-state';
if (id.includes('app.js') || id.includes('source_manager')) return 'graph-app';
},
},
},
minify: 'esbuild',
sourcemap: false,
},
resolve: {
alias: {
'@frontend': frontendDir,
'@libs': resolve(frontendDir, 'libs'),
'@locales': resolve(frontendDir, 'locales'),
},
},
worker: {
format: 'es',
},
css: {
devSourcemap: false,
},
server: {
port: 5173,
strictPort: false,
proxy: {
'/api': {
target: 'http://127.0.0.1:3000',
changeOrigin: true,
},
'/ws': {
target: 'ws://127.0.0.1:9876',
ws: true,
},
},
},
});