diff --git a/src/components/layout/ExternalLink.tsx b/src/components/layout/ExternalLink.tsx index cb9eaaf..dd4f83a 100644 --- a/src/components/layout/ExternalLink.tsx +++ b/src/components/layout/ExternalLink.tsx @@ -3,9 +3,9 @@ import { ParentComponent } from "solid-js"; export const ExternalLink: ParentComponent<{ href: string }> = (props) => { return ( - {props.children}{" "} + {props.children} @@ -151,6 +159,16 @@ export default function Settings() { ]} /> +
+ + {i18n.t("settings.version")} {RELEASE_VERSION}{" "} + + {COMMIT_HASH} + + +
diff --git a/vite.config.ts b/vite.config.ts index 6226b02..e9bd0af 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,6 +6,9 @@ import autoprefixer from "autoprefixer"; import tailwindcss from "tailwindcss"; import * as path from "path"; +import * as child from "child_process"; + +const commitHash = child.execSync("git rev-parse --short HEAD").toString().trim(); const pwaOptions: Partial = { base: "/", @@ -49,6 +52,10 @@ export default defineConfig({ } }, plugins: [wasm(), solid({ ssr: false }), VitePWA(pwaOptions)], + define: { + "import.meta.env.__COMMIT_HASH__": JSON.stringify(commitHash), + "import.meta.env.__RELEASE_VERSION__": JSON.stringify(process.env.npm_package_version) + }, resolve: { alias: [{ find: "~", replacement: path.resolve(__dirname, "./src") }] },