Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add git hash meta tag and update build scripts to include git hash #2738

Merged
merged 1 commit into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@
name="viewport"
content="width=device-width, initial-scale=1"
/>
<meta
name="git-hash"
content="%VITE_APP_GIT_HASH%"
/>
<title>%VITE_APP_NAME%</title>
</head>
<style>
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
"lint:check": "eslint . --ext .ts,.tsx",
"pretty": "prettier . --write",
"pretty:check": "prettier . --check",
"dev": "vite --force",
"preview": "vite preview",
"build": "vite build && vite build --mode page-function",
"dev": "VITE_APP_GIT_HASH=$(git rev-parse --short HEAD) vite",
"preview": "VITE_APP_GIT_HASH=$(git rev-parse --short HEAD) vite preview",
"build": "VITE_APP_GIT_HASH=$(git rev-parse --short HEAD) vite build && vite build --mode page-function",
"test": "vitest --dir=test"
},
"engines": {
Expand Down
2 changes: 2 additions & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ interface ImportMetaEnv {
readonly VITE_APP_HOTJAR_SITE_ID: string;
readonly VITE_APP_HOTJAR_VERSION: string;
readonly VITE_APP_SENTRY_DSN_URL: string;

readonly VITE_APP_GIT_HASH: string;
}

interface ImportMeta {
Expand Down