diff options
author | Ven <vendicated@riseup.net> | 2022-10-30 20:45:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-30 20:45:18 +0100 |
commit | 8adf7ca155a7f2b9d59ecfcc98ca47d123a26f59 (patch) | |
tree | 8397630ff18f8fa8952396334b3e4c003786cd07 /src/Vencord.ts | |
parent | b905743077f5ffdd09c8ff3464ac19f770ae875f (diff) | |
download | Vencord-8adf7ca155a7f2b9d59ecfcc98ca47d123a26f59.tar.gz Vencord-8adf7ca155a7f2b9d59ecfcc98ca47d123a26f59.tar.bz2 Vencord-8adf7ca155a7f2b9d59ecfcc98ca47d123a26f59.zip |
Webpack Warnings & Errors (#178)
* dev: Useful strict Warnings & Errors
* Always log error
* Ignore pending patches with all or whose predicate = false
* Error -> Warn
Diffstat (limited to 'src/Vencord.ts')
-rw-r--r-- | src/Vencord.ts | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/Vencord.ts b/src/Vencord.ts index 4d18cb2..041335f 100644 --- a/src/Vencord.ts +++ b/src/Vencord.ts @@ -25,7 +25,7 @@ export * as Webpack from "./webpack"; import { popNotice, showNotice } from "./api/Notices"; import { PlainSettings, Settings } from "./api/settings"; -import { startAllPlugins } from "./plugins"; +import { patches, PMLogger, startAllPlugins } from "./plugins"; export { PlainSettings, Settings }; @@ -61,6 +61,19 @@ async function init() { UpdateLogger.error("Failed to check for updates", err); } } + + if (IS_DEV) { + const pendingPatches = patches.filter(p => !p.all && p.predicate?.() !== false); + if (pendingPatches.length) + PMLogger.warn( + "Webpack has finished initialising, but some patches haven't been applied yet.", + "This might be expected since some Modules are lazy loaded, but please verify", + "that all plugins are working as intended.", + "You are seeing this warning because this is a Development build of Vencord.", + "\nThe following patches have not been applied:", + "\n\n" + pendingPatches.map(p => `${p.plugin}: ${p.find}`).join("\n") + ); + } } init(); |