Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ import deleteUnusedImages from "astro-delete-unused-images";
import preload from "astro-preload";
import { execSync } from "node:child_process";

let gitVersion = "";
try {
gitVersion = execSync("git rev-parse --short HEAD 2>&1 > /dev/null");
} catch (e) {}

// https://astro.build/config
export default defineConfig({
vite: {
Expand All @@ -21,9 +26,7 @@ export default defineConfig({
.toISOString()
.replace(/[-:T.Z]/g, "")
.slice(0, 14),
"import.meta.env.GIT_VERSION": new String(
execSync("git rev-parse --short HEAD")
),
"import.meta.env.GIT_VERSION": new String(gitVersion),
},
resolve: {
alias: {
Expand Down