diff --git a/src/pages/AboutSettings.tsx b/src/pages/AboutSettings.tsx
index 8e5e86dd..7f6292ba 100644
--- a/src/pages/AboutSettings.tsx
+++ b/src/pages/AboutSettings.tsx
@@ -128,6 +128,12 @@ export function AboutSettings() {
+
+ {import.meta.env.VERSION && (
+
+ v{import.meta.env.VERSION}
+
+ )}
);
diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx
index 6d421de8..4d5787ef 100644
--- a/src/pages/Settings.tsx
+++ b/src/pages/Settings.tsx
@@ -37,6 +37,11 @@ export function Settings() {
);
})}
+ {import.meta.env.VERSION && (
+
+ v{import.meta.env.VERSION}
+
+ )}
);
}
diff --git a/vite.config.ts b/vite.config.ts
index b8a44cc8..9e54af58 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,14 +1,28 @@
+import { execSync } from "node:child_process";
import path from "node:path";
import react from "@vitejs/plugin-react-swc";
import { defineConfig } from "vitest/config";
+function getVersion(): string {
+ try {
+ const gitCommit = execSync('git rev-parse --short HEAD').toString().trim();
+ const commitDate = execSync('git log -1 --format=%cd --date=format:%Y.%m.%d').toString().trim();
+ return `${commitDate}+${gitCommit}`;
+ } catch {
+ return new Date().toISOString().split('T')[0].replace(/-/g, '.');
+ }
+}
+
// https://vitejs.dev/config/
export default defineConfig(() => ({
server: {
host: "::",
port: 8080,
},
+ define: {
+ 'import.meta.env.VERSION': JSON.stringify(getVersion()),
+ },
plugins: [
react(),
],