Add shortcut for lazy loading chunks

This commit is contained in:
Nuckyz 2024-06-01 18:39:01 -03:00 committed by Vendicated
parent 8fd5d068da
commit ed5ae2ba5c
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
8 changed files with 191 additions and 162 deletions

View file

@ -25,6 +25,7 @@ import definePlugin, { PluginNative, StartAt } from "@utils/types";
import * as Webpack from "@webpack";
import { extract, filters, findAll, findModuleId, search } from "@webpack";
import * as Common from "@webpack/common";
import { loadLazyChunks } from "debug/loadLazyChunks";
import type { ComponentType } from "react";
const DESKTOP_ONLY = (f: string) => () => {
@ -82,6 +83,7 @@ function makeShortcuts() {
wpsearch: search,
wpex: extract,
wpexs: (code: string) => extract(findModuleId(code)!),
loadLazyChunks: IS_DEV ? loadLazyChunks : () => { throw new Error("loadLazyChunks is dev only."); },
find,
findAll: findAll,
findByProps,