Unload uninstalled plugins from Electron cache

Summary: Electron/Node.js does not garbage collects unloaded modules by default. Need to cleanup require.cache to fully unload them.

Reviewed By: passy

Differential Revision: D25545962

fbshipit-source-id: 4dce32f39e22adcd2b4f5a55853551379e786e7b
This commit is contained in:
Anton Nikolaev
2020-12-15 09:28:58 -08:00
committed by Facebook GitHub Bot
parent 965559ee65
commit 756edf9860
3 changed files with 41 additions and 1 deletions

View File

@@ -11,7 +11,11 @@ declare module NodeJS {
interface Global {
__REVISION__: string | undefined;
__VERSION__: string;
electronRequire: (name: string) => any;
electronRequire: {
(name: string): any;
resolve: (module: string) => string;
cache: {[module: string]: any};
};
window: Window | undefined;
WebSocket: any;
fetch: any;