From 5e762ddd044afb5d770f47b21044926e557e827f Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Thu, 23 May 2024 23:18:43 -0300 Subject: [PATCH] Add names to Modules objects --- src/webpack/patchWebpack.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/webpack/patchWebpack.ts b/src/webpack/patchWebpack.ts index 27db70970..51d0b9a93 100644 --- a/src/webpack/patchWebpack.ts +++ b/src/webpack/patchWebpack.ts @@ -167,6 +167,8 @@ Object.defineProperty(Function.prototype, "m", { // The new object which will contain the factories const proxiedModules: WebpackRequire["m"] = {}; + // @ts-ignore + proxiedModules[Symbol.toStringTag] = "ProxiedModules"; for (const id in originalModules) { // If we have eagerPatches enabled we have to patch the pre-populated factories @@ -180,9 +182,10 @@ Object.defineProperty(Function.prototype, "m", { delete originalModules[id]; } - // @ts-ignore - originalModules.$$proxiedModules = proxiedModules; allProxiedModules.add(proxiedModules); + + // @ts-ignore + originalModules[Symbol.toStringTag] = "OriginalModules"; Object.setPrototypeOf(originalModules, new Proxy(proxiedModules, modulesProxyHandler)); }