Files
rondevu-demo/vite.config.js
Bas van den Aakster 4f136eb3cb Add version display in footer
- Add version state tracking for demo and server versions
- Create loadVersions() function to fetch server version via API
- Update footer to display both demo version and server version
- Update vite.config.js to inject git commit hash as VITE_VERSION

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 11:35:05 +01:00

27 lines
578 B
JavaScript

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { execSync } from 'child_process';
// Get git commit hash
let version = 'unknown';
try {
version = execSync('git rev-parse --short HEAD', { encoding: 'utf8' }).trim();
} catch (err) {
console.warn('Could not get git commit hash, using "unknown"');
}
export default defineConfig({
plugins: [react()],
server: {
port: 5173,
open: true
},
build: {
outDir: 'dist',
sourcemap: true
},
define: {
'import.meta.env.VITE_VERSION': JSON.stringify(version)
}
});