diff --git a/src/pages/settings.jsx b/src/pages/settings.jsx
index 3205b842..0875c474 100644
--- a/src/pages/settings.jsx
+++ b/src/pages/settings.jsx
@@ -186,6 +186,24 @@ export default ({ onClose }) => {
.
+ {__BUILD_TIME__ && (
+
+ Last build:{' '}
+ {' '}
+ {__COMMIT_HASH__ && (
+ <>
+ (
+
+ {__COMMIT_HASH__}
+
+ )
+ >
+ )}
+
+ )}
);
};
diff --git a/vite.config.js b/vite.config.js
index f4b5207e..ac587b1c 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -1,9 +1,16 @@
import preact from '@preact/preset-vite';
+import { execSync } from 'child_process';
import { resolve } from 'path';
import { defineConfig, splitVendorChunkPlugin } from 'vite';
+const commitHash = execSync('git rev-parse --short HEAD').toString().trim();
+
// https://vitejs.dev/config/
export default defineConfig({
+ define: {
+ __BUILD_TIME__: JSON.stringify(Date.now()),
+ __COMMIT_HASH__: JSON.stringify(commitHash),
+ },
plugins: [preact(), splitVendorChunkPlugin()],
build: {
sourcemap: true,