diff --git a/web/vite.config.ts b/web/vite.config.ts index c006871..01332fe 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -1,7 +1,15 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' +import { execSync } from 'child_process' -const gitSha = process.env.GIT_SHA || 'dev' +let gitSha = process.env.GIT_SHA +if (!gitSha) { + try { + gitSha = execSync('git rev-parse --short HEAD').toString().trim() + } catch (e) { + gitSha = 'dev' + } +} // https://vite.dev/config/ export default defineConfig({