mirror of
https://github.com/xtr-dev/rondevu-demo.git
synced 2025-12-10 02:43:23 +00:00
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>
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
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()],
|
||||
@@ -10,5 +19,8 @@ export default defineConfig({
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
sourcemap: true
|
||||
},
|
||||
define: {
|
||||
'import.meta.env.VITE_VERSION': JSON.stringify(version)
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user