Reduce production bundles while preserving host registration

This commit is contained in:
vorotamoroz committed 2026-10-29 15:06:33 +00:00
1 parent b9dcb0d4c7
commit b8d4ff2c16
10 files changed
+133 -20

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
import { fs } from "@vrtmrz/livesync-commonlib/node";
/** Read a string-valued version field from a JSON file during Node builds. */
export function readVersion(filePath: string): string | undefined {
const parsed: unknown = JSON.parse(fs.readFileSync(filePath, "utf-8"));
if (typeof parsed !== "object" || parsed === null || !("version" in parsed)) {
return undefined;
}
return typeof parsed.version === "string" ? parsed.version : undefined;
}