core: fix require prismjs on desktop build

This commit is contained in:
Abdullah Atta
2023-10-02 15:28:47 +05:00
parent a6ebe092e8
commit 4a557c67b7
2 changed files with 3 additions and 2 deletions

View File

@@ -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) {

View File

@@ -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;
}