Preserve original modules prototype

This commit is contained in:
Nuckyz 2024-05-24 02:02:28 -03:00
parent 37514e0720
commit 0146789514
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9

View file

@ -166,7 +166,7 @@ Object.defineProperty(Function.prototype, "m", {
logger.info("Found Webpack module factory", stack.match(/\/assets\/(.+?\.js)/)?.[1] ?? "");
// The new object which will contain the factories
const proxiedModules: WebpackRequire["m"] = {};
const proxiedModules: WebpackRequire["m"] = Object.create(Object.getPrototypeOf(originalModules));
// @ts-ignore
proxiedModules[Symbol.toStringTag] = "ProxiedModules";