fix(client): source app version from package.json
The client version shown on the Settings page was hardcoded as a literal in vite.config.ts, while client/package.json sat at the placeholder "0.0.0". Bumping the displayed version required editing two unrelated places, and stale Docker client images would keep showing the old number after upgrades. This change makes client/package.json the single source of truth and reads it at build time. Bumps client/package.json from 0.0.0 to 3.6.1 to preserve current behaviour. Closes #3271
This commit is contained in:
1 parent
6ed0818bad
commit
f654310c4d
2 files changed
+4
-2
No files matched your search
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "client",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"version": "3.6.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -3,11 +3,13 @@ import react from "@vitejs/plugin-react";
|
||||
import svgr from "vite-plugin-svgr";
|
||||
import path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import { readFileSync } from "fs";
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
export default defineConfig(({}) => {
|
||||
let version = "3.6.1";
|
||||
const pkg = JSON.parse(readFileSync(path.resolve(__dirname, "package.json"), "utf-8"));
|
||||
const version = pkg.version;
|
||||
|
||||
return {
|
||||
base: "/",
|
||||
|
||||
Reference in new issue
Block a user