feat(frontend): remove 'v' prefix from footer and add dev mode versioning
This commit is contained in:
@@ -4,7 +4,7 @@ const Footer: React.FC = () => {
|
||||
return (
|
||||
<footer className="py-4 text-center">
|
||||
<p className="text-xs text-slate-500">
|
||||
v{__APP_VERSION__} ({__APP_GITSHA__})
|
||||
{__APP_VERSION__} ({__APP_GITSHA__})
|
||||
</p>
|
||||
</footer>
|
||||
);
|
||||
|
||||
+15
-3
@@ -2,9 +2,21 @@ import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import tailwindcss from '@tailwindcss/vite'
|
||||
import path from 'path'
|
||||
import { execSync } from 'child_process';
|
||||
|
||||
const APP_VERSION = process.env.VITE_APP_VERSION || 'unknown';
|
||||
const APP_GITSHA = process.env.VITE_APP_GITSHA || 'unknown';
|
||||
const isDev = process.env.NODE_ENV === 'development' || process.env.vite === 'true';
|
||||
|
||||
let APP_VERSION = process.env.VITE_APP_VERSION || 'unknown';
|
||||
let APP_GITSHA = process.env.VITE_APP_GITSHA || 'unknown';
|
||||
|
||||
if (isDev) {
|
||||
APP_VERSION = 'DEV';
|
||||
try {
|
||||
APP_GITSHA = execSync('git rev-parse --short HEAD').toString().trim();
|
||||
} catch (e) {
|
||||
APP_GITSHA = 'unknown';
|
||||
}
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
base: './',
|
||||
@@ -26,4 +38,4 @@ export default defineConfig({
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user