Fix patchable modules
This commit is contained in:
parent
68688684a6
commit
c985480fb9
|
@ -34,24 +34,20 @@ export default function () {
|
|||
|
||||
if (!Reflect.has(window, chunkName)) {
|
||||
predefine(window, chunkName, instance => {
|
||||
predefine(instance, "push", () => {
|
||||
instance.push([[Symbol()], {}, require => {
|
||||
require.d = (target, exports) => {
|
||||
for (const key in exports) {
|
||||
if (!Reflect.has(exports, key) || target[key]) continue;
|
||||
|
||||
Object.defineProperty(target, key, {
|
||||
get: () => exports[key](),
|
||||
set: v => {exports[key] = () => v;},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
};
|
||||
}]);
|
||||
|
||||
instance.pop();
|
||||
});
|
||||
instance.push([[Symbol()], {}, require => {
|
||||
require.d = (target, exports) => {
|
||||
for (const key in exports) {
|
||||
if (!Reflect.has(exports, key) || target[key]) continue;
|
||||
|
||||
Object.defineProperty(target, key, {
|
||||
get: () => exports[key](),
|
||||
set: v => {exports[key] = () => v;},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
};
|
||||
}]);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
@ -190,7 +190,7 @@ export default class WebpackModules {
|
|||
if (!modules.hasOwnProperty(index)) continue;
|
||||
|
||||
let module = null;
|
||||
try {module = modules[index]} catch {continue;};
|
||||
try {module = modules[index];} catch {continue;}
|
||||
|
||||
const {exports} = module;
|
||||
if (!exports || exports === window || exports === document.documentElement || exports[Symbol.toStringTag] === "DOMTokenList") continue;
|
||||
|
|
Loading…
Reference in New Issue