File tree Expand file tree Collapse file tree 4 files changed +10
-7
lines changed Expand file tree Collapse file tree 4 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import deleteUnusedImages from "astro-delete-unused-images";
1313import preload from "astro-preload" ;
1414import { 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
1818if ( ! gitVersion ) {
1919 try {
@@ -31,11 +31,11 @@ if (!gitVersion) {
3131export 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 : {
Original file line number Diff line number Diff 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__ ;
1010const canonicalURL = new URL (Astro .url .pathname , Astro .site );
1111
1212const { title, description, image = " /social-card.png" } = Astro .props ;
Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ import { Fullbleed } from "./layout/fullbleed";
44import links from " ../data/links.json" ;
55import { 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" >
Original file line number Diff line number Diff line change @@ -10,3 +10,6 @@ interface ImportMetaEnv {
1010interface ImportMeta {
1111 readonly env : ImportMetaEnv ;
1212}
13+
14+ declare const __GIT_VERSION__ : string ;
15+ declare const __TIMESTAMP__ : string ;
You can’t perform that action at this time.
0 commit comments