Optimise Web via treeshaking, cleanup build scripts

This commit is contained in:
Vendicated
2022-10-16 17:15:15 +02:00
parent 845088ec02
commit 01ae0983b3
14 changed files with 261 additions and 269 deletions

View File

@ -17,12 +17,6 @@ import { checkForUpdates, UpdateLogger } from "./utils/updater";
import { onceReady } from "./webpack";
import { Router } from "./webpack/common";
Object.defineProperty(window, "IS_WEB", {
get: () => !window.DiscordNative,
configurable: true,
enumerable: true
});
export let Components: any;
async function init() {
@ -30,21 +24,23 @@ async function init() {
startAllPlugins();
Components = await import("./components");
try {
const isOutdated = await checkForUpdates();
if (isOutdated && Settings.notifyAboutUpdates)
setTimeout(() => {
showNotice(
"A Vencord update is available!",
"View Update",
() => {
popNotice();
Router.open("VencordUpdater");
}
);
}, 10000);
} catch (err) {
UpdateLogger.error("Failed to check for updates", err);
if (!IS_WEB) {
try {
const isOutdated = await checkForUpdates();
if (isOutdated && Settings.notifyAboutUpdates)
setTimeout(() => {
showNotice(
"A Vencord update is available!",
"View Update",
() => {
popNotice();
Router.open("VencordUpdater");
}
);
}, 10000);
} catch (err) {
UpdateLogger.error("Failed to check for updates", err);
}
}
}