Remove frontend build-version plumbing
The backend status endpoint already reports the shared git hash and environment, so the SPA no longer needs its own baked copy.
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
declare const __GIT_COMMIT_HASH__: string;
|
||||
|
||||
export const GIT_COMMIT_HASH = __GIT_COMMIT_HASH__;
|
||||
export const APP_ENV = import.meta.env.DEV ? "dev" : "prod";
|
||||
export const APP_VERSION = `${APP_ENV} @ ${GIT_COMMIT_HASH}`;
|
||||
@@ -1,30 +1,13 @@
|
||||
import { execSync } from "node:child_process";
|
||||
import { fileURLToPath, URL } from "node:url";
|
||||
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { defineConfig } from "vite";
|
||||
|
||||
function gitCommitHash(): string {
|
||||
try {
|
||||
return execSync("git rev-parse --short HEAD", {
|
||||
cwd: fileURLToPath(new URL(".", import.meta.url)),
|
||||
stdio: ["ignore", "pipe", "ignore"],
|
||||
})
|
||||
.toString()
|
||||
.trim();
|
||||
} catch {
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
const backend = process.env.VITE_BACKEND ?? "http://127.0.0.1:8000";
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
define: {
|
||||
__GIT_COMMIT_HASH__: JSON.stringify(gitCommitHash()),
|
||||
},
|
||||
plugins: [react(), tailwindcss()],
|
||||
resolve: {
|
||||
alias: {
|
||||
|
||||
Reference in New Issue
Block a user