forked from stratum-mining/sv2-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
44 lines (43 loc) · 1.2 KB
/
Copy pathvite.config.ts
File metadata and controls
44 lines (43 loc) · 1.2 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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
// In development, proxy API requests to the monitoring servers
// This avoids CORS issues when fetching from different origins
server: {
proxy: {
// Proxy requests to JDC (port 9091)
'/jdc-api': {
target: 'http://localhost:9091',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/jdc-api/, '/api'),
},
// Proxy requests to Translator (port 9092)
'/translator-api': {
target: 'http://localhost:9092',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/translator-api/, '/api'),
},
// Keep metrics proxy for direct access
'/metrics': {
target: 'http://localhost:9092',
changeOrigin: true,
},
},
},
build: {
// Output to dist/ which will be embedded in the Rust binary
outDir: 'dist',
// Generate source maps for debugging
sourcemap: true,
// Ensure clean builds
emptyOutDir: true,
},
});