From b38ab066d9a8109b3fa5631b1a6c05ac4a728e5e Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Fri, 24 May 2024 02:02:28 -0300 Subject: [PATCH] Preserve original modules prototype --- src/webpack/patchWebpack.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webpack/patchWebpack.ts b/src/webpack/patchWebpack.ts index 4aa468fe8..d27d450b3 100644 --- a/src/webpack/patchWebpack.ts +++ b/src/webpack/patchWebpack.ts @@ -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";