lazy extractAndLoadChunks result
This commit is contained in:
parent
a82a0636cf
commit
f6dbcb7709
|
@ -4,7 +4,7 @@
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* 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 { LazyComponent, LazyComponentType, SYM_LAZY_COMPONENT_INNER } from "@utils/lazyReact";
|
||||||
import { Logger } from "@utils/Logger";
|
import { Logger } from "@utils/Logger";
|
||||||
import { canonicalizeMatch } from "@utils/patches";
|
import { canonicalizeMatch } from "@utils/patches";
|
||||||
|
@ -725,7 +725,7 @@ export const ChunkIdsRegex = /\("([^"]+?)"\)/g;
|
||||||
export function extractAndLoadChunksLazy(code: string | string[], matcher: RegExp = DefaultExtractAndLoadChunksRegex) {
|
export function extractAndLoadChunksLazy(code: string | string[], matcher: RegExp = DefaultExtractAndLoadChunksRegex) {
|
||||||
const module = findModuleFactory(...Array.isArray(code) ? code : [code]);
|
const module = findModuleFactory(...Array.isArray(code) ? code : [code]);
|
||||||
|
|
||||||
async function extractAndLoadChunks() {
|
const extractAndLoadChunks = makeLazy(async () => {
|
||||||
if (module[SYM_PROXY_INNER_VALUE] == null) {
|
if (module[SYM_PROXY_INNER_VALUE] == null) {
|
||||||
const err = new Error("extractAndLoadChunks: Couldn't find module factory");
|
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);
|
wreq(entryPointId as any);
|
||||||
return true;
|
return true;
|
||||||
}
|
});
|
||||||
|
|
||||||
if (IS_REPORTER) {
|
if (IS_REPORTER) {
|
||||||
webpackSearchHistory.push(["extractAndLoadChunks", [extractAndLoadChunks]]);
|
webpackSearchHistory.push(["extractAndLoadChunks", [extractAndLoadChunks]]);
|
||||||
|
|
Loading…
Reference in a new issue