diff --git a/vite.config.ts b/vite.config.ts index 28657ae..5751692 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,11 +5,16 @@ import svg from "@poppanator/sveltekit-svg"; import wasm from "vite-plugin-wasm"; import { execSync } from "child_process"; -let commitHash = "unknown"; -try { - commitHash = execSync("git rev-parse --short HEAD").toString().trim(); -} catch (e) { - console.warn("Could not determine Git commit hash:", e); +// coollify removes the .git folder but exposes commit via SOURCE_COMMIT env variable +let commitHash = process.env.SOURCE_COMMIT || "unknown"; + +if (commitHash === "unknown") { + try { + commitHash = execSync("git rev-parse --short HEAD").toString().trim(); + } catch (e) { + console.warn(`Could not determine Git commit hash: ${e}`); + commitHash = "unknown"; + } } export default defineConfig(({ command }) => {