Skip to content

Commit 30e5138

Browse files
committed
try something
1 parent d292b52 commit 30e5138

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

astro.config.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import deleteUnusedImages from "astro-delete-unused-images";
1313
import preload from "astro-preload";
1414
import { execSync } from "node:child_process";
1515

16-
let gitVersion = String(import.meta.env.GIT_VERSION ?? "").slice(0, 7);
16+
let gitVersion = String(process.env.GIT_VERSION ?? "").slice(0, 7);
1717

1818
if (!gitVersion) {
1919
try {
@@ -31,11 +31,11 @@ if (!gitVersion) {
3131
export default defineConfig({
3232
vite: {
3333
define: {
34-
"import.meta.env.TIMESTAMP": new Date()
34+
__TIMESTAMP__: new Date()
3535
.toISOString()
3636
.replace(/[-:T.Z]/g, "")
3737
.slice(0, 14),
38-
"import.meta.env.GIT_VERSION": `"${gitVersion}"`,
38+
__GIT_VERSION__: gitVersion,
3939
},
4040
resolve: {
4141
alias: {

src/components/BaseHead.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ interface Props {
55
image?: string;
66
}
77
8-
const buildTimestamp = import.meta.env.TIMESTAMP;
9-
const gitVersion = import.meta.env.GIT_VERSION;
8+
const buildTimestamp = __TIMESTAMP__;
9+
const gitVersion = __GIT_VERSION__;
1010
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
1111
1212
const { title, description, image = "/social-card.png" } = Astro.props;

src/components/Footer.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { Fullbleed } from "./layout/fullbleed";
44
import links from "../data/links.json";
55
import { EPSLogo } from "./logo/eps-logo";
66
7-
const buildTimestamp = import.meta.env.TIMESTAMP;
8-
const gitVersion = import.meta.env.GIT_VERSION;
7+
const buildTimestamp = __TIMESTAMP__;
8+
const gitVersion = __GIT_VERSION__;
99
---
1010

1111
<div class="mt-auto">

src/env.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ interface ImportMetaEnv {
1010
interface ImportMeta {
1111
readonly env: ImportMetaEnv;
1212
}
13+
14+
declare const __GIT_VERSION__: string;
15+
declare const __TIMESTAMP__: string;

0 commit comments

Comments
 (0)