Merge branch 'modules-proxy-patches' into immediate-finds-modules-proxy

This commit is contained in:
Nuckyz 2024-06-12 22:32:52 -03:00
commit e8d696c18c
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9

View file

@ -339,8 +339,7 @@ function patchFactory(id: PropertyKey, factory: AnyModuleFactory) {
// The patched factory wrapper, define it in an object to preserve the name after minification
const patchedFactory: PatchedModuleFactory = {
PatchedFactory(...args: Parameters<AnyModuleFactory>) {
// Restore the original factory in all the module factories objects,
// because we want to make sure the original factory is restored properly, no matter what is the Webpack instance
// Restore the original factory in all the module factories objects. We want to make sure the original factory is restored properly, no matter what is the Webpack instance
for (const wreq of allWebpackInstances) {
define(wreq.m, id, { value: patchedFactory.$$vencordOriginal });
}