🐛 Fix exception on manifest reading on release build

This commit is contained in:
Andrey Antukh 2023-12-29 17:22:04 +01:00
parent 22b326e2b9
commit 04dbe5f741

View file

@ -146,8 +146,8 @@ function readLocales() {
function readManifest() { function readManifest() {
try { try {
const path = __dirname + "/resources/public/js/manifest.json"; const manifestPath = path.resolve("resources/public/js/manifest.json");
const content = JSON.parse(fs.readFileSync(path, { encoding: "utf8" })); const content = JSON.parse(fs.readFileSync(manifestPath, { encoding: "utf8" }));
const index = { const index = {
config: "js/config.js?ts=" + Date.now(), config: "js/config.js?ts=" + Date.now(),
@ -160,7 +160,7 @@ function readManifest() {
return index; return index;
} catch (e) { } catch (e) {
console.error("Error on reading manifest, using default."); console.error("Error on reading manifest, using default.", e);
return { return {
config: "js/config.js", config: "js/config.js",
polyfills: "js/polyfills.js", polyfills: "js/polyfills.js",