From 4a557c67b77395af8a6fde2c5692a7222ec48927 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Mon, 2 Oct 2023 15:28:47 +0500 Subject: [PATCH] core: fix require prismjs on desktop build --- packages/core/scripts/prebuild.mjs | 2 +- packages/core/src/utils/templates/html/builder.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/scripts/prebuild.mjs b/packages/core/scripts/prebuild.mjs index 53e5f4b5e..d54b0c60b 100644 --- a/packages/core/scripts/prebuild.mjs +++ b/packages/core/scripts/prebuild.mjs @@ -32,7 +32,7 @@ const languagesList = await langen( path.join(ROOT_DIR, "src", "utils", "templates", "html", "languages") ); const languageIndex = `function hasRequire() { - return typeof require === "function" && !("IS_DESKTOP_APP" in globalThis); + return typeof require === "function" && !IS_DESKTOP_APP; } export async function loadLanguage(language) { diff --git a/packages/core/src/utils/templates/html/builder.js b/packages/core/src/utils/templates/html/builder.js index 9c3038552..2990d368c 100644 --- a/packages/core/src/utils/templates/html/builder.js +++ b/packages/core/src/utils/templates/html/builder.js @@ -114,5 +114,6 @@ async function preprocessHTML(templateData) { export default { buildHTML }; function hasRequire() { - return typeof require === "function" && !("IS_DESKTOP_APP" in globalThis); + // eslint-disable-next-line no-undef + return typeof require === "function" && !IS_DESKTOP_APP; }