mirror of
https://github.com/xtr-dev/rondevu-demo.git
synced 2025-12-08 00:33:25 +00:00
- 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>
27 lines
578 B
JavaScript
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)
|
|
}
|
|
});
|