Skip to content

Commit

Permalink
Merge branch 'admin-version' of lkiesow/opencast-admin-interface into…
Browse files Browse the repository at this point in the history
… main

Pull request #884

  Include admin interface version
  • Loading branch information
gregorydlogan committed Sep 13, 2024
2 parents 329a3f4 + d408611 commit 4619fd2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="git-commit" content="%VITE_GIT_COMMIT_HASH%">
<meta name="build-date" content="%VITE_APP_BUILD_DATE%">
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
Expand Down
7 changes: 7 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ import react from "@vitejs/plugin-react-swc";
import svgr from "vite-plugin-svgr";
import viteTsconfigPaths from "vite-tsconfig-paths";
import preserveDirectives from "rollup-preserve-directives";
import child from "child_process";

const commitHash = child.execSync("git rev-parse HEAD").toString().trim();

export default defineConfig({
base: process.env.PUBLIC_URL || "",
plugins: [react(), svgr(), viteTsconfigPaths(), preserveDirectives()],
define: {
'import.meta.env.VITE_GIT_COMMIT_HASH': JSON.stringify(commitHash),
'import.meta.env.VITE_APP_BUILD_DATE': JSON.stringify(new Date().toISOString()),
},
build: {
outDir: "build",
sourcemap: true,
Expand Down

0 comments on commit 4619fd2

Please sign in to comment.