Browse Source

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

imwald
Alex Gleason 5 months ago committed by Silberengel
parent
commit
5ebcf4c817
  1. 2
      src/pages/secondary/SettingsPage/index.tsx
  2. 3
      src/vite-env.d.ts
  3. 4
      vite.config.ts

2
src/pages/secondary/SettingsPage/index.tsx

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

3
src/vite-env.d.ts vendored

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

4
vite.config.ts

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

Loading…
Cancel
Save