diff --git a/src/components/SVGContent.svelte b/src/components/SVGContent.svelte index 7e8b6db..e8f110f 100644 --- a/src/components/SVGContent.svelte +++ b/src/components/SVGContent.svelte @@ -544,10 +544,18 @@
Zoom level:{Math.round(bbox.z * 1000) / 1000}
- +
+ +
+
+ +

+ Version - {__COMMIT_HASH__} +

+
@@ -598,6 +606,13 @@ border: 2px solid white; font-family: monospace; padding: 1em 2em; + + .version { + text-align: center; + font-weight: bold; + width: 100%; + margin: 0.5em; + } } .devpanel div { diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index 4078e74..101ec8a 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -1,2 +1,3 @@ /// /// +declare const __COMMIT_HASH__: string \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index 1599316..dbb23dc 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,8 +1,14 @@ import { defineConfig } from "vite"; import { svelte } from "@sveltejs/vite-plugin-svelte"; +import cp from "child_process"; + +const commitHash = cp.execSync("git rev-parse --short HEAD").toString(); // https://vitejs.dev/config/ export default defineConfig({ plugins: [svelte()], base: "", + define: { + __COMMIT_HASH__: JSON.stringify(commitHash), + }, });