Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

core: fix require prismjs on desktop build

Abdullah Atta4a557c67b773
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;
}