Change vite base from './' to '/' so asset paths are absolute. With
relative paths, direct navigation to multi-segment URLs like
/runtime/app/instance resolved assets to /runtime/assets/ which 404'd.
Also fix sidebar navigation: clicking a route while on the runtime tab
no longer navigates to /runtime/{appId}/{routeId} (which the runtime
page interprets as an instanceId). It stays at /runtime/{appId}.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
35 lines
856 B
TypeScript
35 lines
856 B
TypeScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
|
|
// Use VITE_API_TARGET to proxy to a remote server, e.g.:
|
|
// VITE_API_TARGET=https://api.cameleer.siegeln.net npm run dev
|
|
const apiTarget = process.env.VITE_API_TARGET || 'http://localhost:8081';
|
|
|
|
export default defineConfig({
|
|
define: {
|
|
__APP_VERSION__: JSON.stringify((process.env.VITE_APP_VERSION || 'dev').slice(0, 7)),
|
|
},
|
|
plugins: [react()],
|
|
server: {
|
|
proxy: {
|
|
'/api/': {
|
|
target: apiTarget,
|
|
changeOrigin: true,
|
|
secure: false,
|
|
configure: (proxy) => {
|
|
proxy.on('proxyReq', (proxyReq) => {
|
|
proxyReq.removeHeader('origin');
|
|
});
|
|
},
|
|
},
|
|
},
|
|
},
|
|
optimizeDeps: {
|
|
include: ['swagger-ui-dist/swagger-ui-bundle'],
|
|
},
|
|
base: '/',
|
|
build: {
|
|
outDir: 'dist',
|
|
},
|
|
});
|