Add names to Modules objects
This commit is contained in:
parent
16d05c8935
commit
5e762ddd04
|
@ -167,6 +167,8 @@ Object.defineProperty(Function.prototype, "m", {
|
||||||
|
|
||||||
// The new object which will contain the factories
|
// The new object which will contain the factories
|
||||||
const proxiedModules: WebpackRequire["m"] = {};
|
const proxiedModules: WebpackRequire["m"] = {};
|
||||||
|
// @ts-ignore
|
||||||
|
proxiedModules[Symbol.toStringTag] = "ProxiedModules";
|
||||||
|
|
||||||
for (const id in originalModules) {
|
for (const id in originalModules) {
|
||||||
// If we have eagerPatches enabled we have to patch the pre-populated factories
|
// 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];
|
delete originalModules[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
|
||||||
originalModules.$$proxiedModules = proxiedModules;
|
|
||||||
allProxiedModules.add(proxiedModules);
|
allProxiedModules.add(proxiedModules);
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
originalModules[Symbol.toStringTag] = "OriginalModules";
|
||||||
Object.setPrototypeOf(originalModules, new Proxy(proxiedModules, modulesProxyHandler));
|
Object.setPrototypeOf(originalModules, new Proxy(proxiedModules, modulesProxyHandler));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue