Hotfix for Discord's switch to rspack (#1685)
* Fix patchable modules * Fix bd-head location and modals
This commit is contained in:
+14
-18
@@ -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
|
||||
});
|
||||
}
|
||||
};
|
||||
}]);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user