refactor: get GIT_COMMIT and APP_VERSION from import.meta.env (#592)

This commit is contained in:
Alex Gleason
2025-10-05 23:42:28 -05:00
committed by GitHub
parent 687eca821d
commit 4adae16b80
3 changed files with 3 additions and 6 deletions

View File

@@ -116,7 +116,7 @@ const SettingsPage = forwardRef(({ index }: { index?: number }, ref) => {
</div> </div>
<div className="flex gap-2 items-center"> <div className="flex gap-2 items-center">
<div className="text-muted-foreground"> <div className="text-muted-foreground">
v{__APP_VERSION__} ({__GIT_COMMIT__}) v{import.meta.env.APP_VERSION} ({import.meta.env.GIT_COMMIT})
</div> </div>
<ChevronRight /> <ChevronRight />
</div> </div>

3
src/vite-env.d.ts vendored
View File

@@ -5,7 +5,4 @@ declare global {
interface Window { interface Window {
nostr?: TNip07 nostr?: TNip07
} }
const __GIT_COMMIT__: string
const __APP_VERSION__: string
} }

View File

@@ -26,8 +26,8 @@ const getAppVersion = () => {
// https://vite.dev/config/ // https://vite.dev/config/
export default defineConfig({ export default defineConfig({
define: { define: {
__GIT_COMMIT__: getGitHash(), 'import.meta.env.GIT_COMMIT': getGitHash(),
__APP_VERSION__: getAppVersion() 'import.meta.env.APP_VERSION': getAppVersion()
}, },
resolve: { resolve: {
alias: { alias: {