From f6dbcb77091d955e6800096a16a204d81a7db116 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Fri, 21 Jun 2024 03:05:30 -0300 Subject: [PATCH] lazy extractAndLoadChunks result --- src/webpack/webpack.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/webpack/webpack.tsx b/src/webpack/webpack.tsx index 388fe7942..36f243300 100644 --- a/src/webpack/webpack.tsx +++ b/src/webpack/webpack.tsx @@ -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]]);