Move unloadModule to RenderHost
Summary: Define unload module on RenderHost. Not sure how to do that the browser and not sure how meaning full it is in a browser context. Reviewed By: nikoant Differential Revision: D32827050 fbshipit-source-id: 87025c6f5c2b950880712bff8df1c92a044a222e
This commit is contained in:
committed by
Facebook GitHub Bot
parent
6c7a139554
commit
d0402d7268
@@ -1,16 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
export function unloadModule(path: string) {
|
||||
const resolvedPath = global.electronRequire.resolve(path);
|
||||
if (!resolvedPath || !global.electronRequire.cache[resolvedPath]) {
|
||||
return;
|
||||
}
|
||||
delete global.electronRequire.cache[resolvedPath];
|
||||
}
|
||||
Reference in New Issue
Block a user