Skip to content

Commit

Permalink
Trancate revision commit ref
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Nov 24, 2022
1 parent d0bd41d commit be9934d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ import { execSync } from "child_process";
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd());
const commitRef = env["VITE_COMMIT_REF"] ?? execSync("git rev-parse --short HEAD").toString().trim();
const commitShortRef = commitRef.slice(
0,
7,
);
return {
build: {
outDir: "./build",
},
plugins: [react()],
define: {
APP_COMMIT_REF: JSON.stringify(commitRef),
APP_COMMIT_REF: JSON.stringify(commitShortRef),
},
};
});

0 comments on commit be9934d

Please sign in to comment.