Skip to content

Commit

Permalink
fix: vite docs lied to me
Browse files Browse the repository at this point in the history
  • Loading branch information
OldStarchy committed Jul 23, 2024
1 parent 464e604 commit 4936d25
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_GIT_SHA=$GIT_SHA
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"homepage": "https://oldstarchy.github.io/pandemic_tracker/",
"type": "module",
"scripts": {
"dev": "vite",
"build": "VITE_GIT_SHA=`git rev-parse --short HEAD` tsc -b && vite build && yarn sentry:sourcemaps",
"dev": "export GIT_SHA=\"Dev Mode\" && vite",
"build": "export GIT_SHA=$(git rev-parse --short HEAD) && echo $GIT_SHA && tsc -b && vite build && yarn sentry:sourcemaps",
"lint": "eslint . --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"sentry:sourcemaps": "sentry-cli sourcemaps inject --org nicholas-sorokin --project pandemic-tracker ./dist && sentry-cli sourcemaps upload --org nicholas-sorokin --project pandemic-tracker ./dist"
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export function MainLayout({ children }: { children: ReactNode }) {
<Link href={newIssueLink.toString()} target="_BLANK">
Report an issue or suggest a feature
</Link>
{import.meta.env.DEV && <Span>Dev Mode</Span>}
<Span>{import.meta.env.VITE_GIT_SHA ?? 'Dev Mode'}</Span>
</footer>
</div>
);
Expand Down

0 comments on commit 4936d25

Please sign in to comment.