Sync backend/frontend versions to Docker/VERSION and read version from it

This commit is contained in:
2026-03-19 19:13:38 +01:00
parent 133ab2e82c
commit 80a6bac33e
5 changed files with 51 additions and 13 deletions

View File

@@ -3,16 +3,19 @@ import react from "@vitejs/plugin-react";
import { resolve } from "path";
import { readFileSync } from "node:fs";
const pkg = JSON.parse(
readFileSync(resolve(__dirname, "package.json"), "utf-8"),
) as { version: string };
const appVersion = readFileSync(
resolve(__dirname, "../Docker/VERSION"),
"utf-8",
)
.trim()
.replace(/^v/, "");
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
define: {
/** BanGUI application version injected at build time from package.json. */
__APP_VERSION__: JSON.stringify(pkg.version),
/** BanGUI application version injected at build time from Docker/VERSION. */
__APP_VERSION__: JSON.stringify(appVersion),
},
resolve: {
alias: {