Files
cameleer-server/ui/vite.config.ts
hsiegeln 281e168790
Some checks failed
CI / build (push) Failing after 38s
CI / cleanup-branch (push) Has been skipped
CI / docker (push) Has been skipped
CI / deploy (push) Has been skipped
CI / deploy-feature (push) Has been skipped
fix: pass commit short hash as version to UI sidebar
Add VITE_APP_VERSION build arg to UI Dockerfile, pass short SHA from
CI docker build step. vite.config.ts truncates to 7 chars so both
CI build and Docker build produce consistent short hashes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 22:37:46 +02:00

35 lines
857 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',
},
});