We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e7a85f commit d0227baCopy full SHA for d0227ba
astro.config.mjs
@@ -13,6 +13,11 @@ import deleteUnusedImages from "astro-delete-unused-images";
13
import preload from "astro-preload";
14
import { execSync } from "node:child_process";
15
16
+let gitVersion = "";
17
+try {
18
+ gitVersion = execSync("git rev-parse --short HEAD 2>&1 > /dev/null");
19
+} catch (e) {}
20
+
21
// https://astro.build/config
22
export default defineConfig({
23
vite: {
@@ -21,9 +26,7 @@ export default defineConfig({
26
.toISOString()
27
.replace(/[-:T.Z]/g, "")
28
.slice(0, 14),
24
- "import.meta.env.GIT_VERSION": new String(
25
- execSync("git rev-parse --short HEAD")
- ),
29
+ "import.meta.env.GIT_VERSION": new String(gitVersion),
30
},
31
resolve: {
32
alias: {
0 commit comments