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 e3edad2 commit 35e01f0Copy full SHA for 35e01f0
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: {
@@ -22,7 +27,7 @@ export default defineConfig({
27
.replace(/[-:T.Z]/g, "")
28
.slice(0, 14),
24
29
"import.meta.env.GIT_VERSION": new String(
25
- execSync("git rev-parse --short HEAD")
30
+ gitVersion
26
31
),
32
},
33
resolve: {
0 commit comments