lazy extractAndLoadChunks result

This commit is contained in:
Nuckyz 2024-06-21 03:05:30 -03:00
parent a82a0636cf
commit f6dbcb7709
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { proxyLazy } from "@utils/lazy";
import { makeLazy, proxyLazy } from "@utils/lazy";
import { LazyComponent, LazyComponentType, SYM_LAZY_COMPONENT_INNER } from "@utils/lazyReact";
import { Logger } from "@utils/Logger";
import { canonicalizeMatch } from "@utils/patches";
@ -725,7 +725,7 @@ export const ChunkIdsRegex = /\("([^"]+?)"\)/g;
export function extractAndLoadChunksLazy(code: string | string[], matcher: RegExp = DefaultExtractAndLoadChunksRegex) {
const module = findModuleFactory(...Array.isArray(code) ? code : [code]);
async function extractAndLoadChunks() {
const extractAndLoadChunks = makeLazy(async () => {
if (module[SYM_PROXY_INNER_VALUE] == null) {
const err = new Error("extractAndLoadChunks: Couldn't find module factory");
@ -779,7 +779,7 @@ export function extractAndLoadChunksLazy(code: string | string[], matcher: RegEx
wreq(entryPointId as any);
return true;
}
});
if (IS_REPORTER) {
webpackSearchHistory.push(["extractAndLoadChunks", [extractAndLoadChunks]]);