From ebf84831be8da5f91214140a8358080ae78060f7 Mon Sep 17 00:00:00 2001 From: dalaoshu Date: Mon, 29 Jul 2024 21:25:20 +0800 Subject: [PATCH] refactor(typescript): packages/rspack/src/lib from js to ts and esm (#7289) * chore: rename * chore: save progress * refactor(typescript): packages/rspack/src/lib from js to ts and esm * chore: restore the ignoreWarningsPlugin filename * chore: restore * chore: restore EnvironmentPlugin * chore: delete ignoreWarningsPlugin.ts * chore: restore IgnoreWarningsPlugin.ts * chore: rebase * chore: resolve review conversation --------- Co-authored-by: SoonIter --- packages/rspack/etc/api.md | 2408 +++++++++-------- packages/rspack/src/Compiler.ts | 72 +- packages/rspack/src/NormalModule.ts | 2 + .../rspack/src/lib/AbstractMethodError.js | 51 - .../rspack/src/lib/AbstractMethodError.ts | 51 + packages/rspack/src/lib/Cache.js | 175 -- packages/rspack/src/lib/Cache.ts | 166 ++ packages/rspack/src/lib/CacheFacade.js | 380 --- packages/rspack/src/lib/CacheFacade.ts | 405 +++ packages/rspack/src/lib/EntryOptionPlugin.ts | 27 +- ...ironmentPlugin.js => EnvironmentPlugin.ts} | 42 +- packages/rspack/src/lib/HookWebpackError.js | 95 - packages/rspack/src/lib/HookWebpackError.ts | 86 + ...ningsPlugin.ts => IgnoreWarningsPlugin.ts} | 24 +- .../rspack/src/lib/LoaderOptionsPlugin.js | 57 - .../rspack/src/lib/LoaderOptionsPlugin.ts | 60 + packages/rspack/src/lib/LoaderTargetPlugin.js | 41 - packages/rspack/src/lib/LoaderTargetPlugin.ts | 36 + .../rspack/src/lib/ModuleFilenameHelpers.ts | 12 +- .../src/lib/NormalModuleReplacementPlugin.ts | 20 +- packages/rspack/src/lib/WebpackError.js | 65 - packages/rspack/src/lib/WebpackError.ts | 40 + .../rspack/src/lib/cache/getLazyHashedEtag.js | 84 - .../rspack/src/lib/cache/getLazyHashedEtag.ts | 97 + .../cache/{mergeEtags.js => mergeEtags.ts} | 36 +- .../{formatLocation.js => formatLocation.ts} | 36 +- packages/rspack/src/rspackOptionsApply.ts | 2 +- 27 files changed, 2385 insertions(+), 2185 deletions(-) delete mode 100644 packages/rspack/src/lib/AbstractMethodError.js create mode 100644 packages/rspack/src/lib/AbstractMethodError.ts delete mode 100644 packages/rspack/src/lib/Cache.js create mode 100644 packages/rspack/src/lib/Cache.ts delete mode 100644 packages/rspack/src/lib/CacheFacade.js create mode 100644 packages/rspack/src/lib/CacheFacade.ts rename packages/rspack/src/lib/{EnvironmentPlugin.js => EnvironmentPlugin.ts} (62%) delete mode 100644 packages/rspack/src/lib/HookWebpackError.js create mode 100644 packages/rspack/src/lib/HookWebpackError.ts rename packages/rspack/src/lib/{ignoreWarningsPlugin.ts => IgnoreWarningsPlugin.ts} (50%) delete mode 100644 packages/rspack/src/lib/LoaderOptionsPlugin.js create mode 100644 packages/rspack/src/lib/LoaderOptionsPlugin.ts delete mode 100644 packages/rspack/src/lib/LoaderTargetPlugin.js create mode 100644 packages/rspack/src/lib/LoaderTargetPlugin.ts delete mode 100644 packages/rspack/src/lib/WebpackError.js create mode 100644 packages/rspack/src/lib/WebpackError.ts delete mode 100644 packages/rspack/src/lib/cache/getLazyHashedEtag.js create mode 100644 packages/rspack/src/lib/cache/getLazyHashedEtag.ts rename packages/rspack/src/lib/cache/{mergeEtags.js => mergeEtags.ts} (65%) rename packages/rspack/src/lib/{formatLocation.js => formatLocation.ts} (66%) diff --git a/packages/rspack/etc/api.md b/packages/rspack/etc/api.md index ca571629106..d4d909fe896 100644 --- a/packages/rspack/etc/api.md +++ b/packages/rspack/etc/api.md @@ -6,11 +6,12 @@ /// +import { AsyncParallelHook } from '@rspack/lite-tapable'; +import { AsyncSeriesBailHook } from '@rspack/lite-tapable'; import * as binding from '@rspack/binding'; import { BuiltinPlugin } from '@rspack/binding'; import { BuiltinPluginName } from '@rspack/binding'; -import Cache_2 = require('./lib/Cache'); -import CacheFacade = require('./lib/CacheFacade'); +import { CacheFacade as CacheFacade_2 } from './lib/CacheFacade'; import type { Callback } from '@rspack/lite-tapable'; import { cleanupGlobalTrace } from '@rspack/binding'; import { Compiler as Compiler_2 } from '../Compiler'; @@ -21,6 +22,7 @@ import { ExternalObject } from '@rspack/binding'; import fs from 'graceful-fs'; import { fs as fs_2 } from 'fs'; import { HookMap } from '@rspack/lite-tapable'; +import { inspect } from 'node:util'; import type { JsAssetInfo } from '@rspack/binding'; import { JsChunk } from '@rspack/binding'; import { JsChunkGroup } from '@rspack/binding'; @@ -35,7 +37,6 @@ import { JsRuntimeModule } from '@rspack/binding'; import type { JsStats } from '@rspack/binding'; import type { JsStatsError } from '@rspack/binding'; import type { JsStatsWarning } from '@rspack/binding'; -import { libCacheFacade } from './lib/CacheFacade'; import * as liteTapable from '@rspack/lite-tapable'; import { Logger as Logger_2 } from './logging/Logger'; import { RawCopyPattern } from '@rspack/binding'; @@ -52,6 +53,7 @@ import { registerGlobalTrace } from '@rspack/binding'; import { RspackOptionsNormalized as RspackOptionsNormalized_2 } from '.'; import sources = require('../compiled/webpack-sources'); import { SyncBailHook } from '@rspack/lite-tapable'; +import { SyncHook } from '@rspack/lite-tapable'; import { SyncWaterfallHook } from '@rspack/lite-tapable'; import type * as webpackDevServer from 'webpack-dev-server'; @@ -194,8 +196,9 @@ const assetGeneratorOptions: z.ZodObject, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>>; publicPath: z.ZodOptional, z.ZodUnion<[z.ZodString, z.ZodFunction, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>]>>; }>, "strict", z.ZodTypeAny, { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; dataUrl?: { mimetype?: string | undefined; encoding?: false | "base64" | undefined; @@ -203,10 +206,10 @@ const assetGeneratorOptions: z.ZodObject string) | undefined; - emit?: boolean | undefined; }, { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; dataUrl?: { mimetype?: string | undefined; encoding?: false | "base64" | undefined; @@ -214,7 +217,6 @@ const assetGeneratorOptions: z.ZodObject string) | undefined; - emit?: boolean | undefined; }>; // @public (undocumented) @@ -323,12 +325,12 @@ const assetResourceGeneratorOptions: z.ZodObject<{ filename: z.ZodOptional, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>>; publicPath: z.ZodOptional, z.ZodUnion<[z.ZodString, z.ZodFunction, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>]>>; }, "strict", z.ZodTypeAny, { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; }, { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; }>; @@ -371,43 +373,43 @@ const bail: z.ZodBoolean; // @public (undocumented) export const BannerPlugin: { new (args: string | ((args_0: { + filename: string; hash: string; chunk: JsChunk; - filename: string; }, ...args_1: unknown[]) => string) | { banner: string | ((args_0: { + filename: string; hash: string; chunk: JsChunk; - filename: string; }, ...args_1: unknown[]) => string); - test?: string | RegExp | (string | RegExp)[] | undefined; + entryOnly?: boolean | undefined; exclude?: string | RegExp | (string | RegExp)[] | undefined; include?: string | RegExp | (string | RegExp)[] | undefined; - entryOnly?: boolean | undefined; raw?: boolean | undefined; footer?: boolean | undefined; stage?: number | undefined; + test?: string | RegExp | (string | RegExp)[] | undefined; }): { name: BuiltinPluginName; _args: [args: string | ((args_0: { + filename: string; hash: string; chunk: JsChunk; - filename: string; }, ...args_1: unknown[]) => string) | { banner: string | ((args_0: { + filename: string; hash: string; chunk: JsChunk; - filename: string; }, ...args_1: unknown[]) => string); - test?: string | RegExp | (string | RegExp)[] | undefined; + entryOnly?: boolean | undefined; exclude?: string | RegExp | (string | RegExp)[] | undefined; include?: string | RegExp | (string | RegExp)[] | undefined; - entryOnly?: boolean | undefined; raw?: boolean | undefined; footer?: boolean | undefined; stage?: number | undefined; + test?: string | RegExp | (string | RegExp)[] | undefined; }]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -422,26 +424,26 @@ const bannerPluginArgument: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodFunction; filename: z.ZodString; }, "strip", z.ZodTypeAny, { + filename: string; hash: string; chunk: JsChunk; - filename: string; }, { + filename: string; hash: string; chunk: JsChunk; - filename: string; }>], z.ZodUnknown>, z.ZodString>]>, z.ZodObject<{ banner: z.ZodUnion<[z.ZodString, z.ZodFunction; filename: z.ZodString; }, "strip", z.ZodTypeAny, { + filename: string; hash: string; chunk: JsChunk; - filename: string; }, { + filename: string; hash: string; chunk: JsChunk; - filename: string; }>], z.ZodUnknown>, z.ZodString>]>; entryOnly: z.ZodOptional; exclude: z.ZodOptional]>, z.ZodArray]>, "many">]>>; @@ -452,32 +454,44 @@ const bannerPluginArgument: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodFunction]>, z.ZodArray]>, "many">]>>; }, "strict", z.ZodTypeAny, { banner: string | ((args_0: { + filename: string; hash: string; chunk: JsChunk; - filename: string; }, ...args_1: unknown[]) => string); - test?: string | RegExp | (string | RegExp)[] | undefined; + entryOnly?: boolean | undefined; exclude?: string | RegExp | (string | RegExp)[] | undefined; include?: string | RegExp | (string | RegExp)[] | undefined; - entryOnly?: boolean | undefined; raw?: boolean | undefined; footer?: boolean | undefined; stage?: number | undefined; + test?: string | RegExp | (string | RegExp)[] | undefined; }, { banner: string | ((args_0: { + filename: string; hash: string; chunk: JsChunk; - filename: string; }, ...args_1: unknown[]) => string); - test?: string | RegExp | (string | RegExp)[] | undefined; + entryOnly?: boolean | undefined; exclude?: string | RegExp | (string | RegExp)[] | undefined; include?: string | RegExp | (string | RegExp)[] | undefined; - entryOnly?: boolean | undefined; raw?: boolean | undefined; footer?: boolean | undefined; stage?: number | undefined; + test?: string | RegExp | (string | RegExp)[] | undefined; }>]>; +// @public (undocumented) +abstract class BaseCache { + // (undocumented) + abstract get(callback: CallbackCache): void; + // (undocumented) + abstract getPromise(): Promise; + // (undocumented) + abstract store(data: T, callback: CallbackCache): void; + // (undocumented) + abstract storePromise(data: T): Promise; +} + // @public (undocumented) interface BaseModuleConfig { // (undocumented) @@ -658,15 +672,17 @@ const baseRuleSetRule: z.ZodObject<{ sideEffects: z.ZodOptional; enforce: z.ZodOptional, z.ZodLiteral<"post">]>>; }, "strict", z.ZodTypeAny, { + options?: string | Record | undefined; type?: string | undefined; + exclude?: RuleSetCondition | undefined; + include?: RuleSetCondition | undefined; + test?: RuleSetCondition | undefined; layer?: string | undefined; + enforce?: "pre" | "post" | undefined; + sideEffects?: boolean | undefined; issuer?: RuleSetCondition | undefined; - options?: string | Record | undefined; resource?: RuleSetCondition | undefined; loader?: string | undefined; - test?: RuleSetCondition | undefined; - exclude?: RuleSetCondition | undefined; - include?: RuleSetCondition | undefined; issuerLayer?: RuleSetCondition | undefined; dependency?: RuleSetCondition | undefined; resourceFragment?: RuleSetCondition | undefined; @@ -691,18 +707,18 @@ const baseRuleSetRule: z.ZodObject<{ parser?: Record | undefined; generator?: Record | undefined; resolve?: ResolveOptions | undefined; - sideEffects?: boolean | undefined; - enforce?: "pre" | "post" | undefined; }, { + options?: string | Record | undefined; type?: string | undefined; + exclude?: RuleSetCondition | undefined; + include?: RuleSetCondition | undefined; + test?: RuleSetCondition | undefined; layer?: string | undefined; + enforce?: "pre" | "post" | undefined; + sideEffects?: boolean | undefined; issuer?: RuleSetCondition | undefined; - options?: string | Record | undefined; resource?: RuleSetCondition | undefined; loader?: string | undefined; - test?: RuleSetCondition | undefined; - exclude?: RuleSetCondition | undefined; - include?: RuleSetCondition | undefined; issuerLayer?: RuleSetCondition | undefined; dependency?: RuleSetCondition | undefined; resourceFragment?: RuleSetCondition | undefined; @@ -727,8 +743,6 @@ const baseRuleSetRule: z.ZodObject<{ parser?: Record | undefined; generator?: Record | undefined; resolve?: ResolveOptions | undefined; - sideEffects?: boolean | undefined; - enforce?: "pre" | "post" | undefined; }>; // @public (undocumented) @@ -737,6 +751,70 @@ export type BaseUri = z.infer; // @public (undocumented) const baseUri: z.ZodString; +// @public (undocumented) +class Cache_2 { + constructor(); + // (undocumented) + beginIdle(): void; + // (undocumented) + endIdle(callback: CallbackCache): void; + // (undocumented) + get(identifier: string, etag: Etag | null, callback: CallbackCache): void; + // (undocumented) + hooks: { + get: AsyncSeriesBailHook<[string, Etag | null, GotHandler[]], any>; + store: AsyncParallelHook<[string, Etag | null, any]>; + storeBuildDependencies: AsyncParallelHook<[Iterable]>; + beginIdle: SyncHook<[]>; + endIdle: AsyncParallelHook<[]>; + shutdown: AsyncParallelHook<[]>; + }; + // (undocumented) + shutdown(callback: CallbackCache): void; + // (undocumented) + static STAGE_DEFAULT: number; + // (undocumented) + static STAGE_DISK: number; + // (undocumented) + static STAGE_MEMORY: number; + // (undocumented) + static STAGE_NETWORK: number; + // (undocumented) + store(identifier: string, etag: Etag | null, data: T, callback: CallbackCache): void; + storeBuildDependencies(dependencies: Iterable, callback: CallbackCache): void; +} + +// @public (undocumented) +class CacheFacade { + constructor(cache: Cache_2, name: string, hashFunction: string | HashConstructor); + // (undocumented) + _cache: Cache_2; + // (undocumented) + get(identifier: string, etag: Etag | null, callback: CallbackCache): void; + // (undocumented) + getChildCache(name: string): CacheFacade; + // (undocumented) + getItemCache(identifier: string, etag: Etag | null): ItemCacheFacade; + // (undocumented) + getLazyHashedEtag(obj: HashableObject): Etag; + // (undocumented) + getPromise(identifier: string, etag: Etag | null): Promise; + // (undocumented) + _hashFunction: string | HashConstructor; + // (undocumented) + mergeEtags(a: Etag, b: Etag): Etag; + // (undocumented) + _name: string; + // (undocumented) + provide(identifier: string, etag: Etag | null, computer: (callback: CallbackNormalErrorCache) => void, callback: CallbackNormalErrorCache): void; + // (undocumented) + providePromise(identifier: string, etag: Etag | null, computer: () => Promise | T): Promise<{} | T | null>; + // (undocumented) + store(identifier: string, etag: Etag | null, data: T, callback: CallbackCache): void; + // (undocumented) + storePromise(identifier: string, etag: Etag | null, data: T): Promise; +} + // @public (undocumented) type CacheHookMap = Map[]>; @@ -746,6 +824,12 @@ export type CacheOptions = z.infer; // @public (undocumented) const cacheOptions: z.ZodBoolean; +// @public (undocumented) +type CallbackCache = (err?: WebpackError_2 | null, result?: T) => void; + +// @public (undocumented) +type CallbackNormalErrorCache = (err?: WebpackError_2 | null, result?: T) => void; + // @public (undocumented) type CallFn = (...args: any[]) => any; @@ -985,7 +1069,7 @@ export class Compilation { getAssetPathWithInfo(filename: Filename, data?: PathData): binding.PathWithInfo; getAssets(): ReadonlyArray; // (undocumented) - getCache(name: string): libCacheFacade; + getCache(name: string): CacheFacade_2; // (undocumented) getLogger(name: string | (() => string)): Logger; // (undocumented) @@ -1251,15 +1335,6 @@ export class Compiler { webpack: typeof rspack; } -// @public (undocumented) -type Compiler_3 = any; - -// @public (undocumented) -type Compiler_4 = Compiler_2; - -// @public (undocumented) -type Compiler_5 = any; - // @public (undocumented) type Config = { getNormalizedRspackOptions: typeof getNormalizedRspackOptions; @@ -1400,7 +1475,7 @@ class ContainerReferencePlugin extends RspackBuiltinPlugin { name: BuiltinPluginName; // (undocumented) _options: { - remoteType: "promise" | "module" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "global" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "system" | "script" | "node-commonjs"; + remoteType: "module" | "global" | "system" | "promise" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "script" | "node-commonjs"; remotes: [string, { external: string[]; shareScope: string; @@ -1464,7 +1539,7 @@ export const CopyRspackPlugin: { new (copy: CopyRspackPluginOptions): { name: BuiltinPluginName; _args: [copy: CopyRspackPluginOptions]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -1678,7 +1753,7 @@ export const DefinePlugin: { new (define: DefinePluginOptions): { name: BuiltinPluginName; _args: [define: DefinePluginOptions]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -1693,6 +1768,9 @@ export type Dependencies = z.infer; // @public (undocumented) const dependencies: z.ZodArray; +// @public (undocumented) +type DependencyLocation = any; + // @public (undocumented) export interface DevServer extends webpackDevServer.Configuration { } @@ -1792,7 +1870,7 @@ export const DynamicEntryPlugin: { new (context: string, entry: EntryDynamicNormalized): { name: BuiltinPluginName; _args: [context: string, entry: EntryDynamicNormalized]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -1812,7 +1890,7 @@ const ElectronTargetPlugin: { new (context?: string | undefined): { name: BuiltinPluginName; _args: [context?: string | undefined]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -1823,7 +1901,7 @@ const EnableChunkLoadingPlugin: { new (type: any): { name: BuiltinPluginName; _args: [type: any]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -1865,7 +1943,7 @@ const EnableWasmLoadingPlugin: { new (type: any): { name: BuiltinPluginName; _args: [type: any]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -1955,14 +2033,14 @@ const entry: z.ZodUnion<[z.ZodUnion<[z.ZodRecord>; }, "strict", z.ZodTypeAny, { import: string | string[]; - runtime?: string | false | undefined; - layer?: string | null | undefined; + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; baseUri?: string | undefined; chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: { type: string; name?: string | string[] | { @@ -1983,14 +2061,14 @@ const entry: z.ZodUnion<[z.ZodUnion<[z.ZodRecord string) | undefined; publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; baseUri?: string | undefined; chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: { type: string; name?: string | string[] | { @@ -2089,14 +2167,14 @@ const entry: z.ZodUnion<[z.ZodUnion<[z.ZodRecord>; }, "strict", z.ZodTypeAny, { import: string | string[]; - runtime?: string | false | undefined; - layer?: string | null | undefined; + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; baseUri?: string | undefined; chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: { type: string; name?: string | string[] | { @@ -2117,14 +2195,14 @@ const entry: z.ZodUnion<[z.ZodUnion<[z.ZodRecord string) | undefined; publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; baseUri?: string | undefined; chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: { type: string; name?: string | string[] | { @@ -2223,14 +2301,14 @@ const entry: z.ZodUnion<[z.ZodUnion<[z.ZodRecord>; }, "strict", z.ZodTypeAny, { import: string | string[]; - runtime?: string | false | undefined; - layer?: string | null | undefined; + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; baseUri?: string | undefined; chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: { type: string; name?: string | string[] | { @@ -2251,14 +2329,14 @@ const entry: z.ZodUnion<[z.ZodUnion<[z.ZodRecord string) | undefined; publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; baseUri?: string | undefined; chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: { type: string; name?: string | string[] | { @@ -2375,14 +2453,14 @@ const entryDescription: z.ZodObject<{ layer: z.ZodOptional>; }, "strict", z.ZodTypeAny, { import: string | string[]; - runtime?: string | false | undefined; - layer?: string | null | undefined; + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; baseUri?: string | undefined; chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: { type: string; name?: string | string[] | { @@ -2403,14 +2481,14 @@ const entryDescription: z.ZodObject<{ dependOn?: string | string[] | undefined; }, { import: string | string[]; - runtime?: string | false | undefined; - layer?: string | null | undefined; + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; baseUri?: string | undefined; chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: { type: string; name?: string | string[] | { @@ -2557,14 +2635,14 @@ const entryObject: z.ZodRecord>; }, "strict", z.ZodTypeAny, { import: string | string[]; - runtime?: string | false | undefined; - layer?: string | null | undefined; + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; baseUri?: string | undefined; chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: { type: string; name?: string | string[] | { @@ -2585,14 +2663,14 @@ const entryObject: z.ZodRecord string) | undefined; publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; baseUri?: string | undefined; chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: { type: string; name?: string | string[] | { @@ -2642,7 +2720,7 @@ export const EntryPlugin: { new (context: string, entry: string, options?: string | EntryOptions | undefined): { name: BuiltinPluginName; _args: [context: string, entry: string, options?: string | EntryOptions | undefined]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -2747,14 +2825,14 @@ const entryStatic: z.ZodUnion<[z.ZodRecord>; }, "strict", z.ZodTypeAny, { import: string | string[]; - runtime?: string | false | undefined; - layer?: string | null | undefined; + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; baseUri?: string | undefined; chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: { type: string; name?: string | string[] | { @@ -2775,14 +2853,14 @@ const entryStatic: z.ZodUnion<[z.ZodRecord string) | undefined; publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; baseUri?: string | undefined; chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: { type: string; name?: string | string[] | { @@ -2866,14 +2944,14 @@ const environment: z.ZodObject<{ templateLiteral?: boolean | undefined; }>; -// @public +// @public (undocumented) export class EnvironmentPlugin { - constructor(...keys: any[]); - apply(compiler: Compiler_3): void; + constructor(...keys: string[] | [Record | string]); + apply(compiler: Compiler): void; // (undocumented) - defaultValues: any; + defaultValues: Record; // (undocumented) - keys: any[]; + keys: string[]; } // @public (undocumented) @@ -2887,12 +2965,18 @@ interface Es6Config extends BaseModuleConfig { type: "es6"; } +// @public (undocumented) +interface Etag { + // (undocumented) + toString(): string; +} + // @public (undocumented) export const EvalDevToolModulePlugin: { new (options: EvalDevToolModulePluginOptions): { name: BuiltinPluginName; _args: [options: EvalDevToolModulePluginOptions]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -2905,7 +2989,7 @@ export const EvalSourceMapDevToolPlugin: { new (options: SourceMapDevToolPluginOptions): { name: BuiltinPluginName; _args: [options: SourceMapDevToolPluginOptions]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -3287,7 +3371,7 @@ export const ExternalsPlugin: { contextInfo?: { issuer: string; } | undefined; - }, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record | undefined, args_2: "promise" | "module" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "global" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "system" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: { + }, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record | undefined, args_2: "module" | "global" | "system" | "promise" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: { context?: string | undefined; dependencyType?: string | undefined; request?: string | undefined; @@ -3301,7 +3385,7 @@ export const ExternalsPlugin: { contextInfo?: { issuer: string; } | undefined; - }, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record | undefined, args_2: "promise" | "module" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "global" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "system" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: { + }, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record | undefined, args_2: "module" | "global" | "system" | "promise" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: { context?: string | undefined; dependencyType?: string | undefined; request?: string | undefined; @@ -3317,7 +3401,7 @@ export const ExternalsPlugin: { contextInfo?: { issuer: string; } | undefined; - }, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record | undefined, args_2: "promise" | "module" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "global" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "system" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: { + }, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record | undefined, args_2: "module" | "global" | "system" | "promise" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: { context?: string | undefined; dependencyType?: string | undefined; request?: string | undefined; @@ -3331,7 +3415,7 @@ export const ExternalsPlugin: { contextInfo?: { issuer: string; } | undefined; - }, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record | undefined, args_2: "promise" | "module" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "global" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "system" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: { + }, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record | undefined, args_2: "module" | "global" | "system" | "promise" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: { context?: string | undefined; dependencyType?: string | undefined; request?: string | undefined; @@ -3339,7 +3423,7 @@ export const ExternalsPlugin: { issuer: string; } | undefined; }, ...args_1: unknown[]) => Promise>))[]]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -3410,7 +3494,7 @@ const FetchCompileAsyncWasmPlugin: { new (): { name: BuiltinPluginName; _args: []; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -3486,8 +3570,9 @@ const generatorOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ filename: z.ZodOptional, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>>; publicPath: z.ZodOptional, z.ZodUnion<[z.ZodString, z.ZodFunction, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>]>>; }>, "strict", z.ZodTypeAny, { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; dataUrl?: { mimetype?: string | undefined; encoding?: false | "base64" | undefined; @@ -3495,10 +3580,10 @@ const generatorOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ filename: string; content: string; }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; }, { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; dataUrl?: { mimetype?: string | undefined; encoding?: false | "base64" | undefined; @@ -3506,7 +3591,6 @@ const generatorOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ filename: string; content: string; }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; }>>; "asset/inline": z.ZodOptional, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>>; publicPath: z.ZodOptional, z.ZodUnion<[z.ZodString, z.ZodFunction, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>]>>; }, "strict", z.ZodTypeAny, { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; }, { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; }>>; css: z.ZodOptional string) | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - dataUrl?: { - mimetype?: string | undefined; - encoding?: false | "base64" | undefined; - } | ((args_0: { - filename: string; - content: string; - }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; - } | undefined; "css/auto"?: { exportsOnly?: boolean | undefined; esModule?: boolean | undefined; @@ -3629,6 +3701,18 @@ const generatorOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined; localIdentName?: string | undefined; } | undefined; + asset?: { + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; + dataUrl?: { + mimetype?: string | undefined; + encoding?: false | "base64" | undefined; + } | ((args_0: { + filename: string; + content: string; + }, ...args_1: unknown[]) => string) | undefined; + } | undefined; "asset/inline"?: { dataUrl?: { mimetype?: string | undefined; @@ -3639,8 +3723,8 @@ const generatorOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ }, ...args_1: unknown[]) => string) | undefined; } | undefined; "asset/resource"?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; } | undefined; }, { @@ -3648,18 +3732,6 @@ const generatorOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ exportsOnly?: boolean | undefined; esModule?: boolean | undefined; } | undefined; - asset?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - dataUrl?: { - mimetype?: string | undefined; - encoding?: false | "base64" | undefined; - } | ((args_0: { - filename: string; - content: string; - }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; - } | undefined; "css/auto"?: { exportsOnly?: boolean | undefined; esModule?: boolean | undefined; @@ -3672,18 +3744,30 @@ const generatorOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined; localIdentName?: string | undefined; } | undefined; - "asset/inline"?: { - dataUrl?: { - mimetype?: string | undefined; - encoding?: false | "base64" | undefined; + asset?: { + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; + dataUrl?: { + mimetype?: string | undefined; + encoding?: false | "base64" | undefined; + } | ((args_0: { + filename: string; + content: string; + }, ...args_1: unknown[]) => string) | undefined; + } | undefined; + "asset/inline"?: { + dataUrl?: { + mimetype?: string | undefined; + encoding?: false | "base64" | undefined; } | ((args_0: { filename: string; content: string; }, ...args_1: unknown[]) => string) | undefined; } | undefined; "asset/resource"?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; } | undefined; }>, z.ZodRecord>]>; @@ -3718,8 +3802,9 @@ const generatorOptionsByModuleTypeKnown: z.ZodObject<{ filename: z.ZodOptional, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>>; publicPath: z.ZodOptional, z.ZodUnion<[z.ZodString, z.ZodFunction, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>]>>; }>, "strict", z.ZodTypeAny, { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; dataUrl?: { mimetype?: string | undefined; encoding?: false | "base64" | undefined; @@ -3727,10 +3812,10 @@ const generatorOptionsByModuleTypeKnown: z.ZodObject<{ filename: string; content: string; }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; }, { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; dataUrl?: { mimetype?: string | undefined; encoding?: false | "base64" | undefined; @@ -3738,7 +3823,6 @@ const generatorOptionsByModuleTypeKnown: z.ZodObject<{ filename: string; content: string; }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; }>>; "asset/inline": z.ZodOptional, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>>; publicPath: z.ZodOptional, z.ZodUnion<[z.ZodString, z.ZodFunction, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>]>>; }, "strict", z.ZodTypeAny, { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; }, { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; }>>; css: z.ZodOptional string) | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - dataUrl?: { - mimetype?: string | undefined; - encoding?: false | "base64" | undefined; - } | ((args_0: { - filename: string; - content: string; - }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; - } | undefined; "css/auto"?: { exportsOnly?: boolean | undefined; esModule?: boolean | undefined; @@ -3861,6 +3933,18 @@ const generatorOptionsByModuleTypeKnown: z.ZodObject<{ exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined; localIdentName?: string | undefined; } | undefined; + asset?: { + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; + dataUrl?: { + mimetype?: string | undefined; + encoding?: false | "base64" | undefined; + } | ((args_0: { + filename: string; + content: string; + }, ...args_1: unknown[]) => string) | undefined; + } | undefined; "asset/inline"?: { dataUrl?: { mimetype?: string | undefined; @@ -3871,8 +3955,8 @@ const generatorOptionsByModuleTypeKnown: z.ZodObject<{ }, ...args_1: unknown[]) => string) | undefined; } | undefined; "asset/resource"?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; } | undefined; }, { @@ -3880,18 +3964,6 @@ const generatorOptionsByModuleTypeKnown: z.ZodObject<{ exportsOnly?: boolean | undefined; esModule?: boolean | undefined; } | undefined; - asset?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - dataUrl?: { - mimetype?: string | undefined; - encoding?: false | "base64" | undefined; - } | ((args_0: { - filename: string; - content: string; - }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; - } | undefined; "css/auto"?: { exportsOnly?: boolean | undefined; esModule?: boolean | undefined; @@ -3904,6 +3976,18 @@ const generatorOptionsByModuleTypeKnown: z.ZodObject<{ exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined; localIdentName?: string | undefined; } | undefined; + asset?: { + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; + dataUrl?: { + mimetype?: string | undefined; + encoding?: false | "base64" | undefined; + } | ((args_0: { + filename: string; + content: string; + }, ...args_1: unknown[]) => string) | undefined; + } | undefined; "asset/inline"?: { dataUrl?: { mimetype?: string | undefined; @@ -3914,8 +3998,8 @@ const generatorOptionsByModuleTypeKnown: z.ZodObject<{ }, ...args_1: unknown[]) => string) | undefined; } | undefined; "asset/resource"?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; } | undefined; }>; @@ -3957,6 +4041,9 @@ interface GlobalPassOption { vars?: Record; } +// @public (undocumented) +type GotHandler = (result: any | null, callback: (error: Error) => void) => void; + // @public (undocumented) type GroupConfig = { getKeys: (arg0: any) => string[] | undefined; @@ -3986,6 +4073,15 @@ class Hash_2 { update(data: string | Buffer, inputEncoding?: string): this; } +// @public (undocumented) +interface HashableObject { + // (undocumented) + updateHash(hash: Hash_2): void; +} + +// @public (undocumented) +type HashConstructor = typeof Hash_2; + // @public (undocumented) export type HashDigest = z.infer; @@ -4060,9 +4156,9 @@ const hotUpdateMainFilename: z.ZodString; // @public (undocumented) export const HtmlRspackPlugin: { new (c?: { - chunks?: string[] | undefined; - publicPath?: string | undefined; filename?: string | undefined; + publicPath?: string | undefined; + chunks?: string[] | undefined; template?: string | undefined; templateContent?: string | undefined; templateParameters?: Record | undefined; @@ -4077,9 +4173,9 @@ export const HtmlRspackPlugin: { } | undefined): { name: BuiltinPluginName; _args: [c?: { - chunks?: string[] | undefined; - publicPath?: string | undefined; filename?: string | undefined; + publicPath?: string | undefined; + chunks?: string[] | undefined; template?: string | undefined; templateContent?: string | undefined; templateParameters?: Record | undefined; @@ -4092,7 +4188,7 @@ export const HtmlRspackPlugin: { favicon?: string | undefined; meta?: Record> | undefined; } | undefined]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -4118,9 +4214,9 @@ const htmlRspackPluginOptions: z.ZodObject<{ favicon: z.ZodOptional; meta: z.ZodOptional]>>>; }, "strict", z.ZodTypeAny, { - chunks?: string[] | undefined; - publicPath?: string | undefined; filename?: string | undefined; + publicPath?: string | undefined; + chunks?: string[] | undefined; template?: string | undefined; templateContent?: string | undefined; templateParameters?: Record | undefined; @@ -4133,9 +4229,9 @@ const htmlRspackPluginOptions: z.ZodObject<{ favicon?: string | undefined; meta?: Record> | undefined; }, { - chunks?: string[] | undefined; - publicPath?: string | undefined; filename?: string | undefined; + publicPath?: string | undefined; + chunks?: string[] | undefined; template?: string | undefined; templateContent?: string | undefined; templateParameters?: Record | undefined; @@ -4174,7 +4270,7 @@ export const IgnorePlugin: { new (options: IgnorePluginOptions): { name: BuiltinPluginName; _args: [options: IgnorePluginOptions]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -4221,18 +4317,18 @@ const infrastructureLogging: z.ZodObject<{ level: z.ZodOptional>; stream: z.ZodOptional>; }, "strict", z.ZodTypeAny, { - colors?: boolean | undefined; debug?: string | boolean | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined; + colors?: boolean | undefined; appendOnly?: boolean | undefined; console?: Console | undefined; - level?: "info" | "none" | "verbose" | "error" | "warn" | "log" | undefined; + level?: "log" | "info" | "verbose" | "none" | "error" | "warn" | undefined; stream?: NodeJS.WritableStream | undefined; }, { - colors?: boolean | undefined; debug?: string | boolean | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined; + colors?: boolean | undefined; appendOnly?: boolean | undefined; console?: Console | undefined; - level?: "info" | "none" | "verbose" | "error" | "warn" | "log" | undefined; + level?: "log" | "info" | "verbose" | "none" | "error" | "warn" | undefined; stream?: NodeJS.WritableStream | undefined; }>; @@ -4290,6 +4386,29 @@ interface IStats { uid: number | bigint; } +// @public (undocumented) +class ItemCacheFacade implements BaseCache { + constructor(cache: Cache_2, name: string, etag: Etag | null); + // (undocumented) + _cache: Cache_2; + // (undocumented) + _etag: Etag | null; + // (undocumented) + get(callback: CallbackCache): void; + // (undocumented) + getPromise(): Promise; + // (undocumented) + _name: string; + // (undocumented) + provide(computer: (callback: CallbackNormalErrorCache) => void, callback: CallbackNormalErrorCache): void; + // (undocumented) + providePromise(computer: () => Promise | T): Promise; + // (undocumented) + store(data: T, callback: CallbackCache): void; + // (undocumented) + storePromise(data: T): Promise; +} + // @public (undocumented) interface JavaScript { // (undocumented) @@ -4878,7 +4997,7 @@ export const LightningCssMinimizerRspackPlugin: { new (options?: LightningCssMinimizerRspackPluginOptions | undefined): { name: BuiltinPluginName; _args: [options?: LightningCssMinimizerRspackPluginOptions | undefined]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -4903,7 +5022,7 @@ const LimitChunkCountPlugin: { new (options: LimitChunkCountOptions): { name: BuiltinPluginName; _args: [options: LimitChunkCountOptions]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -5065,23 +5184,23 @@ class LoaderObject { type?: "module" | "commonjs"; } -// @public +// @public (undocumented) export class LoaderOptionsPlugin { constructor(options?: LoaderOptionsPluginOptions); - apply(compiler: Compiler_4): void; + apply(compiler: Compiler): void; // (undocumented) - options: any; + options: MatchObject; } // @public (undocumented) type LoaderOptionsPluginOptions = any; -// @public +// @public (undocumented) export class LoaderTargetPlugin { - constructor(target: string); - apply(compiler: Compiler_5): void; + constructor(target: Target); + apply(compiler: Compiler): void; // (undocumented) - target: string; + readonly target: Target; } // @public (undocumented) @@ -5178,7 +5297,7 @@ type LogTypeEnum = (typeof LogType)[keyof typeof LogType]; // @public (undocumented) type MapOptions = { columns?: boolean; module?: boolean }; -// @public (undocumented) +// @public type Matcher = string | RegExp | (string | RegExp)[]; // @public (undocumented) @@ -5302,6 +5421,7 @@ declare namespace ModuleFilenameHelpers { export { asRegExp, matchPart, + MatchObject, matchObject } } @@ -5526,20 +5646,6 @@ const moduleOptions: z.ZodObject<{ overrideStrict?: "strict" | "non-strict" | undefined; }>>; }, "strict", z.ZodTypeAny, { - css?: { - namedExports?: boolean | undefined; - } | undefined; - asset?: { - dataUrlCondition?: { - maxSize?: number | undefined; - } | undefined; - } | undefined; - "css/auto"?: { - namedExports?: boolean | undefined; - } | undefined; - "css/module"?: { - namedExports?: boolean | undefined; - } | undefined; javascript?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -5555,6 +5661,20 @@ const moduleOptions: z.ZodObject<{ worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; } | undefined; + css?: { + namedExports?: boolean | undefined; + } | undefined; + "css/auto"?: { + namedExports?: boolean | undefined; + } | undefined; + "css/module"?: { + namedExports?: boolean | undefined; + } | undefined; + asset?: { + dataUrlCondition?: { + maxSize?: number | undefined; + } | undefined; + } | undefined; "javascript/auto"?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -5601,20 +5721,6 @@ const moduleOptions: z.ZodObject<{ overrideStrict?: "strict" | "non-strict" | undefined; } | undefined; }, { - css?: { - namedExports?: boolean | undefined; - } | undefined; - asset?: { - dataUrlCondition?: { - maxSize?: number | undefined; - } | undefined; - } | undefined; - "css/auto"?: { - namedExports?: boolean | undefined; - } | undefined; - "css/module"?: { - namedExports?: boolean | undefined; - } | undefined; javascript?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -5630,6 +5736,20 @@ const moduleOptions: z.ZodObject<{ worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; } | undefined; + css?: { + namedExports?: boolean | undefined; + } | undefined; + "css/auto"?: { + namedExports?: boolean | undefined; + } | undefined; + "css/module"?: { + namedExports?: boolean | undefined; + } | undefined; + asset?: { + dataUrlCondition?: { + maxSize?: number | undefined; + } | undefined; + } | undefined; "javascript/auto"?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -5702,8 +5822,9 @@ const moduleOptions: z.ZodObject<{ filename: z.ZodOptional, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>>; publicPath: z.ZodOptional, z.ZodUnion<[z.ZodString, z.ZodFunction, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>]>>; }>, "strict", z.ZodTypeAny, { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; dataUrl?: { mimetype?: string | undefined; encoding?: false | "base64" | undefined; @@ -5711,10 +5832,10 @@ const moduleOptions: z.ZodObject<{ filename: string; content: string; }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; }, { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; dataUrl?: { mimetype?: string | undefined; encoding?: false | "base64" | undefined; @@ -5722,7 +5843,6 @@ const moduleOptions: z.ZodObject<{ filename: string; content: string; }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; }>>; "asset/inline": z.ZodOptional, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>>; publicPath: z.ZodOptional, z.ZodUnion<[z.ZodString, z.ZodFunction, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>]>>; }, "strict", z.ZodTypeAny, { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; }, { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; }>>; css: z.ZodOptional string) | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - dataUrl?: { - mimetype?: string | undefined; - encoding?: false | "base64" | undefined; - } | ((args_0: { - filename: string; - content: string; - }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; - } | undefined; "css/auto"?: { exportsOnly?: boolean | undefined; esModule?: boolean | undefined; @@ -5845,6 +5953,18 @@ const moduleOptions: z.ZodObject<{ exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined; localIdentName?: string | undefined; } | undefined; + asset?: { + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; + dataUrl?: { + mimetype?: string | undefined; + encoding?: false | "base64" | undefined; + } | ((args_0: { + filename: string; + content: string; + }, ...args_1: unknown[]) => string) | undefined; + } | undefined; "asset/inline"?: { dataUrl?: { mimetype?: string | undefined; @@ -5855,8 +5975,8 @@ const moduleOptions: z.ZodObject<{ }, ...args_1: unknown[]) => string) | undefined; } | undefined; "asset/resource"?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; } | undefined; }, { @@ -5864,18 +5984,6 @@ const moduleOptions: z.ZodObject<{ exportsOnly?: boolean | undefined; esModule?: boolean | undefined; } | undefined; - asset?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - dataUrl?: { - mimetype?: string | undefined; - encoding?: false | "base64" | undefined; - } | ((args_0: { - filename: string; - content: string; - }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; - } | undefined; "css/auto"?: { exportsOnly?: boolean | undefined; esModule?: boolean | undefined; @@ -5888,6 +5996,18 @@ const moduleOptions: z.ZodObject<{ exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined; localIdentName?: string | undefined; } | undefined; + asset?: { + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; + dataUrl?: { + mimetype?: string | undefined; + encoding?: false | "base64" | undefined; + } | ((args_0: { + filename: string; + content: string; + }, ...args_1: unknown[]) => string) | undefined; + } | undefined; "asset/inline"?: { dataUrl?: { mimetype?: string | undefined; @@ -5898,28 +6018,14 @@ const moduleOptions: z.ZodObject<{ }, ...args_1: unknown[]) => string) | undefined; } | undefined; "asset/resource"?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; } | undefined; }>, z.ZodRecord>]>>; noParse: z.ZodOptional]>, z.ZodFunction, z.ZodBoolean>]>, z.ZodArray]>, z.ZodFunction, z.ZodBoolean>]>, "many">]>>; }, "strict", z.ZodTypeAny, { parser?: { - css?: { - namedExports?: boolean | undefined; - } | undefined; - asset?: { - dataUrlCondition?: { - maxSize?: number | undefined; - } | undefined; - } | undefined; - "css/auto"?: { - namedExports?: boolean | undefined; - } | undefined; - "css/module"?: { - namedExports?: boolean | undefined; - } | undefined; javascript?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -5935,6 +6041,20 @@ const moduleOptions: z.ZodObject<{ worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; } | undefined; + css?: { + namedExports?: boolean | undefined; + } | undefined; + "css/auto"?: { + namedExports?: boolean | undefined; + } | undefined; + "css/module"?: { + namedExports?: boolean | undefined; + } | undefined; + asset?: { + dataUrlCondition?: { + maxSize?: number | undefined; + } | undefined; + } | undefined; "javascript/auto"?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -5986,18 +6106,6 @@ const moduleOptions: z.ZodObject<{ exportsOnly?: boolean | undefined; esModule?: boolean | undefined; } | undefined; - asset?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - dataUrl?: { - mimetype?: string | undefined; - encoding?: false | "base64" | undefined; - } | ((args_0: { - filename: string; - content: string; - }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; - } | undefined; "css/auto"?: { exportsOnly?: boolean | undefined; esModule?: boolean | undefined; @@ -6010,6 +6118,18 @@ const moduleOptions: z.ZodObject<{ exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined; localIdentName?: string | undefined; } | undefined; + asset?: { + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; + dataUrl?: { + mimetype?: string | undefined; + encoding?: false | "base64" | undefined; + } | ((args_0: { + filename: string; + content: string; + }, ...args_1: unknown[]) => string) | undefined; + } | undefined; "asset/inline"?: { dataUrl?: { mimetype?: string | undefined; @@ -6020,30 +6140,16 @@ const moduleOptions: z.ZodObject<{ }, ...args_1: unknown[]) => string) | undefined; } | undefined; "asset/resource"?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; } | undefined; } | undefined; - rules?: (false | "" | 0 | RuleSetRule | "..." | null | undefined)[] | undefined; - defaultRules?: (false | "" | 0 | RuleSetRule | "..." | null | undefined)[] | undefined; + rules?: (false | "" | 0 | "..." | RuleSetRule | null | undefined)[] | undefined; + defaultRules?: (false | "" | 0 | "..." | RuleSetRule | null | undefined)[] | undefined; noParse?: string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined; }, { parser?: { - css?: { - namedExports?: boolean | undefined; - } | undefined; - asset?: { - dataUrlCondition?: { - maxSize?: number | undefined; - } | undefined; - } | undefined; - "css/auto"?: { - namedExports?: boolean | undefined; - } | undefined; - "css/module"?: { - namedExports?: boolean | undefined; - } | undefined; javascript?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -6059,6 +6165,20 @@ const moduleOptions: z.ZodObject<{ worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; } | undefined; + css?: { + namedExports?: boolean | undefined; + } | undefined; + "css/auto"?: { + namedExports?: boolean | undefined; + } | undefined; + "css/module"?: { + namedExports?: boolean | undefined; + } | undefined; + asset?: { + dataUrlCondition?: { + maxSize?: number | undefined; + } | undefined; + } | undefined; "javascript/auto"?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -6110,18 +6230,6 @@ const moduleOptions: z.ZodObject<{ exportsOnly?: boolean | undefined; esModule?: boolean | undefined; } | undefined; - asset?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - dataUrl?: { - mimetype?: string | undefined; - encoding?: false | "base64" | undefined; - } | ((args_0: { - filename: string; - content: string; - }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; - } | undefined; "css/auto"?: { exportsOnly?: boolean | undefined; esModule?: boolean | undefined; @@ -6134,6 +6242,18 @@ const moduleOptions: z.ZodObject<{ exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined; localIdentName?: string | undefined; } | undefined; + asset?: { + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; + dataUrl?: { + mimetype?: string | undefined; + encoding?: false | "base64" | undefined; + } | ((args_0: { + filename: string; + content: string; + }, ...args_1: unknown[]) => string) | undefined; + } | undefined; "asset/inline"?: { dataUrl?: { mimetype?: string | undefined; @@ -6144,13 +6264,13 @@ const moduleOptions: z.ZodObject<{ }, ...args_1: unknown[]) => string) | undefined; } | undefined; "asset/resource"?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; } | undefined; } | undefined; - rules?: (false | "" | 0 | RuleSetRule | "..." | null | undefined)[] | undefined; - defaultRules?: (false | "" | 0 | RuleSetRule | "..." | null | undefined)[] | undefined; + rules?: (false | "" | 0 | "..." | RuleSetRule | null | undefined)[] | undefined; + defaultRules?: (false | "" | 0 | "..." | RuleSetRule | null | undefined)[] | undefined; noParse?: string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined; }>; @@ -6347,7 +6467,7 @@ const NodeTargetPlugin: { new (): { name: BuiltinPluginName; _args: []; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -6418,7 +6538,6 @@ export class NormalModuleFactory { // @public (undocumented) export class NormalModuleReplacementPlugin { constructor(resourceRegExp: RegExp, newResource: string | ModuleReplacer); - // (undocumented) apply(compiler: Compiler): void; // (undocumented) readonly newResource: string | ModuleReplacer; @@ -6464,36 +6583,36 @@ const optimization: z.ZodObject<{ type: z.ZodOptional]>>; idHint: z.ZodOptional; }, "strict", z.ZodTypeAny, { - type?: string | RegExp | undefined; - name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; filename?: string | undefined; + name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; + type?: string | RegExp | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - maxSize?: number | Record | undefined; priority?: number | undefined; + enforce?: boolean | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; }, { - type?: string | RegExp | undefined; - name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; filename?: string | undefined; + name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; + type?: string | RegExp | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - maxSize?: number | Record | undefined; priority?: number | undefined; + enforce?: boolean | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; @@ -6508,16 +6627,16 @@ const optimization: z.ZodObject<{ maxInitialSize: z.ZodOptional; automaticNameDelimiter: z.ZodOptional; }, "strict", z.ZodTypeAny, { - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; minSize?: number | undefined; + maxSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; }, { - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; minSize?: number | undefined; + maxSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; @@ -6525,28 +6644,28 @@ const optimization: z.ZodObject<{ hidePathInfo: z.ZodOptional; }, "strict", z.ZodTypeAny, { name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | Record | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; cacheGroups?: Record unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; filename?: string | undefined; + name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; + type?: string | RegExp | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - maxSize?: number | Record | undefined; priority?: number | undefined; + enforce?: boolean | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; @@ -6554,9 +6673,9 @@ const optimization: z.ZodObject<{ maxAsyncRequests?: number | undefined; maxInitialRequests?: number | undefined; fallbackCacheGroup?: { - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; minSize?: number | undefined; + maxSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; @@ -6564,28 +6683,28 @@ const optimization: z.ZodObject<{ hidePathInfo?: boolean | undefined; }, { name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | Record | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; cacheGroups?: Record unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; filename?: string | undefined; + name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; + type?: string | RegExp | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - maxSize?: number | Record | undefined; priority?: number | undefined; + enforce?: boolean | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; @@ -6593,9 +6712,9 @@ const optimization: z.ZodObject<{ maxAsyncRequests?: number | undefined; maxInitialRequests?: number | undefined; fallbackCacheGroup?: { - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; minSize?: number | undefined; + maxSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; @@ -6630,38 +6749,35 @@ const optimization: z.ZodObject<{ mangleExports: z.ZodOptional, z.ZodBoolean]>>; nodeEnv: z.ZodOptional]>>; }, "strict", z.ZodTypeAny, { - usedExports?: boolean | "global" | undefined; - providedExports?: boolean | undefined; - sideEffects?: boolean | "flag" | undefined; moduleIds?: "named" | "natural" | "deterministic" | undefined; chunkIds?: "named" | "natural" | "deterministic" | undefined; minimize?: boolean | undefined; - minimizer?: (false | "" | 0 | "..." | RspackPluginInstance | RspackPluginFunction | null | undefined)[] | undefined; + minimizer?: (false | "" | 0 | RspackPluginInstance | "..." | RspackPluginFunction | null | undefined)[] | undefined; mergeDuplicateChunks?: boolean | undefined; splitChunks?: false | { name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | Record | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; cacheGroups?: Record unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; filename?: string | undefined; + name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; + type?: string | RegExp | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - maxSize?: number | Record | undefined; priority?: number | undefined; + enforce?: boolean | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; @@ -6669,9 +6785,9 @@ const optimization: z.ZodObject<{ maxAsyncRequests?: number | undefined; maxInitialRequests?: number | undefined; fallbackCacheGroup?: { - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; minSize?: number | undefined; + maxSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; @@ -6686,43 +6802,43 @@ const optimization: z.ZodObject<{ removeAvailableModules?: boolean | undefined; removeEmptyChunks?: boolean | undefined; realContentHash?: boolean | undefined; + sideEffects?: boolean | "flag" | undefined; + providedExports?: boolean | undefined; concatenateModules?: boolean | undefined; innerGraph?: boolean | undefined; - mangleExports?: boolean | "size" | "deterministic" | undefined; + usedExports?: boolean | "global" | undefined; + mangleExports?: boolean | "deterministic" | "size" | undefined; nodeEnv?: string | false | undefined; }, { - usedExports?: boolean | "global" | undefined; - providedExports?: boolean | undefined; - sideEffects?: boolean | "flag" | undefined; moduleIds?: "named" | "natural" | "deterministic" | undefined; chunkIds?: "named" | "natural" | "deterministic" | undefined; minimize?: boolean | undefined; - minimizer?: (false | "" | 0 | "..." | RspackPluginInstance | RspackPluginFunction | null | undefined)[] | undefined; + minimizer?: (false | "" | 0 | RspackPluginInstance | "..." | RspackPluginFunction | null | undefined)[] | undefined; mergeDuplicateChunks?: boolean | undefined; splitChunks?: false | { name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | Record | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; cacheGroups?: Record unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; filename?: string | undefined; + name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; + type?: string | RegExp | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - maxSize?: number | Record | undefined; priority?: number | undefined; + enforce?: boolean | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; @@ -6730,9 +6846,9 @@ const optimization: z.ZodObject<{ maxAsyncRequests?: number | undefined; maxInitialRequests?: number | undefined; fallbackCacheGroup?: { - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; minSize?: number | undefined; + maxSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; @@ -6747,9 +6863,12 @@ const optimization: z.ZodObject<{ removeAvailableModules?: boolean | undefined; removeEmptyChunks?: boolean | undefined; realContentHash?: boolean | undefined; + sideEffects?: boolean | "flag" | undefined; + providedExports?: boolean | undefined; concatenateModules?: boolean | undefined; innerGraph?: boolean | undefined; - mangleExports?: boolean | "size" | "deterministic" | undefined; + usedExports?: boolean | "global" | undefined; + mangleExports?: boolean | "deterministic" | "size" | undefined; nodeEnv?: string | false | undefined; }>; @@ -6804,36 +6923,36 @@ const optimizationSplitChunksCacheGroup: z.ZodObject<{ type: z.ZodOptional]>>; idHint: z.ZodOptional; }, "strict", z.ZodTypeAny, { - type?: string | RegExp | undefined; - name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; filename?: string | undefined; + name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; + type?: string | RegExp | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - maxSize?: number | Record | undefined; priority?: number | undefined; + enforce?: boolean | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; }, { - type?: string | RegExp | undefined; - name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; filename?: string | undefined; + name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; + type?: string | RegExp | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - maxSize?: number | Record | undefined; priority?: number | undefined; + enforce?: boolean | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; @@ -6877,36 +6996,36 @@ const optimizationSplitChunksOptions: z.ZodObject<{ type: z.ZodOptional]>>; idHint: z.ZodOptional; }, "strict", z.ZodTypeAny, { - type?: string | RegExp | undefined; - name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; filename?: string | undefined; + name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; + type?: string | RegExp | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - maxSize?: number | Record | undefined; priority?: number | undefined; + enforce?: boolean | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; }, { - type?: string | RegExp | undefined; - name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; filename?: string | undefined; + name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; + type?: string | RegExp | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - maxSize?: number | Record | undefined; priority?: number | undefined; + enforce?: boolean | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; @@ -6921,16 +7040,16 @@ const optimizationSplitChunksOptions: z.ZodObject<{ maxInitialSize: z.ZodOptional; automaticNameDelimiter: z.ZodOptional; }, "strict", z.ZodTypeAny, { - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; minSize?: number | undefined; + maxSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; }, { - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; minSize?: number | undefined; + maxSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; @@ -6938,28 +7057,28 @@ const optimizationSplitChunksOptions: z.ZodObject<{ hidePathInfo: z.ZodOptional; }, "strict", z.ZodTypeAny, { name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | Record | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; cacheGroups?: Record unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; filename?: string | undefined; + name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; + type?: string | RegExp | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - maxSize?: number | Record | undefined; priority?: number | undefined; + enforce?: boolean | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; @@ -6967,9 +7086,9 @@ const optimizationSplitChunksOptions: z.ZodObject<{ maxAsyncRequests?: number | undefined; maxInitialRequests?: number | undefined; fallbackCacheGroup?: { - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; minSize?: number | undefined; + maxSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; @@ -6977,28 +7096,28 @@ const optimizationSplitChunksOptions: z.ZodObject<{ hidePathInfo?: boolean | undefined; }, { name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | Record | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; cacheGroups?: Record unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; filename?: string | undefined; + name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; + type?: string | RegExp | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - maxSize?: number | Record | undefined; priority?: number | undefined; + enforce?: boolean | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; @@ -7006,9 +7125,9 @@ const optimizationSplitChunksOptions: z.ZodObject<{ maxAsyncRequests?: number | undefined; maxInitialRequests?: number | undefined; fallbackCacheGroup?: { - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; minSize?: number | undefined; + maxSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; @@ -7238,21 +7357,38 @@ const output: z.ZodObject<{ templateLiteral?: boolean | undefined; }>>; }, "strict", z.ZodTypeAny, { - path?: string | undefined; - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; module?: boolean | undefined; - auxiliaryComment?: string | { - commonjs?: string | undefined; - amd?: string | undefined; - root?: string | undefined; - commonjs2?: string | undefined; - } | undefined; - umdNamedDefine?: boolean | undefined; - chunkLoading?: string | false | undefined; - asyncChunks?: boolean | undefined; - wasmLoading?: string | false | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - library?: string | string[] | { + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + environment?: { + module?: boolean | undefined; + arrowFunction?: boolean | undefined; + asyncFunction?: boolean | undefined; + bigIntLiteral?: boolean | undefined; + const?: boolean | undefined; + destructuring?: boolean | undefined; + document?: boolean | undefined; + dynamicImport?: boolean | undefined; + dynamicImportInWorker?: boolean | undefined; + forOf?: boolean | undefined; + globalThis?: boolean | undefined; + nodePrefixForCoreModules?: boolean | undefined; + optionalChaining?: boolean | undefined; + templateLiteral?: boolean | undefined; + } | undefined; + path?: string | undefined; + chunkFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + auxiliaryComment?: string | { + commonjs?: string | undefined; + amd?: string | undefined; + root?: string | undefined; + commonjs2?: string | undefined; + } | undefined; + umdNamedDefine?: boolean | undefined; + chunkLoading?: string | false | undefined; + asyncChunks?: boolean | undefined; + wasmLoading?: string | false | undefined; + library?: string | string[] | { commonjs?: string | undefined; amd?: string | undefined; root?: string | string[] | undefined; @@ -7275,7 +7411,6 @@ const output: z.ZodObject<{ } | undefined; pathinfo?: boolean | "verbose" | undefined; clean?: boolean | undefined; - chunkFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; crossOriginLoading?: false | "anonymous" | "use-credentials" | undefined; cssFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; cssChunkFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; @@ -7303,7 +7438,7 @@ const output: z.ZodObject<{ sourceMapFilename?: string | undefined; hashDigest?: string | undefined; hashDigestLength?: number | undefined; - hashFunction?: "md4" | "xxhash64" | undefined; + hashFunction?: "xxhash64" | "md4" | undefined; hashSalt?: string | undefined; workerChunkLoading?: string | false | undefined; workerWasmLoading?: string | false | undefined; @@ -7314,6 +7449,10 @@ const output: z.ZodObject<{ devtoolFallbackModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined; chunkLoadTimeout?: number | undefined; charset?: boolean | undefined; +}, { + module?: boolean | undefined; + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; environment?: { module?: boolean | undefined; arrowFunction?: boolean | undefined; @@ -7330,10 +7469,8 @@ const output: z.ZodObject<{ optionalChaining?: boolean | undefined; templateLiteral?: boolean | undefined; } | undefined; -}, { path?: string | undefined; - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - module?: boolean | undefined; + chunkFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; auxiliaryComment?: string | { commonjs?: string | undefined; amd?: string | undefined; @@ -7344,7 +7481,6 @@ const output: z.ZodObject<{ chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: string | string[] | { commonjs?: string | undefined; amd?: string | undefined; @@ -7368,7 +7504,6 @@ const output: z.ZodObject<{ } | undefined; pathinfo?: boolean | "verbose" | undefined; clean?: boolean | undefined; - chunkFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; crossOriginLoading?: false | "anonymous" | "use-credentials" | undefined; cssFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; cssChunkFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; @@ -7396,7 +7531,7 @@ const output: z.ZodObject<{ sourceMapFilename?: string | undefined; hashDigest?: string | undefined; hashDigestLength?: number | undefined; - hashFunction?: "md4" | "xxhash64" | undefined; + hashFunction?: "xxhash64" | "md4" | undefined; hashSalt?: string | undefined; workerChunkLoading?: string | false | undefined; workerWasmLoading?: string | false | undefined; @@ -7407,22 +7542,6 @@ const output: z.ZodObject<{ devtoolFallbackModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined; chunkLoadTimeout?: number | undefined; charset?: boolean | undefined; - environment?: { - module?: boolean | undefined; - arrowFunction?: boolean | undefined; - asyncFunction?: boolean | undefined; - bigIntLiteral?: boolean | undefined; - const?: boolean | undefined; - destructuring?: boolean | undefined; - document?: boolean | undefined; - dynamicImport?: boolean | undefined; - dynamicImportInWorker?: boolean | undefined; - forOf?: boolean | undefined; - globalThis?: boolean | undefined; - nodePrefixForCoreModules?: boolean | undefined; - optionalChaining?: boolean | undefined; - templateLiteral?: boolean | undefined; - } | undefined; }>; // @public (undocumented) @@ -7785,20 +7904,6 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ overrideStrict?: "strict" | "non-strict" | undefined; }>>; }, "strict", z.ZodTypeAny, { - css?: { - namedExports?: boolean | undefined; - } | undefined; - asset?: { - dataUrlCondition?: { - maxSize?: number | undefined; - } | undefined; - } | undefined; - "css/auto"?: { - namedExports?: boolean | undefined; - } | undefined; - "css/module"?: { - namedExports?: boolean | undefined; - } | undefined; javascript?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -7814,6 +7919,20 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; } | undefined; + css?: { + namedExports?: boolean | undefined; + } | undefined; + "css/auto"?: { + namedExports?: boolean | undefined; + } | undefined; + "css/module"?: { + namedExports?: boolean | undefined; + } | undefined; + asset?: { + dataUrlCondition?: { + maxSize?: number | undefined; + } | undefined; + } | undefined; "javascript/auto"?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -7860,20 +7979,6 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ overrideStrict?: "strict" | "non-strict" | undefined; } | undefined; }, { - css?: { - namedExports?: boolean | undefined; - } | undefined; - asset?: { - dataUrlCondition?: { - maxSize?: number | undefined; - } | undefined; - } | undefined; - "css/auto"?: { - namedExports?: boolean | undefined; - } | undefined; - "css/module"?: { - namedExports?: boolean | undefined; - } | undefined; javascript?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -7889,6 +7994,20 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; } | undefined; + css?: { + namedExports?: boolean | undefined; + } | undefined; + "css/auto"?: { + namedExports?: boolean | undefined; + } | undefined; + "css/module"?: { + namedExports?: boolean | undefined; + } | undefined; + asset?: { + dataUrlCondition?: { + maxSize?: number | undefined; + } | undefined; + } | undefined; "javascript/auto"?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -8152,20 +8271,6 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ overrideStrict?: "strict" | "non-strict" | undefined; }>>; }, "strict", z.ZodTypeAny, { - css?: { - namedExports?: boolean | undefined; - } | undefined; - asset?: { - dataUrlCondition?: { - maxSize?: number | undefined; - } | undefined; - } | undefined; - "css/auto"?: { - namedExports?: boolean | undefined; - } | undefined; - "css/module"?: { - namedExports?: boolean | undefined; - } | undefined; javascript?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -8181,6 +8286,20 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; } | undefined; + css?: { + namedExports?: boolean | undefined; + } | undefined; + "css/auto"?: { + namedExports?: boolean | undefined; + } | undefined; + "css/module"?: { + namedExports?: boolean | undefined; + } | undefined; + asset?: { + dataUrlCondition?: { + maxSize?: number | undefined; + } | undefined; + } | undefined; "javascript/auto"?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -8227,20 +8346,6 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ overrideStrict?: "strict" | "non-strict" | undefined; } | undefined; }, { - css?: { - namedExports?: boolean | undefined; - } | undefined; - asset?: { - dataUrlCondition?: { - maxSize?: number | undefined; - } | undefined; - } | undefined; - "css/auto"?: { - namedExports?: boolean | undefined; - } | undefined; - "css/module"?: { - namedExports?: boolean | undefined; - } | undefined; javascript?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -8256,6 +8361,20 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; } | undefined; + css?: { + namedExports?: boolean | undefined; + } | undefined; + "css/auto"?: { + namedExports?: boolean | undefined; + } | undefined; + "css/module"?: { + namedExports?: boolean | undefined; + } | undefined; + asset?: { + dataUrlCondition?: { + maxSize?: number | undefined; + } | undefined; + } | undefined; "javascript/auto"?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -8392,7 +8511,7 @@ export const ProgressPlugin: { new (progress?: ProgressPluginArgument): { name: BuiltinPluginName; _args: [progress?: ProgressPluginArgument]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -8406,7 +8525,7 @@ export const ProvidePlugin: { new (provide: ProvidePluginOptions): { name: BuiltinPluginName; _args: [provide: ProvidePluginOptions]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -9093,14 +9212,14 @@ export const rspackOptions: z.ZodObject<{ layer: z.ZodOptional>; }, "strict", z.ZodTypeAny, { import: string | string[]; - runtime?: string | false | undefined; - layer?: string | null | undefined; + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; baseUri?: string | undefined; chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: { type: string; name?: string | string[] | { @@ -9121,14 +9240,14 @@ export const rspackOptions: z.ZodObject<{ dependOn?: string | string[] | undefined; }, { import: string | string[]; - runtime?: string | false | undefined; - layer?: string | null | undefined; + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; baseUri?: string | undefined; chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: { type: string; name?: string | string[] | { @@ -9227,14 +9346,14 @@ export const rspackOptions: z.ZodObject<{ layer: z.ZodOptional>; }, "strict", z.ZodTypeAny, { import: string | string[]; - runtime?: string | false | undefined; - layer?: string | null | undefined; + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; baseUri?: string | undefined; chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: { type: string; name?: string | string[] | { @@ -9255,14 +9374,14 @@ export const rspackOptions: z.ZodObject<{ dependOn?: string | string[] | undefined; }, { import: string | string[]; - runtime?: string | false | undefined; - layer?: string | null | undefined; + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; baseUri?: string | undefined; chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: { type: string; name?: string | string[] | { @@ -9361,14 +9480,14 @@ export const rspackOptions: z.ZodObject<{ layer: z.ZodOptional>; }, "strict", z.ZodTypeAny, { import: string | string[]; - runtime?: string | false | undefined; - layer?: string | null | undefined; + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; baseUri?: string | undefined; chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: { type: string; name?: string | string[] | { @@ -9389,14 +9508,14 @@ export const rspackOptions: z.ZodObject<{ dependOn?: string | string[] | undefined; }, { import: string | string[]; - runtime?: string | false | undefined; - layer?: string | null | undefined; + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; baseUri?: string | undefined; chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: { type: string; name?: string | string[] | { @@ -9612,9 +9731,27 @@ export const rspackOptions: z.ZodObject<{ templateLiteral?: boolean | undefined; }>>; }, "strict", z.ZodTypeAny, { - path?: string | undefined; - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; module?: boolean | undefined; + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + environment?: { + module?: boolean | undefined; + arrowFunction?: boolean | undefined; + asyncFunction?: boolean | undefined; + bigIntLiteral?: boolean | undefined; + const?: boolean | undefined; + destructuring?: boolean | undefined; + document?: boolean | undefined; + dynamicImport?: boolean | undefined; + dynamicImportInWorker?: boolean | undefined; + forOf?: boolean | undefined; + globalThis?: boolean | undefined; + nodePrefixForCoreModules?: boolean | undefined; + optionalChaining?: boolean | undefined; + templateLiteral?: boolean | undefined; + } | undefined; + path?: string | undefined; + chunkFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; auxiliaryComment?: string | { commonjs?: string | undefined; amd?: string | undefined; @@ -9625,7 +9762,6 @@ export const rspackOptions: z.ZodObject<{ chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: string | string[] | { commonjs?: string | undefined; amd?: string | undefined; @@ -9649,7 +9785,6 @@ export const rspackOptions: z.ZodObject<{ } | undefined; pathinfo?: boolean | "verbose" | undefined; clean?: boolean | undefined; - chunkFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; crossOriginLoading?: false | "anonymous" | "use-credentials" | undefined; cssFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; cssChunkFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; @@ -9677,7 +9812,7 @@ export const rspackOptions: z.ZodObject<{ sourceMapFilename?: string | undefined; hashDigest?: string | undefined; hashDigestLength?: number | undefined; - hashFunction?: "md4" | "xxhash64" | undefined; + hashFunction?: "xxhash64" | "md4" | undefined; hashSalt?: string | undefined; workerChunkLoading?: string | false | undefined; workerWasmLoading?: string | false | undefined; @@ -9688,6 +9823,10 @@ export const rspackOptions: z.ZodObject<{ devtoolFallbackModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined; chunkLoadTimeout?: number | undefined; charset?: boolean | undefined; + }, { + module?: boolean | undefined; + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; environment?: { module?: boolean | undefined; arrowFunction?: boolean | undefined; @@ -9704,10 +9843,8 @@ export const rspackOptions: z.ZodObject<{ optionalChaining?: boolean | undefined; templateLiteral?: boolean | undefined; } | undefined; - }, { path?: string | undefined; - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - module?: boolean | undefined; + chunkFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; auxiliaryComment?: string | { commonjs?: string | undefined; amd?: string | undefined; @@ -9718,7 +9855,6 @@ export const rspackOptions: z.ZodObject<{ chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: string | string[] | { commonjs?: string | undefined; amd?: string | undefined; @@ -9742,7 +9878,6 @@ export const rspackOptions: z.ZodObject<{ } | undefined; pathinfo?: boolean | "verbose" | undefined; clean?: boolean | undefined; - chunkFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; crossOriginLoading?: false | "anonymous" | "use-credentials" | undefined; cssFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; cssChunkFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; @@ -9770,7 +9905,7 @@ export const rspackOptions: z.ZodObject<{ sourceMapFilename?: string | undefined; hashDigest?: string | undefined; hashDigestLength?: number | undefined; - hashFunction?: "md4" | "xxhash64" | undefined; + hashFunction?: "xxhash64" | "md4" | undefined; hashSalt?: string | undefined; workerChunkLoading?: string | false | undefined; workerWasmLoading?: string | false | undefined; @@ -9781,22 +9916,6 @@ export const rspackOptions: z.ZodObject<{ devtoolFallbackModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined; chunkLoadTimeout?: number | undefined; charset?: boolean | undefined; - environment?: { - module?: boolean | undefined; - arrowFunction?: boolean | undefined; - asyncFunction?: boolean | undefined; - bigIntLiteral?: boolean | undefined; - const?: boolean | undefined; - destructuring?: boolean | undefined; - document?: boolean | undefined; - dynamicImport?: boolean | undefined; - dynamicImportInWorker?: boolean | undefined; - forOf?: boolean | undefined; - globalThis?: boolean | undefined; - nodePrefixForCoreModules?: boolean | undefined; - optionalChaining?: boolean | undefined; - templateLiteral?: boolean | undefined; - } | undefined; }>>; target: z.ZodOptional, z.ZodUnion<[z.ZodEnum<["web", "webworker", "es3", "es5", "es2015", "es2016", "es2017", "es2018", "es2019", "es2020", "es2021", "es2022", "browserslist"]>, z.ZodLiteral<"node">, z.ZodLiteral<"async-node">, z.ZodType<`node${number}`, z.ZodTypeDef, `node${number}`>, z.ZodType<`async-node${number}`, z.ZodTypeDef, `async-node${number}`>, z.ZodType<`node${number}.${number}`, z.ZodTypeDef, `node${number}.${number}`>, z.ZodType<`async-node${number}.${number}`, z.ZodTypeDef, `async-node${number}.${number}`>, z.ZodLiteral<"electron-main">, z.ZodType<`electron${number}-main`, z.ZodTypeDef, `electron${number}-main`>, z.ZodType<`electron${number}.${number}-main`, z.ZodTypeDef, `electron${number}.${number}-main`>, z.ZodLiteral<"electron-renderer">, z.ZodType<`electron${number}-renderer`, z.ZodTypeDef, `electron${number}-renderer`>, z.ZodType<`electron${number}.${number}-renderer`, z.ZodTypeDef, `electron${number}.${number}-renderer`>, z.ZodLiteral<"electron-preload">, z.ZodType<`electron${number}-preload`, z.ZodTypeDef, `electron${number}-preload`>, z.ZodType<`electron${number}.${number}-preload`, z.ZodTypeDef, `electron${number}.${number}-preload`>, z.ZodLiteral<"nwjs">, z.ZodType<`nwjs${number}`, z.ZodTypeDef, `nwjs${number}`>, z.ZodType<`nwjs${number}.${number}`, z.ZodTypeDef, `nwjs${number}.${number}`>, z.ZodLiteral<"node-webkit">, z.ZodType<`node-webkit${number}`, z.ZodTypeDef, `node-webkit${number}`>, z.ZodType<`node-webkit${number}.${number}`, z.ZodTypeDef, `node-webkit${number}.${number}`>]>, z.ZodArray, z.ZodLiteral<"node">, z.ZodLiteral<"async-node">, z.ZodType<`node${number}`, z.ZodTypeDef, `node${number}`>, z.ZodType<`async-node${number}`, z.ZodTypeDef, `async-node${number}`>, z.ZodType<`node${number}.${number}`, z.ZodTypeDef, `node${number}.${number}`>, z.ZodType<`async-node${number}.${number}`, z.ZodTypeDef, `async-node${number}.${number}`>, z.ZodLiteral<"electron-main">, z.ZodType<`electron${number}-main`, z.ZodTypeDef, `electron${number}-main`>, z.ZodType<`electron${number}.${number}-main`, z.ZodTypeDef, `electron${number}.${number}-main`>, z.ZodLiteral<"electron-renderer">, z.ZodType<`electron${number}-renderer`, z.ZodTypeDef, `electron${number}-renderer`>, z.ZodType<`electron${number}.${number}-renderer`, z.ZodTypeDef, `electron${number}.${number}-renderer`>, z.ZodLiteral<"electron-preload">, z.ZodType<`electron${number}-preload`, z.ZodTypeDef, `electron${number}-preload`>, z.ZodType<`electron${number}.${number}-preload`, z.ZodTypeDef, `electron${number}.${number}-preload`>, z.ZodLiteral<"nwjs">, z.ZodType<`nwjs${number}`, z.ZodTypeDef, `nwjs${number}`>, z.ZodType<`nwjs${number}.${number}`, z.ZodTypeDef, `nwjs${number}.${number}`>, z.ZodLiteral<"node-webkit">, z.ZodType<`node-webkit${number}`, z.ZodTypeDef, `node-webkit${number}`>, z.ZodType<`node-webkit${number}.${number}`, z.ZodTypeDef, `node-webkit${number}.${number}`>]>, "many">]>>; mode: z.ZodOptional>; @@ -10024,18 +10143,18 @@ export const rspackOptions: z.ZodObject<{ level: z.ZodOptional>; stream: z.ZodOptional>; }, "strict", z.ZodTypeAny, { - colors?: boolean | undefined; debug?: string | boolean | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined; + colors?: boolean | undefined; appendOnly?: boolean | undefined; console?: Console | undefined; - level?: "info" | "none" | "verbose" | "error" | "warn" | "log" | undefined; + level?: "log" | "info" | "verbose" | "none" | "error" | "warn" | undefined; stream?: NodeJS.WritableStream | undefined; }, { - colors?: boolean | undefined; debug?: string | boolean | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined; + colors?: boolean | undefined; appendOnly?: boolean | undefined; console?: Console | undefined; - level?: "info" | "none" | "verbose" | "error" | "warn" | "log" | undefined; + level?: "log" | "info" | "verbose" | "none" | "error" | "warn" | undefined; stream?: NodeJS.WritableStream | undefined; }>>; cache: z.ZodOptional; @@ -10149,13 +10268,15 @@ export const rspackOptions: z.ZodObject<{ errorStack: z.ZodOptional; moduleTrace: z.ZodOptional; }, "strict", z.ZodTypeAny, { + publicPath?: boolean | undefined; hash?: boolean | undefined; + all?: boolean | undefined; + chunks?: boolean | undefined; + providedExports?: boolean | undefined; + usedExports?: boolean | undefined; children?: boolean | undefined; runtime?: boolean | undefined; modules?: boolean | undefined; - chunks?: boolean | undefined; - usedExports?: boolean | undefined; - providedExports?: boolean | undefined; optimizationBailout?: boolean | undefined; depth?: boolean | undefined; assets?: boolean | undefined; @@ -10163,15 +10284,13 @@ export const rspackOptions: z.ZodObject<{ errors?: boolean | undefined; warnings?: boolean | undefined; reasons?: boolean | undefined; - all?: boolean | undefined; - preset?: boolean | "normal" | "none" | "verbose" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; + preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; entrypoints?: boolean | "auto" | undefined; chunkGroups?: boolean | undefined; warningsCount?: boolean | undefined; errorsCount?: boolean | undefined; colors?: boolean | undefined; version?: boolean | undefined; - publicPath?: boolean | undefined; outputPath?: boolean | undefined; chunkModules?: boolean | undefined; chunkRelations?: boolean | undefined; @@ -10180,7 +10299,7 @@ export const rspackOptions: z.ZodObject<{ builtAt?: boolean | undefined; moduleAssets?: boolean | undefined; nestedModules?: boolean | undefined; - logging?: boolean | "info" | "none" | "verbose" | "error" | "warn" | "log" | undefined; + logging?: boolean | "log" | "info" | "verbose" | "none" | "error" | "warn" | undefined; loggingDebug?: string | boolean | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined; loggingTrace?: boolean | undefined; runtimeModules?: boolean | undefined; @@ -10221,13 +10340,15 @@ export const rspackOptions: z.ZodObject<{ errorStack?: boolean | undefined; moduleTrace?: boolean | undefined; }, { + publicPath?: boolean | undefined; hash?: boolean | undefined; + all?: boolean | undefined; + chunks?: boolean | undefined; + providedExports?: boolean | undefined; + usedExports?: boolean | undefined; children?: boolean | undefined; runtime?: boolean | undefined; modules?: boolean | undefined; - chunks?: boolean | undefined; - usedExports?: boolean | undefined; - providedExports?: boolean | undefined; optimizationBailout?: boolean | undefined; depth?: boolean | undefined; assets?: boolean | undefined; @@ -10235,15 +10356,13 @@ export const rspackOptions: z.ZodObject<{ errors?: boolean | undefined; warnings?: boolean | undefined; reasons?: boolean | undefined; - all?: boolean | undefined; - preset?: boolean | "normal" | "none" | "verbose" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; + preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; entrypoints?: boolean | "auto" | undefined; chunkGroups?: boolean | undefined; warningsCount?: boolean | undefined; errorsCount?: boolean | undefined; colors?: boolean | undefined; version?: boolean | undefined; - publicPath?: boolean | undefined; outputPath?: boolean | undefined; chunkModules?: boolean | undefined; chunkRelations?: boolean | undefined; @@ -10252,7 +10371,7 @@ export const rspackOptions: z.ZodObject<{ builtAt?: boolean | undefined; moduleAssets?: boolean | undefined; nestedModules?: boolean | undefined; - logging?: boolean | "info" | "none" | "verbose" | "error" | "warn" | "log" | undefined; + logging?: boolean | "log" | "info" | "verbose" | "none" | "error" | "warn" | undefined; loggingDebug?: string | boolean | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined; loggingTrace?: boolean | undefined; runtimeModules?: boolean | undefined; @@ -10328,36 +10447,36 @@ export const rspackOptions: z.ZodObject<{ type: z.ZodOptional]>>; idHint: z.ZodOptional; }, "strict", z.ZodTypeAny, { - type?: string | RegExp | undefined; - name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; filename?: string | undefined; + name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; + type?: string | RegExp | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - maxSize?: number | Record | undefined; priority?: number | undefined; + enforce?: boolean | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; }, { - type?: string | RegExp | undefined; - name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; filename?: string | undefined; + name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; + type?: string | RegExp | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - maxSize?: number | Record | undefined; priority?: number | undefined; + enforce?: boolean | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; @@ -10372,16 +10491,16 @@ export const rspackOptions: z.ZodObject<{ maxInitialSize: z.ZodOptional; automaticNameDelimiter: z.ZodOptional; }, "strict", z.ZodTypeAny, { - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; minSize?: number | undefined; + maxSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; }, { - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; minSize?: number | undefined; + maxSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; @@ -10389,28 +10508,28 @@ export const rspackOptions: z.ZodObject<{ hidePathInfo: z.ZodOptional; }, "strict", z.ZodTypeAny, { name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | Record | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; cacheGroups?: Record unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; filename?: string | undefined; + name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; + type?: string | RegExp | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - maxSize?: number | Record | undefined; priority?: number | undefined; + enforce?: boolean | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; @@ -10418,9 +10537,9 @@ export const rspackOptions: z.ZodObject<{ maxAsyncRequests?: number | undefined; maxInitialRequests?: number | undefined; fallbackCacheGroup?: { - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; minSize?: number | undefined; + maxSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; @@ -10428,28 +10547,28 @@ export const rspackOptions: z.ZodObject<{ hidePathInfo?: boolean | undefined; }, { name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | Record | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; cacheGroups?: Record unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; filename?: string | undefined; + name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; + type?: string | RegExp | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - maxSize?: number | Record | undefined; priority?: number | undefined; + enforce?: boolean | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; @@ -10457,9 +10576,9 @@ export const rspackOptions: z.ZodObject<{ maxAsyncRequests?: number | undefined; maxInitialRequests?: number | undefined; fallbackCacheGroup?: { - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; minSize?: number | undefined; + maxSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; @@ -10494,38 +10613,35 @@ export const rspackOptions: z.ZodObject<{ mangleExports: z.ZodOptional, z.ZodBoolean]>>; nodeEnv: z.ZodOptional]>>; }, "strict", z.ZodTypeAny, { - usedExports?: boolean | "global" | undefined; - providedExports?: boolean | undefined; - sideEffects?: boolean | "flag" | undefined; moduleIds?: "named" | "natural" | "deterministic" | undefined; chunkIds?: "named" | "natural" | "deterministic" | undefined; minimize?: boolean | undefined; - minimizer?: (false | "" | 0 | "..." | RspackPluginInstance | RspackPluginFunction | null | undefined)[] | undefined; + minimizer?: (false | "" | 0 | RspackPluginInstance | "..." | RspackPluginFunction | null | undefined)[] | undefined; mergeDuplicateChunks?: boolean | undefined; splitChunks?: false | { name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | Record | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; cacheGroups?: Record unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; filename?: string | undefined; + name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; + type?: string | RegExp | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - maxSize?: number | Record | undefined; priority?: number | undefined; + enforce?: boolean | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; @@ -10533,9 +10649,9 @@ export const rspackOptions: z.ZodObject<{ maxAsyncRequests?: number | undefined; maxInitialRequests?: number | undefined; fallbackCacheGroup?: { - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; minSize?: number | undefined; + maxSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; @@ -10550,43 +10666,43 @@ export const rspackOptions: z.ZodObject<{ removeAvailableModules?: boolean | undefined; removeEmptyChunks?: boolean | undefined; realContentHash?: boolean | undefined; + sideEffects?: boolean | "flag" | undefined; + providedExports?: boolean | undefined; concatenateModules?: boolean | undefined; innerGraph?: boolean | undefined; - mangleExports?: boolean | "size" | "deterministic" | undefined; + usedExports?: boolean | "global" | undefined; + mangleExports?: boolean | "deterministic" | "size" | undefined; nodeEnv?: string | false | undefined; }, { - usedExports?: boolean | "global" | undefined; - providedExports?: boolean | undefined; - sideEffects?: boolean | "flag" | undefined; moduleIds?: "named" | "natural" | "deterministic" | undefined; chunkIds?: "named" | "natural" | "deterministic" | undefined; minimize?: boolean | undefined; - minimizer?: (false | "" | 0 | "..." | RspackPluginInstance | RspackPluginFunction | null | undefined)[] | undefined; + minimizer?: (false | "" | 0 | RspackPluginInstance | "..." | RspackPluginFunction | null | undefined)[] | undefined; mergeDuplicateChunks?: boolean | undefined; splitChunks?: false | { name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | Record | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; cacheGroups?: Record unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; filename?: string | undefined; + name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; + type?: string | RegExp | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - maxSize?: number | Record | undefined; priority?: number | undefined; + enforce?: boolean | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; @@ -10594,9 +10710,9 @@ export const rspackOptions: z.ZodObject<{ maxAsyncRequests?: number | undefined; maxInitialRequests?: number | undefined; fallbackCacheGroup?: { - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; minSize?: number | undefined; + maxSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; @@ -10611,9 +10727,12 @@ export const rspackOptions: z.ZodObject<{ removeAvailableModules?: boolean | undefined; removeEmptyChunks?: boolean | undefined; realContentHash?: boolean | undefined; + sideEffects?: boolean | "flag" | undefined; + providedExports?: boolean | undefined; concatenateModules?: boolean | undefined; innerGraph?: boolean | undefined; - mangleExports?: boolean | "size" | "deterministic" | undefined; + usedExports?: boolean | "global" | undefined; + mangleExports?: boolean | "deterministic" | "size" | undefined; nodeEnv?: string | false | undefined; }>>; resolve: z.ZodOptional>; @@ -10835,20 +10954,6 @@ export const rspackOptions: z.ZodObject<{ overrideStrict?: "strict" | "non-strict" | undefined; }>>; }, "strict", z.ZodTypeAny, { - css?: { - namedExports?: boolean | undefined; - } | undefined; - asset?: { - dataUrlCondition?: { - maxSize?: number | undefined; - } | undefined; - } | undefined; - "css/auto"?: { - namedExports?: boolean | undefined; - } | undefined; - "css/module"?: { - namedExports?: boolean | undefined; - } | undefined; javascript?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -10864,6 +10969,20 @@ export const rspackOptions: z.ZodObject<{ worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; } | undefined; + css?: { + namedExports?: boolean | undefined; + } | undefined; + "css/auto"?: { + namedExports?: boolean | undefined; + } | undefined; + "css/module"?: { + namedExports?: boolean | undefined; + } | undefined; + asset?: { + dataUrlCondition?: { + maxSize?: number | undefined; + } | undefined; + } | undefined; "javascript/auto"?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -10910,20 +11029,6 @@ export const rspackOptions: z.ZodObject<{ overrideStrict?: "strict" | "non-strict" | undefined; } | undefined; }, { - css?: { - namedExports?: boolean | undefined; - } | undefined; - asset?: { - dataUrlCondition?: { - maxSize?: number | undefined; - } | undefined; - } | undefined; - "css/auto"?: { - namedExports?: boolean | undefined; - } | undefined; - "css/module"?: { - namedExports?: boolean | undefined; - } | undefined; javascript?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -10939,6 +11044,20 @@ export const rspackOptions: z.ZodObject<{ worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; } | undefined; + css?: { + namedExports?: boolean | undefined; + } | undefined; + "css/auto"?: { + namedExports?: boolean | undefined; + } | undefined; + "css/module"?: { + namedExports?: boolean | undefined; + } | undefined; + asset?: { + dataUrlCondition?: { + maxSize?: number | undefined; + } | undefined; + } | undefined; "javascript/auto"?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -11011,8 +11130,9 @@ export const rspackOptions: z.ZodObject<{ filename: z.ZodOptional, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>>; publicPath: z.ZodOptional, z.ZodUnion<[z.ZodString, z.ZodFunction, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>]>>; }>, "strict", z.ZodTypeAny, { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; dataUrl?: { mimetype?: string | undefined; encoding?: false | "base64" | undefined; @@ -11020,10 +11140,10 @@ export const rspackOptions: z.ZodObject<{ filename: string; content: string; }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; }, { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; dataUrl?: { mimetype?: string | undefined; encoding?: false | "base64" | undefined; @@ -11031,7 +11151,6 @@ export const rspackOptions: z.ZodObject<{ filename: string; content: string; }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; }>>; "asset/inline": z.ZodOptional, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>>; publicPath: z.ZodOptional, z.ZodUnion<[z.ZodString, z.ZodFunction, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>]>>; }, "strict", z.ZodTypeAny, { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; }, { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; }>>; css: z.ZodOptional string) | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - dataUrl?: { - mimetype?: string | undefined; - encoding?: false | "base64" | undefined; - } | ((args_0: { - filename: string; - content: string; - }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; - } | undefined; "css/auto"?: { exportsOnly?: boolean | undefined; esModule?: boolean | undefined; @@ -11154,6 +11261,18 @@ export const rspackOptions: z.ZodObject<{ exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined; localIdentName?: string | undefined; } | undefined; + asset?: { + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; + dataUrl?: { + mimetype?: string | undefined; + encoding?: false | "base64" | undefined; + } | ((args_0: { + filename: string; + content: string; + }, ...args_1: unknown[]) => string) | undefined; + } | undefined; "asset/inline"?: { dataUrl?: { mimetype?: string | undefined; @@ -11164,8 +11283,8 @@ export const rspackOptions: z.ZodObject<{ }, ...args_1: unknown[]) => string) | undefined; } | undefined; "asset/resource"?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; } | undefined; }, { @@ -11173,18 +11292,6 @@ export const rspackOptions: z.ZodObject<{ exportsOnly?: boolean | undefined; esModule?: boolean | undefined; } | undefined; - asset?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - dataUrl?: { - mimetype?: string | undefined; - encoding?: false | "base64" | undefined; - } | ((args_0: { - filename: string; - content: string; - }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; - } | undefined; "css/auto"?: { exportsOnly?: boolean | undefined; esModule?: boolean | undefined; @@ -11197,6 +11304,18 @@ export const rspackOptions: z.ZodObject<{ exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined; localIdentName?: string | undefined; } | undefined; + asset?: { + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; + dataUrl?: { + mimetype?: string | undefined; + encoding?: false | "base64" | undefined; + } | ((args_0: { + filename: string; + content: string; + }, ...args_1: unknown[]) => string) | undefined; + } | undefined; "asset/inline"?: { dataUrl?: { mimetype?: string | undefined; @@ -11207,28 +11326,14 @@ export const rspackOptions: z.ZodObject<{ }, ...args_1: unknown[]) => string) | undefined; } | undefined; "asset/resource"?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; } | undefined; }>, z.ZodRecord>]>>; noParse: z.ZodOptional]>, z.ZodFunction, z.ZodBoolean>]>, z.ZodArray]>, z.ZodFunction, z.ZodBoolean>]>, "many">]>>; }, "strict", z.ZodTypeAny, { parser?: { - css?: { - namedExports?: boolean | undefined; - } | undefined; - asset?: { - dataUrlCondition?: { - maxSize?: number | undefined; - } | undefined; - } | undefined; - "css/auto"?: { - namedExports?: boolean | undefined; - } | undefined; - "css/module"?: { - namedExports?: boolean | undefined; - } | undefined; javascript?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -11244,6 +11349,20 @@ export const rspackOptions: z.ZodObject<{ worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; } | undefined; + css?: { + namedExports?: boolean | undefined; + } | undefined; + "css/auto"?: { + namedExports?: boolean | undefined; + } | undefined; + "css/module"?: { + namedExports?: boolean | undefined; + } | undefined; + asset?: { + dataUrlCondition?: { + maxSize?: number | undefined; + } | undefined; + } | undefined; "javascript/auto"?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -11295,18 +11414,6 @@ export const rspackOptions: z.ZodObject<{ exportsOnly?: boolean | undefined; esModule?: boolean | undefined; } | undefined; - asset?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - dataUrl?: { - mimetype?: string | undefined; - encoding?: false | "base64" | undefined; - } | ((args_0: { - filename: string; - content: string; - }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; - } | undefined; "css/auto"?: { exportsOnly?: boolean | undefined; esModule?: boolean | undefined; @@ -11319,6 +11426,18 @@ export const rspackOptions: z.ZodObject<{ exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined; localIdentName?: string | undefined; } | undefined; + asset?: { + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; + dataUrl?: { + mimetype?: string | undefined; + encoding?: false | "base64" | undefined; + } | ((args_0: { + filename: string; + content: string; + }, ...args_1: unknown[]) => string) | undefined; + } | undefined; "asset/inline"?: { dataUrl?: { mimetype?: string | undefined; @@ -11329,30 +11448,16 @@ export const rspackOptions: z.ZodObject<{ }, ...args_1: unknown[]) => string) | undefined; } | undefined; "asset/resource"?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; } | undefined; } | undefined; - rules?: (false | "" | 0 | RuleSetRule | "..." | null | undefined)[] | undefined; - defaultRules?: (false | "" | 0 | RuleSetRule | "..." | null | undefined)[] | undefined; + rules?: (false | "" | 0 | "..." | RuleSetRule | null | undefined)[] | undefined; + defaultRules?: (false | "" | 0 | "..." | RuleSetRule | null | undefined)[] | undefined; noParse?: string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined; }, { parser?: { - css?: { - namedExports?: boolean | undefined; - } | undefined; - asset?: { - dataUrlCondition?: { - maxSize?: number | undefined; - } | undefined; - } | undefined; - "css/auto"?: { - namedExports?: boolean | undefined; - } | undefined; - "css/module"?: { - namedExports?: boolean | undefined; - } | undefined; javascript?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -11368,6 +11473,20 @@ export const rspackOptions: z.ZodObject<{ worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; } | undefined; + css?: { + namedExports?: boolean | undefined; + } | undefined; + "css/auto"?: { + namedExports?: boolean | undefined; + } | undefined; + "css/module"?: { + namedExports?: boolean | undefined; + } | undefined; + asset?: { + dataUrlCondition?: { + maxSize?: number | undefined; + } | undefined; + } | undefined; "javascript/auto"?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -11419,18 +11538,6 @@ export const rspackOptions: z.ZodObject<{ exportsOnly?: boolean | undefined; esModule?: boolean | undefined; } | undefined; - asset?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - dataUrl?: { - mimetype?: string | undefined; - encoding?: false | "base64" | undefined; - } | ((args_0: { - filename: string; - content: string; - }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; - } | undefined; "css/auto"?: { exportsOnly?: boolean | undefined; esModule?: boolean | undefined; @@ -11443,6 +11550,18 @@ export const rspackOptions: z.ZodObject<{ exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined; localIdentName?: string | undefined; } | undefined; + asset?: { + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; + dataUrl?: { + mimetype?: string | undefined; + encoding?: false | "base64" | undefined; + } | ((args_0: { + filename: string; + content: string; + }, ...args_1: unknown[]) => string) | undefined; + } | undefined; "asset/inline"?: { dataUrl?: { mimetype?: string | undefined; @@ -11453,13 +11572,13 @@ export const rspackOptions: z.ZodObject<{ }, ...args_1: unknown[]) => string) | undefined; } | undefined; "asset/resource"?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; } | undefined; } | undefined; - rules?: (false | "" | 0 | RuleSetRule | "..." | null | undefined)[] | undefined; - defaultRules?: (false | "" | 0 | RuleSetRule | "..." | null | undefined)[] | undefined; + rules?: (false | "" | 0 | "..." | RuleSetRule | null | undefined)[] | undefined; + defaultRules?: (false | "" | 0 | "..." | RuleSetRule | null | undefined)[] | undefined; noParse?: string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined; }>>; profile: z.ZodOptional; @@ -11481,116 +11600,8 @@ export const rspackOptions: z.ZodObject<{ maxEntrypointSize?: number | undefined; }>, z.ZodLiteral]>>; }, "strict", z.ZodTypeAny, { - context?: string | undefined; - entry?: string | string[] | Record string) | undefined; - baseUri?: string | undefined; - chunkLoading?: string | false | undefined; - asyncChunks?: boolean | undefined; - wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - library?: { - type: string; - name?: string | string[] | { - commonjs?: string | undefined; - amd?: string | undefined; - root?: string | string[] | undefined; - } | undefined; - amdContainer?: string | undefined; - auxiliaryComment?: string | { - commonjs?: string | undefined; - amd?: string | undefined; - root?: string | undefined; - commonjs2?: string | undefined; - } | undefined; - export?: string | string[] | undefined; - umdNamedDefine?: boolean | undefined; - } | undefined; - dependOn?: string | string[] | undefined; - }> | ((...args: unknown[]) => string | string[] | Record string) | undefined; - baseUri?: string | undefined; - chunkLoading?: string | false | undefined; - asyncChunks?: boolean | undefined; - wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - library?: { - type: string; - name?: string | string[] | { - commonjs?: string | undefined; - amd?: string | undefined; - root?: string | string[] | undefined; - } | undefined; - amdContainer?: string | undefined; - auxiliaryComment?: string | { - commonjs?: string | undefined; - amd?: string | undefined; - root?: string | undefined; - commonjs2?: string | undefined; - } | undefined; - export?: string | string[] | undefined; - umdNamedDefine?: boolean | undefined; - } | undefined; - dependOn?: string | string[] | undefined; - }> | Promise string) | undefined; - baseUri?: string | undefined; - chunkLoading?: string | false | undefined; - asyncChunks?: boolean | undefined; - wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - library?: { - type: string; - name?: string | string[] | { - commonjs?: string | undefined; - amd?: string | undefined; - root?: string | string[] | undefined; - } | undefined; - amdContainer?: string | undefined; - auxiliaryComment?: string | { - commonjs?: string | undefined; - amd?: string | undefined; - root?: string | undefined; - commonjs2?: string | undefined; - } | undefined; - export?: string | string[] | undefined; - umdNamedDefine?: boolean | undefined; - } | undefined; - dependOn?: string | string[] | undefined; - }>>) | undefined; - name?: string | undefined; - profile?: boolean | undefined; - performance?: false | { - assetFilter?: ((args_0: string, ...args_1: unknown[]) => boolean) | undefined; - hints?: false | "error" | "warning" | undefined; - maxAssetSize?: number | undefined; - maxEntrypointSize?: number | undefined; - } | undefined; module?: { parser?: { - css?: { - namedExports?: boolean | undefined; - } | undefined; - asset?: { - dataUrlCondition?: { - maxSize?: number | undefined; - } | undefined; - } | undefined; - "css/auto"?: { - namedExports?: boolean | undefined; - } | undefined; - "css/module"?: { - namedExports?: boolean | undefined; - } | undefined; javascript?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -11606,6 +11617,20 @@ export const rspackOptions: z.ZodObject<{ worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; } | undefined; + css?: { + namedExports?: boolean | undefined; + } | undefined; + "css/auto"?: { + namedExports?: boolean | undefined; + } | undefined; + "css/module"?: { + namedExports?: boolean | undefined; + } | undefined; + asset?: { + dataUrlCondition?: { + maxSize?: number | undefined; + } | undefined; + } | undefined; "javascript/auto"?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -11657,18 +11682,6 @@ export const rspackOptions: z.ZodObject<{ exportsOnly?: boolean | undefined; esModule?: boolean | undefined; } | undefined; - asset?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - dataUrl?: { - mimetype?: string | undefined; - encoding?: false | "base64" | undefined; - } | ((args_0: { - filename: string; - content: string; - }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; - } | undefined; "css/auto"?: { exportsOnly?: boolean | undefined; esModule?: boolean | undefined; @@ -11681,6 +11694,18 @@ export const rspackOptions: z.ZodObject<{ exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined; localIdentName?: string | undefined; } | undefined; + asset?: { + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; + dataUrl?: { + mimetype?: string | undefined; + encoding?: false | "base64" | undefined; + } | ((args_0: { + filename: string; + content: string; + }, ...args_1: unknown[]) => string) | undefined; + } | undefined; "asset/inline"?: { dataUrl?: { mimetype?: string | undefined; @@ -11691,15 +11716,110 @@ export const rspackOptions: z.ZodObject<{ }, ...args_1: unknown[]) => string) | undefined; } | undefined; "asset/resource"?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; } | undefined; } | undefined; - rules?: (false | "" | 0 | RuleSetRule | "..." | null | undefined)[] | undefined; - defaultRules?: (false | "" | 0 | RuleSetRule | "..." | null | undefined)[] | undefined; + rules?: (false | "" | 0 | "..." | RuleSetRule | null | undefined)[] | undefined; + defaultRules?: (false | "" | 0 | "..." | RuleSetRule | null | undefined)[] | undefined; noParse?: string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined; } | undefined; + dependencies?: string[] | undefined; + name?: string | undefined; + context?: string | undefined; + entry?: string | string[] | Record string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; + baseUri?: string | undefined; + chunkLoading?: string | false | undefined; + asyncChunks?: boolean | undefined; + wasmLoading?: string | false | undefined; + library?: { + type: string; + name?: string | string[] | { + commonjs?: string | undefined; + amd?: string | undefined; + root?: string | string[] | undefined; + } | undefined; + amdContainer?: string | undefined; + auxiliaryComment?: string | { + commonjs?: string | undefined; + amd?: string | undefined; + root?: string | undefined; + commonjs2?: string | undefined; + } | undefined; + export?: string | string[] | undefined; + umdNamedDefine?: boolean | undefined; + } | undefined; + dependOn?: string | string[] | undefined; + }> | ((...args: unknown[]) => string | string[] | Record string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; + baseUri?: string | undefined; + chunkLoading?: string | false | undefined; + asyncChunks?: boolean | undefined; + wasmLoading?: string | false | undefined; + library?: { + type: string; + name?: string | string[] | { + commonjs?: string | undefined; + amd?: string | undefined; + root?: string | string[] | undefined; + } | undefined; + amdContainer?: string | undefined; + auxiliaryComment?: string | { + commonjs?: string | undefined; + amd?: string | undefined; + root?: string | undefined; + commonjs2?: string | undefined; + } | undefined; + export?: string | string[] | undefined; + umdNamedDefine?: boolean | undefined; + } | undefined; + dependOn?: string | string[] | undefined; + }> | Promise string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; + baseUri?: string | undefined; + chunkLoading?: string | false | undefined; + asyncChunks?: boolean | undefined; + wasmLoading?: string | false | undefined; + library?: { + type: string; + name?: string | string[] | { + commonjs?: string | undefined; + amd?: string | undefined; + root?: string | string[] | undefined; + } | undefined; + amdContainer?: string | undefined; + auxiliaryComment?: string | { + commonjs?: string | undefined; + amd?: string | undefined; + root?: string | undefined; + commonjs2?: string | undefined; + } | undefined; + export?: string | string[] | undefined; + umdNamedDefine?: boolean | undefined; + } | undefined; + dependOn?: string | string[] | undefined; + }>>) | undefined; + profile?: boolean | undefined; + performance?: false | { + assetFilter?: ((args_0: string, ...args_1: unknown[]) => boolean) | undefined; + hints?: false | "error" | "warning" | undefined; + maxAssetSize?: number | undefined; + maxEntrypointSize?: number | undefined; + } | undefined; node?: false | { global?: boolean | "warn" | undefined; __dirname?: boolean | "warn-mock" | "mock" | "eval-only" | undefined; @@ -11708,11 +11828,28 @@ export const rspackOptions: z.ZodObject<{ cache?: boolean | undefined; loader?: Record | undefined; resolve?: ResolveOptions | undefined; - dependencies?: string[] | undefined; output?: { - path?: string | undefined; - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; module?: boolean | undefined; + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + environment?: { + module?: boolean | undefined; + arrowFunction?: boolean | undefined; + asyncFunction?: boolean | undefined; + bigIntLiteral?: boolean | undefined; + const?: boolean | undefined; + destructuring?: boolean | undefined; + document?: boolean | undefined; + dynamicImport?: boolean | undefined; + dynamicImportInWorker?: boolean | undefined; + forOf?: boolean | undefined; + globalThis?: boolean | undefined; + nodePrefixForCoreModules?: boolean | undefined; + optionalChaining?: boolean | undefined; + templateLiteral?: boolean | undefined; + } | undefined; + path?: string | undefined; + chunkFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; auxiliaryComment?: string | { commonjs?: string | undefined; amd?: string | undefined; @@ -11723,7 +11860,6 @@ export const rspackOptions: z.ZodObject<{ chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: string | string[] | { commonjs?: string | undefined; amd?: string | undefined; @@ -11747,7 +11883,6 @@ export const rspackOptions: z.ZodObject<{ } | undefined; pathinfo?: boolean | "verbose" | undefined; clean?: boolean | undefined; - chunkFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; crossOriginLoading?: false | "anonymous" | "use-credentials" | undefined; cssFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; cssChunkFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; @@ -11775,7 +11910,7 @@ export const rspackOptions: z.ZodObject<{ sourceMapFilename?: string | undefined; hashDigest?: string | undefined; hashDigestLength?: number | undefined; - hashFunction?: "md4" | "xxhash64" | undefined; + hashFunction?: "xxhash64" | "md4" | undefined; hashSalt?: string | undefined; workerChunkLoading?: string | false | undefined; workerWasmLoading?: string | false | undefined; @@ -11786,22 +11921,6 @@ export const rspackOptions: z.ZodObject<{ devtoolFallbackModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined; chunkLoadTimeout?: number | undefined; charset?: boolean | undefined; - environment?: { - module?: boolean | undefined; - arrowFunction?: boolean | undefined; - asyncFunction?: boolean | undefined; - bigIntLiteral?: boolean | undefined; - const?: boolean | undefined; - destructuring?: boolean | undefined; - document?: boolean | undefined; - dynamicImport?: boolean | undefined; - dynamicImportInWorker?: boolean | undefined; - forOf?: boolean | undefined; - globalThis?: boolean | undefined; - nodePrefixForCoreModules?: boolean | undefined; - optionalChaining?: boolean | undefined; - templateLiteral?: boolean | undefined; - } | undefined; } | undefined; target?: false | "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "node" | "async-node" | "web" | "webworker" | "browserslist" | `node${number}` | `async-node${number}` | `node${number}.${number}` | `async-node${number}.${number}` | "electron-main" | `electron${number}-main` | `electron${number}.${number}-main` | "electron-renderer" | `electron${number}-renderer` | `electron${number}.${number}-renderer` | "electron-preload" | `electron${number}-preload` | `electron${number}.${number}-preload` | "nwjs" | `nwjs${number}` | `nwjs${number}.${number}` | "node-webkit" | `node-webkit${number}` | `node-webkit${number}.${number}` | ("es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "node" | "async-node" | "web" | "webworker" | "browserslist" | `node${number}` | `async-node${number}` | `node${number}.${number}` | `async-node${number}.${number}` | "electron-main" | `electron${number}-main` | `electron${number}.${number}-main` | "electron-renderer" | `electron${number}-renderer` | `electron${number}.${number}-renderer` | "electron-preload" | `electron${number}-preload` | `electron${number}.${number}-preload` | "nwjs" | `nwjs${number}` | `nwjs${number}.${number}` | "node-webkit" | `node-webkit${number}` | `node-webkit${number}.${number}`)[] | undefined; mode?: "development" | "none" | "production" | undefined; @@ -11832,7 +11951,7 @@ export const rspackOptions: z.ZodObject<{ contextInfo?: { issuer: string; } | undefined; - }, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record | undefined, args_2: "promise" | "module" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "global" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "system" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: { + }, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record | undefined, args_2: "module" | "global" | "system" | "promise" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: { context?: string | undefined; dependencyType?: string | undefined; request?: string | undefined; @@ -11846,7 +11965,7 @@ export const rspackOptions: z.ZodObject<{ contextInfo?: { issuer: string; } | undefined; - }, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record | undefined, args_2: "promise" | "module" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "global" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "system" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: { + }, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record | undefined, args_2: "module" | "global" | "system" | "promise" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: { context?: string | undefined; dependencyType?: string | undefined; request?: string | undefined; @@ -11854,7 +11973,7 @@ export const rspackOptions: z.ZodObject<{ issuer: string; } | undefined; }, ...args_1: unknown[]) => Promise>))[] | undefined; - externalsType?: "promise" | "module" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "global" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "system" | "script" | "node-commonjs" | undefined; + externalsType?: "module" | "global" | "system" | "promise" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "script" | "node-commonjs" | undefined; externalsPresets?: { node?: boolean | undefined; web?: boolean | undefined; @@ -11866,11 +11985,11 @@ export const rspackOptions: z.ZodObject<{ electronRenderer?: boolean | undefined; } | undefined; infrastructureLogging?: { - colors?: boolean | undefined; debug?: string | boolean | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined; + colors?: boolean | undefined; appendOnly?: boolean | undefined; console?: Console | undefined; - level?: "info" | "none" | "verbose" | "error" | "warn" | "log" | undefined; + level?: "log" | "info" | "verbose" | "none" | "error" | "warn" | undefined; stream?: NodeJS.WritableStream | undefined; } | undefined; devtool?: false | "eval" | "cheap-source-map" | "cheap-module-source-map" | "source-map" | "inline-cheap-source-map" | "inline-cheap-module-source-map" | "inline-source-map" | "inline-nosources-cheap-source-map" | "inline-nosources-cheap-module-source-map" | "inline-nosources-source-map" | "nosources-cheap-source-map" | "nosources-cheap-module-source-map" | "nosources-source-map" | "hidden-nosources-cheap-source-map" | "hidden-nosources-cheap-module-source-map" | "hidden-nosources-source-map" | "hidden-cheap-source-map" | "hidden-cheap-module-source-map" | "hidden-source-map" | "eval-cheap-source-map" | "eval-cheap-module-source-map" | "eval-source-map" | "eval-nosources-cheap-source-map" | "eval-nosources-cheap-module-source-map" | "eval-nosources-source-map" | undefined; @@ -11883,14 +12002,16 @@ export const rspackOptions: z.ZodObject<{ stdin?: boolean | undefined; } | undefined; watch?: boolean | undefined; - stats?: boolean | "normal" | "none" | "verbose" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | { + stats?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | { + publicPath?: boolean | undefined; hash?: boolean | undefined; + all?: boolean | undefined; + chunks?: boolean | undefined; + providedExports?: boolean | undefined; + usedExports?: boolean | undefined; children?: boolean | undefined; runtime?: boolean | undefined; modules?: boolean | undefined; - chunks?: boolean | undefined; - usedExports?: boolean | undefined; - providedExports?: boolean | undefined; optimizationBailout?: boolean | undefined; depth?: boolean | undefined; assets?: boolean | undefined; @@ -11898,15 +12019,13 @@ export const rspackOptions: z.ZodObject<{ errors?: boolean | undefined; warnings?: boolean | undefined; reasons?: boolean | undefined; - all?: boolean | undefined; - preset?: boolean | "normal" | "none" | "verbose" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; + preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; entrypoints?: boolean | "auto" | undefined; chunkGroups?: boolean | undefined; warningsCount?: boolean | undefined; errorsCount?: boolean | undefined; colors?: boolean | undefined; version?: boolean | undefined; - publicPath?: boolean | undefined; outputPath?: boolean | undefined; chunkModules?: boolean | undefined; chunkRelations?: boolean | undefined; @@ -11915,7 +12034,7 @@ export const rspackOptions: z.ZodObject<{ builtAt?: boolean | undefined; moduleAssets?: boolean | undefined; nestedModules?: boolean | undefined; - logging?: boolean | "info" | "none" | "verbose" | "error" | "warn" | "log" | undefined; + logging?: boolean | "log" | "info" | "verbose" | "none" | "error" | "warn" | undefined; loggingDebug?: string | boolean | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined; loggingTrace?: boolean | undefined; runtimeModules?: boolean | undefined; @@ -11958,38 +12077,35 @@ export const rspackOptions: z.ZodObject<{ } | undefined; snapshot?: {} | undefined; optimization?: { - usedExports?: boolean | "global" | undefined; - providedExports?: boolean | undefined; - sideEffects?: boolean | "flag" | undefined; moduleIds?: "named" | "natural" | "deterministic" | undefined; chunkIds?: "named" | "natural" | "deterministic" | undefined; minimize?: boolean | undefined; - minimizer?: (false | "" | 0 | "..." | RspackPluginInstance | RspackPluginFunction | null | undefined)[] | undefined; + minimizer?: (false | "" | 0 | RspackPluginInstance | "..." | RspackPluginFunction | null | undefined)[] | undefined; mergeDuplicateChunks?: boolean | undefined; splitChunks?: false | { name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | Record | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; cacheGroups?: Record unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; filename?: string | undefined; + name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; + type?: string | RegExp | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - maxSize?: number | Record | undefined; priority?: number | undefined; + enforce?: boolean | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; @@ -11997,9 +12113,9 @@ export const rspackOptions: z.ZodObject<{ maxAsyncRequests?: number | undefined; maxInitialRequests?: number | undefined; fallbackCacheGroup?: { - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; minSize?: number | undefined; + maxSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; @@ -12014,9 +12130,12 @@ export const rspackOptions: z.ZodObject<{ removeAvailableModules?: boolean | undefined; removeEmptyChunks?: boolean | undefined; realContentHash?: boolean | undefined; + sideEffects?: boolean | "flag" | undefined; + providedExports?: boolean | undefined; concatenateModules?: boolean | undefined; innerGraph?: boolean | undefined; - mangleExports?: boolean | "size" | "deterministic" | undefined; + usedExports?: boolean | "global" | undefined; + mangleExports?: boolean | "deterministic" | "size" | undefined; nodeEnv?: string | false | undefined; } | undefined; resolveLoader?: ResolveOptions | undefined; @@ -12024,116 +12143,8 @@ export const rspackOptions: z.ZodObject<{ devServer?: DevServer | undefined; bail?: boolean | undefined; }, { - context?: string | undefined; - entry?: string | string[] | Record string) | undefined; - baseUri?: string | undefined; - chunkLoading?: string | false | undefined; - asyncChunks?: boolean | undefined; - wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - library?: { - type: string; - name?: string | string[] | { - commonjs?: string | undefined; - amd?: string | undefined; - root?: string | string[] | undefined; - } | undefined; - amdContainer?: string | undefined; - auxiliaryComment?: string | { - commonjs?: string | undefined; - amd?: string | undefined; - root?: string | undefined; - commonjs2?: string | undefined; - } | undefined; - export?: string | string[] | undefined; - umdNamedDefine?: boolean | undefined; - } | undefined; - dependOn?: string | string[] | undefined; - }> | ((...args: unknown[]) => string | string[] | Record string) | undefined; - baseUri?: string | undefined; - chunkLoading?: string | false | undefined; - asyncChunks?: boolean | undefined; - wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - library?: { - type: string; - name?: string | string[] | { - commonjs?: string | undefined; - amd?: string | undefined; - root?: string | string[] | undefined; - } | undefined; - amdContainer?: string | undefined; - auxiliaryComment?: string | { - commonjs?: string | undefined; - amd?: string | undefined; - root?: string | undefined; - commonjs2?: string | undefined; - } | undefined; - export?: string | string[] | undefined; - umdNamedDefine?: boolean | undefined; - } | undefined; - dependOn?: string | string[] | undefined; - }> | Promise string) | undefined; - baseUri?: string | undefined; - chunkLoading?: string | false | undefined; - asyncChunks?: boolean | undefined; - wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - library?: { - type: string; - name?: string | string[] | { - commonjs?: string | undefined; - amd?: string | undefined; - root?: string | string[] | undefined; - } | undefined; - amdContainer?: string | undefined; - auxiliaryComment?: string | { - commonjs?: string | undefined; - amd?: string | undefined; - root?: string | undefined; - commonjs2?: string | undefined; - } | undefined; - export?: string | string[] | undefined; - umdNamedDefine?: boolean | undefined; - } | undefined; - dependOn?: string | string[] | undefined; - }>>) | undefined; - name?: string | undefined; - profile?: boolean | undefined; - performance?: false | { - assetFilter?: ((args_0: string, ...args_1: unknown[]) => boolean) | undefined; - hints?: false | "error" | "warning" | undefined; - maxAssetSize?: number | undefined; - maxEntrypointSize?: number | undefined; - } | undefined; module?: { parser?: { - css?: { - namedExports?: boolean | undefined; - } | undefined; - asset?: { - dataUrlCondition?: { - maxSize?: number | undefined; - } | undefined; - } | undefined; - "css/auto"?: { - namedExports?: boolean | undefined; - } | undefined; - "css/module"?: { - namedExports?: boolean | undefined; - } | undefined; javascript?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -12149,6 +12160,20 @@ export const rspackOptions: z.ZodObject<{ worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; } | undefined; + css?: { + namedExports?: boolean | undefined; + } | undefined; + "css/auto"?: { + namedExports?: boolean | undefined; + } | undefined; + "css/module"?: { + namedExports?: boolean | undefined; + } | undefined; + asset?: { + dataUrlCondition?: { + maxSize?: number | undefined; + } | undefined; + } | undefined; "javascript/auto"?: { dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; dynamicImportPreload?: number | boolean | undefined; @@ -12200,18 +12225,6 @@ export const rspackOptions: z.ZodObject<{ exportsOnly?: boolean | undefined; esModule?: boolean | undefined; } | undefined; - asset?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; - dataUrl?: { - mimetype?: string | undefined; - encoding?: false | "base64" | undefined; - } | ((args_0: { - filename: string; - content: string; - }, ...args_1: unknown[]) => string) | undefined; - emit?: boolean | undefined; - } | undefined; "css/auto"?: { exportsOnly?: boolean | undefined; esModule?: boolean | undefined; @@ -12224,6 +12237,18 @@ export const rspackOptions: z.ZodObject<{ exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined; localIdentName?: string | undefined; } | undefined; + asset?: { + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + emit?: boolean | undefined; + dataUrl?: { + mimetype?: string | undefined; + encoding?: false | "base64" | undefined; + } | ((args_0: { + filename: string; + content: string; + }, ...args_1: unknown[]) => string) | undefined; + } | undefined; "asset/inline"?: { dataUrl?: { mimetype?: string | undefined; @@ -12234,15 +12259,110 @@ export const rspackOptions: z.ZodObject<{ }, ...args_1: unknown[]) => string) | undefined; } | undefined; "asset/resource"?: { - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; emit?: boolean | undefined; } | undefined; } | undefined; - rules?: (false | "" | 0 | RuleSetRule | "..." | null | undefined)[] | undefined; - defaultRules?: (false | "" | 0 | RuleSetRule | "..." | null | undefined)[] | undefined; + rules?: (false | "" | 0 | "..." | RuleSetRule | null | undefined)[] | undefined; + defaultRules?: (false | "" | 0 | "..." | RuleSetRule | null | undefined)[] | undefined; noParse?: string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined; } | undefined; + dependencies?: string[] | undefined; + name?: string | undefined; + context?: string | undefined; + entry?: string | string[] | Record string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; + baseUri?: string | undefined; + chunkLoading?: string | false | undefined; + asyncChunks?: boolean | undefined; + wasmLoading?: string | false | undefined; + library?: { + type: string; + name?: string | string[] | { + commonjs?: string | undefined; + amd?: string | undefined; + root?: string | string[] | undefined; + } | undefined; + amdContainer?: string | undefined; + auxiliaryComment?: string | { + commonjs?: string | undefined; + amd?: string | undefined; + root?: string | undefined; + commonjs2?: string | undefined; + } | undefined; + export?: string | string[] | undefined; + umdNamedDefine?: boolean | undefined; + } | undefined; + dependOn?: string | string[] | undefined; + }> | ((...args: unknown[]) => string | string[] | Record string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; + baseUri?: string | undefined; + chunkLoading?: string | false | undefined; + asyncChunks?: boolean | undefined; + wasmLoading?: string | false | undefined; + library?: { + type: string; + name?: string | string[] | { + commonjs?: string | undefined; + amd?: string | undefined; + root?: string | string[] | undefined; + } | undefined; + amdContainer?: string | undefined; + auxiliaryComment?: string | { + commonjs?: string | undefined; + amd?: string | undefined; + root?: string | undefined; + commonjs2?: string | undefined; + } | undefined; + export?: string | string[] | undefined; + umdNamedDefine?: boolean | undefined; + } | undefined; + dependOn?: string | string[] | undefined; + }> | Promise string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + layer?: string | null | undefined; + runtime?: string | false | undefined; + baseUri?: string | undefined; + chunkLoading?: string | false | undefined; + asyncChunks?: boolean | undefined; + wasmLoading?: string | false | undefined; + library?: { + type: string; + name?: string | string[] | { + commonjs?: string | undefined; + amd?: string | undefined; + root?: string | string[] | undefined; + } | undefined; + amdContainer?: string | undefined; + auxiliaryComment?: string | { + commonjs?: string | undefined; + amd?: string | undefined; + root?: string | undefined; + commonjs2?: string | undefined; + } | undefined; + export?: string | string[] | undefined; + umdNamedDefine?: boolean | undefined; + } | undefined; + dependOn?: string | string[] | undefined; + }>>) | undefined; + profile?: boolean | undefined; + performance?: false | { + assetFilter?: ((args_0: string, ...args_1: unknown[]) => boolean) | undefined; + hints?: false | "error" | "warning" | undefined; + maxAssetSize?: number | undefined; + maxEntrypointSize?: number | undefined; + } | undefined; node?: false | { global?: boolean | "warn" | undefined; __dirname?: boolean | "warn-mock" | "mock" | "eval-only" | undefined; @@ -12251,11 +12371,28 @@ export const rspackOptions: z.ZodObject<{ cache?: boolean | undefined; loader?: Record | undefined; resolve?: ResolveOptions | undefined; - dependencies?: string[] | undefined; output?: { - path?: string | undefined; - publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; module?: boolean | undefined; + filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + publicPath?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; + environment?: { + module?: boolean | undefined; + arrowFunction?: boolean | undefined; + asyncFunction?: boolean | undefined; + bigIntLiteral?: boolean | undefined; + const?: boolean | undefined; + destructuring?: boolean | undefined; + document?: boolean | undefined; + dynamicImport?: boolean | undefined; + dynamicImportInWorker?: boolean | undefined; + forOf?: boolean | undefined; + globalThis?: boolean | undefined; + nodePrefixForCoreModules?: boolean | undefined; + optionalChaining?: boolean | undefined; + templateLiteral?: boolean | undefined; + } | undefined; + path?: string | undefined; + chunkFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; auxiliaryComment?: string | { commonjs?: string | undefined; amd?: string | undefined; @@ -12266,7 +12403,6 @@ export const rspackOptions: z.ZodObject<{ chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; wasmLoading?: string | false | undefined; - filename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; library?: string | string[] | { commonjs?: string | undefined; amd?: string | undefined; @@ -12290,7 +12426,6 @@ export const rspackOptions: z.ZodObject<{ } | undefined; pathinfo?: boolean | "verbose" | undefined; clean?: boolean | undefined; - chunkFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; crossOriginLoading?: false | "anonymous" | "use-credentials" | undefined; cssFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; cssChunkFilename?: string | ((args_0: JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined; @@ -12318,7 +12453,7 @@ export const rspackOptions: z.ZodObject<{ sourceMapFilename?: string | undefined; hashDigest?: string | undefined; hashDigestLength?: number | undefined; - hashFunction?: "md4" | "xxhash64" | undefined; + hashFunction?: "xxhash64" | "md4" | undefined; hashSalt?: string | undefined; workerChunkLoading?: string | false | undefined; workerWasmLoading?: string | false | undefined; @@ -12329,22 +12464,6 @@ export const rspackOptions: z.ZodObject<{ devtoolFallbackModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined; chunkLoadTimeout?: number | undefined; charset?: boolean | undefined; - environment?: { - module?: boolean | undefined; - arrowFunction?: boolean | undefined; - asyncFunction?: boolean | undefined; - bigIntLiteral?: boolean | undefined; - const?: boolean | undefined; - destructuring?: boolean | undefined; - document?: boolean | undefined; - dynamicImport?: boolean | undefined; - dynamicImportInWorker?: boolean | undefined; - forOf?: boolean | undefined; - globalThis?: boolean | undefined; - nodePrefixForCoreModules?: boolean | undefined; - optionalChaining?: boolean | undefined; - templateLiteral?: boolean | undefined; - } | undefined; } | undefined; target?: false | "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "node" | "async-node" | "web" | "webworker" | "browserslist" | `node${number}` | `async-node${number}` | `node${number}.${number}` | `async-node${number}.${number}` | "electron-main" | `electron${number}-main` | `electron${number}.${number}-main` | "electron-renderer" | `electron${number}-renderer` | `electron${number}.${number}-renderer` | "electron-preload" | `electron${number}-preload` | `electron${number}.${number}-preload` | "nwjs" | `nwjs${number}` | `nwjs${number}.${number}` | "node-webkit" | `node-webkit${number}` | `node-webkit${number}.${number}` | ("es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "node" | "async-node" | "web" | "webworker" | "browserslist" | `node${number}` | `async-node${number}` | `node${number}.${number}` | `async-node${number}.${number}` | "electron-main" | `electron${number}-main` | `electron${number}.${number}-main` | "electron-renderer" | `electron${number}-renderer` | `electron${number}.${number}-renderer` | "electron-preload" | `electron${number}-preload` | `electron${number}.${number}-preload` | "nwjs" | `nwjs${number}` | `nwjs${number}.${number}` | "node-webkit" | `node-webkit${number}` | `node-webkit${number}.${number}`)[] | undefined; mode?: "development" | "none" | "production" | undefined; @@ -12375,7 +12494,7 @@ export const rspackOptions: z.ZodObject<{ contextInfo?: { issuer: string; } | undefined; - }, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record | undefined, args_2: "promise" | "module" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "global" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "system" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: { + }, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record | undefined, args_2: "module" | "global" | "system" | "promise" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: { context?: string | undefined; dependencyType?: string | undefined; request?: string | undefined; @@ -12389,7 +12508,7 @@ export const rspackOptions: z.ZodObject<{ contextInfo?: { issuer: string; } | undefined; - }, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record | undefined, args_2: "promise" | "module" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "global" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "system" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: { + }, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record | undefined, args_2: "module" | "global" | "system" | "promise" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: { context?: string | undefined; dependencyType?: string | undefined; request?: string | undefined; @@ -12397,7 +12516,7 @@ export const rspackOptions: z.ZodObject<{ issuer: string; } | undefined; }, ...args_1: unknown[]) => Promise>))[] | undefined; - externalsType?: "promise" | "module" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "global" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "system" | "script" | "node-commonjs" | undefined; + externalsType?: "module" | "global" | "system" | "promise" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "script" | "node-commonjs" | undefined; externalsPresets?: { node?: boolean | undefined; web?: boolean | undefined; @@ -12409,11 +12528,11 @@ export const rspackOptions: z.ZodObject<{ electronRenderer?: boolean | undefined; } | undefined; infrastructureLogging?: { - colors?: boolean | undefined; debug?: string | boolean | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined; + colors?: boolean | undefined; appendOnly?: boolean | undefined; console?: Console | undefined; - level?: "info" | "none" | "verbose" | "error" | "warn" | "log" | undefined; + level?: "log" | "info" | "verbose" | "none" | "error" | "warn" | undefined; stream?: NodeJS.WritableStream | undefined; } | undefined; devtool?: false | "eval" | "cheap-source-map" | "cheap-module-source-map" | "source-map" | "inline-cheap-source-map" | "inline-cheap-module-source-map" | "inline-source-map" | "inline-nosources-cheap-source-map" | "inline-nosources-cheap-module-source-map" | "inline-nosources-source-map" | "nosources-cheap-source-map" | "nosources-cheap-module-source-map" | "nosources-source-map" | "hidden-nosources-cheap-source-map" | "hidden-nosources-cheap-module-source-map" | "hidden-nosources-source-map" | "hidden-cheap-source-map" | "hidden-cheap-module-source-map" | "hidden-source-map" | "eval-cheap-source-map" | "eval-cheap-module-source-map" | "eval-source-map" | "eval-nosources-cheap-source-map" | "eval-nosources-cheap-module-source-map" | "eval-nosources-source-map" | undefined; @@ -12426,14 +12545,16 @@ export const rspackOptions: z.ZodObject<{ stdin?: boolean | undefined; } | undefined; watch?: boolean | undefined; - stats?: boolean | "normal" | "none" | "verbose" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | { + stats?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | { + publicPath?: boolean | undefined; hash?: boolean | undefined; + all?: boolean | undefined; + chunks?: boolean | undefined; + providedExports?: boolean | undefined; + usedExports?: boolean | undefined; children?: boolean | undefined; runtime?: boolean | undefined; modules?: boolean | undefined; - chunks?: boolean | undefined; - usedExports?: boolean | undefined; - providedExports?: boolean | undefined; optimizationBailout?: boolean | undefined; depth?: boolean | undefined; assets?: boolean | undefined; @@ -12441,15 +12562,13 @@ export const rspackOptions: z.ZodObject<{ errors?: boolean | undefined; warnings?: boolean | undefined; reasons?: boolean | undefined; - all?: boolean | undefined; - preset?: boolean | "normal" | "none" | "verbose" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; + preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; entrypoints?: boolean | "auto" | undefined; chunkGroups?: boolean | undefined; warningsCount?: boolean | undefined; errorsCount?: boolean | undefined; colors?: boolean | undefined; version?: boolean | undefined; - publicPath?: boolean | undefined; outputPath?: boolean | undefined; chunkModules?: boolean | undefined; chunkRelations?: boolean | undefined; @@ -12458,7 +12577,7 @@ export const rspackOptions: z.ZodObject<{ builtAt?: boolean | undefined; moduleAssets?: boolean | undefined; nestedModules?: boolean | undefined; - logging?: boolean | "info" | "none" | "verbose" | "error" | "warn" | "log" | undefined; + logging?: boolean | "log" | "info" | "verbose" | "none" | "error" | "warn" | undefined; loggingDebug?: string | boolean | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined; loggingTrace?: boolean | undefined; runtimeModules?: boolean | undefined; @@ -12501,38 +12620,35 @@ export const rspackOptions: z.ZodObject<{ } | undefined; snapshot?: {} | undefined; optimization?: { - usedExports?: boolean | "global" | undefined; - providedExports?: boolean | undefined; - sideEffects?: boolean | "flag" | undefined; moduleIds?: "named" | "natural" | "deterministic" | undefined; chunkIds?: "named" | "natural" | "deterministic" | undefined; minimize?: boolean | undefined; - minimizer?: (false | "" | 0 | "..." | RspackPluginInstance | RspackPluginFunction | null | undefined)[] | undefined; + minimizer?: (false | "" | 0 | RspackPluginInstance | "..." | RspackPluginFunction | null | undefined)[] | undefined; mergeDuplicateChunks?: boolean | undefined; splitChunks?: false | { name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | Record | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; cacheGroups?: Record unknown) | undefined; - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; filename?: string | undefined; + name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; + type?: string | RegExp | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - maxSize?: number | Record | undefined; priority?: number | undefined; + enforce?: boolean | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; minSize?: number | Record | undefined; + maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; automaticNameDelimiter?: string | undefined; @@ -12540,9 +12656,9 @@ export const rspackOptions: z.ZodObject<{ maxAsyncRequests?: number | undefined; maxInitialRequests?: number | undefined; fallbackCacheGroup?: { - chunks?: RegExp | "initial" | "all" | "async" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - maxSize?: number | undefined; + chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; minSize?: number | undefined; + maxSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; @@ -12557,9 +12673,12 @@ export const rspackOptions: z.ZodObject<{ removeAvailableModules?: boolean | undefined; removeEmptyChunks?: boolean | undefined; realContentHash?: boolean | undefined; + sideEffects?: boolean | "flag" | undefined; + providedExports?: boolean | undefined; concatenateModules?: boolean | undefined; innerGraph?: boolean | undefined; - mangleExports?: boolean | "size" | "deterministic" | undefined; + usedExports?: boolean | "global" | undefined; + mangleExports?: boolean | "deterministic" | "size" | undefined; nodeEnv?: string | false | undefined; } | undefined; resolveLoader?: ResolveOptions | undefined; @@ -12789,7 +12908,7 @@ const RuntimeChunkPlugin: { new (options: RawRuntimeChunkOptions): { name: BuiltinPluginName; _args: [options: RawRuntimeChunkOptions]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -13008,7 +13127,7 @@ export const SourceMapDevToolPlugin: { new (options: SourceMapDevToolPluginOptions): { name: BuiltinPluginName; _args: [options: SourceMapDevToolPluginOptions]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -13188,13 +13307,15 @@ const statsOptions: z.ZodObject<{ errorStack: z.ZodOptional; moduleTrace: z.ZodOptional; }, "strict", z.ZodTypeAny, { + publicPath?: boolean | undefined; hash?: boolean | undefined; + all?: boolean | undefined; + chunks?: boolean | undefined; + providedExports?: boolean | undefined; + usedExports?: boolean | undefined; children?: boolean | undefined; runtime?: boolean | undefined; modules?: boolean | undefined; - chunks?: boolean | undefined; - usedExports?: boolean | undefined; - providedExports?: boolean | undefined; optimizationBailout?: boolean | undefined; depth?: boolean | undefined; assets?: boolean | undefined; @@ -13202,15 +13323,13 @@ const statsOptions: z.ZodObject<{ errors?: boolean | undefined; warnings?: boolean | undefined; reasons?: boolean | undefined; - all?: boolean | undefined; - preset?: boolean | "normal" | "none" | "verbose" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; + preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; entrypoints?: boolean | "auto" | undefined; chunkGroups?: boolean | undefined; warningsCount?: boolean | undefined; errorsCount?: boolean | undefined; colors?: boolean | undefined; version?: boolean | undefined; - publicPath?: boolean | undefined; outputPath?: boolean | undefined; chunkModules?: boolean | undefined; chunkRelations?: boolean | undefined; @@ -13219,7 +13338,7 @@ const statsOptions: z.ZodObject<{ builtAt?: boolean | undefined; moduleAssets?: boolean | undefined; nestedModules?: boolean | undefined; - logging?: boolean | "info" | "none" | "verbose" | "error" | "warn" | "log" | undefined; + logging?: boolean | "log" | "info" | "verbose" | "none" | "error" | "warn" | undefined; loggingDebug?: string | boolean | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined; loggingTrace?: boolean | undefined; runtimeModules?: boolean | undefined; @@ -13260,13 +13379,15 @@ const statsOptions: z.ZodObject<{ errorStack?: boolean | undefined; moduleTrace?: boolean | undefined; }, { + publicPath?: boolean | undefined; hash?: boolean | undefined; + all?: boolean | undefined; + chunks?: boolean | undefined; + providedExports?: boolean | undefined; + usedExports?: boolean | undefined; children?: boolean | undefined; runtime?: boolean | undefined; modules?: boolean | undefined; - chunks?: boolean | undefined; - usedExports?: boolean | undefined; - providedExports?: boolean | undefined; optimizationBailout?: boolean | undefined; depth?: boolean | undefined; assets?: boolean | undefined; @@ -13274,15 +13395,13 @@ const statsOptions: z.ZodObject<{ errors?: boolean | undefined; warnings?: boolean | undefined; reasons?: boolean | undefined; - all?: boolean | undefined; - preset?: boolean | "normal" | "none" | "verbose" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; + preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; entrypoints?: boolean | "auto" | undefined; chunkGroups?: boolean | undefined; warningsCount?: boolean | undefined; errorsCount?: boolean | undefined; colors?: boolean | undefined; version?: boolean | undefined; - publicPath?: boolean | undefined; outputPath?: boolean | undefined; chunkModules?: boolean | undefined; chunkRelations?: boolean | undefined; @@ -13291,7 +13410,7 @@ const statsOptions: z.ZodObject<{ builtAt?: boolean | undefined; moduleAssets?: boolean | undefined; nestedModules?: boolean | undefined; - logging?: boolean | "info" | "none" | "verbose" | "error" | "warn" | "log" | undefined; + logging?: boolean | "log" | "info" | "verbose" | "none" | "error" | "warn" | undefined; loggingDebug?: string | boolean | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined; loggingTrace?: boolean | undefined; runtimeModules?: boolean | undefined; @@ -13437,13 +13556,15 @@ const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodEnum<["normal", "no errorStack: z.ZodOptional; moduleTrace: z.ZodOptional; }, "strict", z.ZodTypeAny, { + publicPath?: boolean | undefined; hash?: boolean | undefined; + all?: boolean | undefined; + chunks?: boolean | undefined; + providedExports?: boolean | undefined; + usedExports?: boolean | undefined; children?: boolean | undefined; runtime?: boolean | undefined; modules?: boolean | undefined; - chunks?: boolean | undefined; - usedExports?: boolean | undefined; - providedExports?: boolean | undefined; optimizationBailout?: boolean | undefined; depth?: boolean | undefined; assets?: boolean | undefined; @@ -13451,15 +13572,13 @@ const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodEnum<["normal", "no errors?: boolean | undefined; warnings?: boolean | undefined; reasons?: boolean | undefined; - all?: boolean | undefined; - preset?: boolean | "normal" | "none" | "verbose" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; + preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; entrypoints?: boolean | "auto" | undefined; chunkGroups?: boolean | undefined; warningsCount?: boolean | undefined; errorsCount?: boolean | undefined; colors?: boolean | undefined; version?: boolean | undefined; - publicPath?: boolean | undefined; outputPath?: boolean | undefined; chunkModules?: boolean | undefined; chunkRelations?: boolean | undefined; @@ -13468,7 +13587,7 @@ const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodEnum<["normal", "no builtAt?: boolean | undefined; moduleAssets?: boolean | undefined; nestedModules?: boolean | undefined; - logging?: boolean | "info" | "none" | "verbose" | "error" | "warn" | "log" | undefined; + logging?: boolean | "log" | "info" | "verbose" | "none" | "error" | "warn" | undefined; loggingDebug?: string | boolean | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined; loggingTrace?: boolean | undefined; runtimeModules?: boolean | undefined; @@ -13509,13 +13628,15 @@ const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodEnum<["normal", "no errorStack?: boolean | undefined; moduleTrace?: boolean | undefined; }, { + publicPath?: boolean | undefined; hash?: boolean | undefined; + all?: boolean | undefined; + chunks?: boolean | undefined; + providedExports?: boolean | undefined; + usedExports?: boolean | undefined; children?: boolean | undefined; runtime?: boolean | undefined; modules?: boolean | undefined; - chunks?: boolean | undefined; - usedExports?: boolean | undefined; - providedExports?: boolean | undefined; optimizationBailout?: boolean | undefined; depth?: boolean | undefined; assets?: boolean | undefined; @@ -13523,15 +13644,13 @@ const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodEnum<["normal", "no errors?: boolean | undefined; warnings?: boolean | undefined; reasons?: boolean | undefined; - all?: boolean | undefined; - preset?: boolean | "normal" | "none" | "verbose" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; + preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; entrypoints?: boolean | "auto" | undefined; chunkGroups?: boolean | undefined; warningsCount?: boolean | undefined; errorsCount?: boolean | undefined; colors?: boolean | undefined; version?: boolean | undefined; - publicPath?: boolean | undefined; outputPath?: boolean | undefined; chunkModules?: boolean | undefined; chunkRelations?: boolean | undefined; @@ -13540,7 +13659,7 @@ const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodEnum<["normal", "no builtAt?: boolean | undefined; moduleAssets?: boolean | undefined; nestedModules?: boolean | undefined; - logging?: boolean | "info" | "none" | "verbose" | "error" | "warn" | "log" | undefined; + logging?: boolean | "log" | "info" | "verbose" | "none" | "error" | "warn" | undefined; loggingDebug?: string | boolean | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined; loggingTrace?: boolean | undefined; runtimeModules?: boolean | undefined; @@ -13602,7 +13721,7 @@ export const SwcCssMinimizerRspackPlugin: { new (options?: SwcCssMinimizerRspackPluginOptions | undefined): { name: BuiltinPluginName; _args: [options?: SwcCssMinimizerRspackPluginOptions | undefined]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -13620,7 +13739,7 @@ export const SwcJsMinimizerRspackPlugin: { new (options?: SwcJsMinimizerRspackPluginOptions | undefined): { name: BuiltinPluginName; _args: [options?: SwcJsMinimizerRspackPluginOptions | undefined]; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -14007,7 +14126,7 @@ const uniqueName: z.ZodString; // @public (undocumented) export const util: { - createHash: (algorithm: "debug" | "md4" | "xxhash64" | (string & {}) | "native-md4" | (new () => default_2)) => default_2; + createHash: (algorithm: (string & {}) | "debug" | "xxhash64" | "md4" | "native-md4" | (new () => default_2)) => default_2; cleverMerge: (first: First, second: Second) => First | Second | (First & Second); }; @@ -14276,6 +14395,25 @@ const webassemblyModuleFilename: z.ZodString; // @public (undocumented) export const WebpackError: ErrorConstructor; +// @public (undocumented) +class WebpackError_2 extends Error { + // (undocumented) + [inspect.custom](): string; + constructor(message?: string); + // (undocumented) + chunk?: Chunk; + // (undocumented) + details?: string; + // (undocumented) + file?: string; + // (undocumented) + hideStack?: boolean; + // (undocumented) + loc?: DependencyLocation; + // (undocumented) + module?: Module; +} + // @public (undocumented) interface Webworker { // (undocumented) @@ -14290,7 +14428,7 @@ const WebWorkerTemplatePlugin: { new (): { name: BuiltinPluginName; _args: []; - affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; + affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; diff --git a/packages/rspack/src/Compiler.ts b/packages/rspack/src/Compiler.ts index 3ab74da3c71..f6d5eed922a 100644 --- a/packages/rspack/src/Compiler.ts +++ b/packages/rspack/src/Compiler.ts @@ -9,60 +9,62 @@ */ import * as binding from "@rspack/binding"; import * as liteTapable from "@rspack/lite-tapable"; -import type Watchpack from "watchpack"; -import { Compilation, type CompilationParams } from "./Compilation"; -import { ContextModuleFactory } from "./ContextModuleFactory"; -import { ThreadsafeWritableNodeFS } from "./FileSystem"; -import { RuleSetCompiler } from "./RuleSetCompiler"; -import { Stats } from "./Stats"; -import { - type EntryNormalized, - type OutputNormalized, - type RspackOptionsNormalized, - type RspackPluginInstance, - getRawOptions -} from "./config"; -import ConcurrentCompilationError from "./error/ConcurrentCompilationError"; -import { rspack } from "./index"; -import Cache = require("./lib/Cache"); -import CacheFacade = require("./lib/CacheFacade"); -import type { Source } from "webpack-sources"; -import { Chunk } from "./Chunk"; import ExecuteModulePlugin from "./ExecuteModulePlugin"; -import type { FileSystemInfoEntry } from "./FileSystemInfo"; -import { - CodeGenerationResult, - type ContextModuleFactoryAfterResolveResult, - Module, - type ResolveData -} from "./Module"; -import { - type NormalModuleCreateData, - NormalModuleFactory -} from "./NormalModuleFactory"; -import { ResolverFactory } from "./ResolverFactory"; +import ConcurrentCompilationError from "./error/ConcurrentCompilationError"; +import Cache from "./lib/Cache"; +import CacheFacade from "./lib/CacheFacade"; + import { RuntimeGlobals, __from_binding_runtime_globals, __to_binding_runtime_globals } from "./RuntimeGlobals"; -import { Watching } from "./Watching"; import { JavascriptModulesPlugin, JsLoaderRspackPlugin } from "./builtin-plugin"; + +import { Chunk } from "./Chunk"; +import { Compilation } from "./Compilation"; +import { ContextModuleFactory } from "./ContextModuleFactory"; +import { ThreadsafeWritableNodeFS } from "./FileSystem"; +import { CodeGenerationResult, Module } from "./Module"; +import { NormalModuleFactory } from "./NormalModuleFactory"; +import { ResolverFactory } from "./ResolverFactory"; +import { RuleSetCompiler } from "./RuleSetCompiler"; +import { Stats } from "./Stats"; +import { Watching } from "./Watching"; +import { getRawOptions } from "./config"; +import { rspack } from "./index"; +import { unsupported } from "./util"; + import { canInherentFromParent } from "./builtin-plugin/base"; import { applyRspackOptionsDefaults } from "./config/defaults"; import { tryRunOrWebpackError } from "./lib/HookWebpackError"; import { Logger } from "./logging/Logger"; -import { unsupported } from "./util"; import { assertNotNill } from "./util/assertNotNil"; import { checkVersion } from "./util/bindingVersionCheck"; import { createHash } from "./util/createHash"; -import type { OutputFileSystem, WatchFileSystem } from "./util/fs"; import { makePathsRelative } from "./util/identifier"; +import type Watchpack from "watchpack"; +import type { Source } from "webpack-sources"; +import type { CompilationParams } from "./Compilation"; +import type { FileSystemInfoEntry } from "./FileSystemInfo"; +import type { + ContextModuleFactoryAfterResolveResult, + ResolveData +} from "./Module"; +import type { NormalModuleCreateData } from "./NormalModuleFactory"; +import type { + EntryNormalized, + OutputNormalized, + RspackOptionsNormalized, + RspackPluginInstance +} from "./config"; +import type { OutputFileSystem, WatchFileSystem } from "./util/fs"; + export interface AssetEmittedInfo { content: Buffer; source: Source; @@ -279,7 +281,7 @@ class Compiler { return new CacheFacade( this.cache, `${this.compilerPath}${name}`, - this.options.output.hashFunction + this.options.output.hashFunction as string ); } diff --git a/packages/rspack/src/NormalModule.ts b/packages/rspack/src/NormalModule.ts index 79720f8dc5c..71f1261a861 100644 --- a/packages/rspack/src/NormalModule.ts +++ b/packages/rspack/src/NormalModule.ts @@ -103,3 +103,5 @@ export class NormalModule { return hooks; } } + +export default NormalModule; diff --git a/packages/rspack/src/lib/AbstractMethodError.js b/packages/rspack/src/lib/AbstractMethodError.js deleted file mode 100644 index 1164927583c..00000000000 --- a/packages/rspack/src/lib/AbstractMethodError.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Ivan Kopeykin @vankop -*/ - -"use strict"; - -const WebpackError = require("./WebpackError"); -const CURRENT_METHOD_REGEXP = /at ([a-zA-Z0-9_.]*)/; - -/** - * @param {string=} method method name - * @returns {string} message - */ -function createMessage(method) { - return `Abstract method${method ? " " + method : ""}. Must be overridden.`; -} - -/** - * @constructor - */ -function Message() { - /** @type {string} */ - // @ts-expect-error - this.stack = undefined; - Error.captureStackTrace(this); - /** @type {RegExpMatchArray} */ - // @ts-expect-error - const match = this.stack.split("\n")[3].match(CURRENT_METHOD_REGEXP); - - this.message = match && match[1] ? createMessage(match[1]) : createMessage(); -} - -/** - * Error for abstract method - * @example - * class FooClass { - * abstractMethod() { - * throw new AbstractMethodError(); // error message: Abstract method FooClass.abstractMethod. Must be overridden. - * } - * } - * - */ -class AbstractMethodError extends WebpackError { - constructor() { - super(new Message().message); - this.name = "AbstractMethodError"; - } -} - -module.exports = AbstractMethodError; diff --git a/packages/rspack/src/lib/AbstractMethodError.ts b/packages/rspack/src/lib/AbstractMethodError.ts new file mode 100644 index 00000000000..d73c4bea246 --- /dev/null +++ b/packages/rspack/src/lib/AbstractMethodError.ts @@ -0,0 +1,51 @@ +/** + * The following code is modified based on + * https://github.com/webpack/webpack/blob/4b4ca3b/lib/AbstractMethodError.js + * + * MIT Licensed + * Author Tobias Koppers @sokra + * Copyright (c) JS Foundation and other contributors + * https://github.com/webpack/webpack/blob/main/LICENSE + */ + +import WebpackError from "./WebpackError"; + +const CURRENT_METHOD_REGEXP = /at ([a-zA-Z0-9_.]*)/; + +/** + * @param method method name + * @returns message + */ +function createMessage(method?: string): string { + return `Abstract method${method ? " " + method : ""}. Must be overridden.`; +} + +class Message extends Error { + constructor() { + super(); + this.stack = undefined; + Error.captureStackTrace(this); + const match = this.stack!.split("\n")[3].match(CURRENT_METHOD_REGEXP); + this.message = + match && match[1] ? createMessage(match[1]) : createMessage(); + } +} + +/** + * Error for abstract method + * @example + * class FooClass { + * abstractMethod() { + * throw new AbstractMethodError(); // error message: Abstract method FooClass.abstractMethod. Must be overridden. + * } + * } + * + */ +export class AbstractMethodError extends WebpackError { + constructor() { + super(new Message().message); + this.name = "AbstractMethodError"; + } +} + +export default AbstractMethodError; diff --git a/packages/rspack/src/lib/Cache.js b/packages/rspack/src/lib/Cache.js deleted file mode 100644 index a96a0126dc0..00000000000 --- a/packages/rspack/src/lib/Cache.js +++ /dev/null @@ -1,175 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -const { - AsyncParallelHook, - AsyncSeriesBailHook, - SyncHook -} = require("@rspack/lite-tapable"); -const { - makeWebpackError, - makeWebpackErrorCallback -} = require("./HookWebpackError.js"); - -/** @typedef {import("./WebpackError")} WebpackError */ - -/** - * @typedef {Object} Etag - * @property {function(): string} toString - */ - -/** - * @template T - * @callback CallbackCache - * @param {(WebpackError | null)=} err - * @param {T=} result - * @returns {void} - */ - -/** - * @callback GotHandler - * @param {any} result - * @param {function(Error=): void} callback - * @returns {void} - */ - -// @ts-expect-error -const needCalls = (times, callback) => { - // @ts-expect-error - return err => { - if (--times === 0) { - return callback(err); - } - if (err && times > 0) { - times = 0; - return callback(err); - } - }; -}; - -class Cache { - constructor() { - this.hooks = { - /** @type {AsyncSeriesBailHook<[string, Etag | null, GotHandler[]], any>} */ - get: new AsyncSeriesBailHook(["identifier", "etag", "gotHandlers"]), - /** @type {AsyncParallelHook<[string, Etag | null, any]>} */ - store: new AsyncParallelHook(["identifier", "etag", "data"]), - /** @type {AsyncParallelHook<[Iterable]>} */ - storeBuildDependencies: new AsyncParallelHook(["dependencies"]), - /** @type {SyncHook<[]>} */ - beginIdle: new SyncHook([]), - /** @type {AsyncParallelHook<[]>} */ - endIdle: new AsyncParallelHook([]), - /** @type {AsyncParallelHook<[]>} */ - shutdown: new AsyncParallelHook([]) - }; - } - - /** - * @template T - * @param {string} identifier the cache identifier - * @param {Etag | null} etag the etag - * @param {CallbackCache} callback signals when the value is retrieved - * @returns {void} - */ - get(identifier, etag, callback) { - // @ts-expect-error - const gotHandlers = []; - // @ts-expect-error - this.hooks.get.callAsync(identifier, etag, gotHandlers, (err, result) => { - if (err) { - callback(makeWebpackError(err, "Cache.hooks.get")); - return; - } - if (result === null) { - result = undefined; - } - if (gotHandlers.length > 1) { - const innerCallback = needCalls(gotHandlers.length, () => - callback(null, result) - ); - // @ts-expect-error - for (const gotHandler of gotHandlers) { - gotHandler(result, innerCallback); - } - } else if (gotHandlers.length === 1) { - // @ts-expect-error - gotHandlers[0](result, () => callback(null, result)); - } else { - callback(null, result); - } - }); - } - - /** - * @template T - * @param {string} identifier the cache identifier - * @param {Etag | null} etag the etag - * @param {T} data the value to store - * @param {CallbackCache} callback signals when the value is stored - * @returns {void} - */ - store(identifier, etag, data, callback) { - this.hooks.store.callAsync( - identifier, - etag, - data, - // @ts-expect-error - makeWebpackErrorCallback(callback, "Cache.hooks.store") - ); - } - - /** - * After this method has succeeded the cache can only be restored when build dependencies are - * @param {Iterable} dependencies list of all build dependencies - * @param {CallbackCache} callback signals when the dependencies are stored - * @returns {void} - */ - storeBuildDependencies(dependencies, callback) { - this.hooks.storeBuildDependencies.callAsync( - dependencies, - // @ts-expect-error - makeWebpackErrorCallback(callback, "Cache.hooks.storeBuildDependencies") - ); - } - - /** - * @returns {void} - */ - beginIdle() { - this.hooks.beginIdle.call(); - } - - /** - * @param {CallbackCache} callback signals when the call finishes - * @returns {void} - */ - endIdle(callback) { - this.hooks.endIdle.callAsync( - // @ts-expect-error - makeWebpackErrorCallback(callback, "Cache.hooks.endIdle") - ); - } - - /** - * @param {CallbackCache} callback signals when the call finishes - * @returns {void} - */ - shutdown(callback) { - this.hooks.shutdown.callAsync( - // @ts-expect-error - makeWebpackErrorCallback(callback, "Cache.hooks.shutdown") - ); - } -} - -Cache.STAGE_MEMORY = -10; -Cache.STAGE_DEFAULT = 0; -Cache.STAGE_DISK = 10; -Cache.STAGE_NETWORK = 20; - -module.exports = Cache; diff --git a/packages/rspack/src/lib/Cache.ts b/packages/rspack/src/lib/Cache.ts new file mode 100644 index 00000000000..26824c40e5c --- /dev/null +++ b/packages/rspack/src/lib/Cache.ts @@ -0,0 +1,166 @@ +/** + * The following code is modified based on + * https://github.com/webpack/webpack/blob/4b4ca3b/lib/Cache.js + * + * MIT Licensed + * Author Tobias Koppers @sokra + * Copyright (c) JS Foundation and other contributors + * https://github.com/webpack/webpack/blob/main/LICENSE + */ + +import { + AsyncParallelHook, + AsyncSeriesBailHook, + SyncHook +} from "@rspack/lite-tapable"; + +import { makeWebpackError, makeWebpackErrorCallback } from "./HookWebpackError"; +import type { WebpackError } from "./WebpackError"; + +export interface Etag { + toString(): string; +} + +export type CallbackCache = (err?: WebpackError | null, result?: T) => void; + +type GotHandler = ( + result: any | null, + callback: (error: Error) => void +) => void; + +const needCalls = ( + times: number, + callback: () => void +): ((error: Error) => void) => { + return err => { + if (--times === 0) { + return callback(); + } + if (err && times > 0) { + times = 0; + return callback(); + } + }; +}; + +export class Cache { + static STAGE_DISK = 10; + static STAGE_MEMORY = -10; + static STAGE_DEFAULT = 0; + static STAGE_NETWORK = 20; + + hooks: { + get: AsyncSeriesBailHook<[string, Etag | null, GotHandler[]], any>; + store: AsyncParallelHook<[string, Etag | null, any]>; + storeBuildDependencies: AsyncParallelHook<[Iterable]>; + beginIdle: SyncHook<[]>; + endIdle: AsyncParallelHook<[]>; + shutdown: AsyncParallelHook<[]>; + }; + + constructor() { + this.hooks = { + get: new AsyncSeriesBailHook(["identifier", "etag", "gotHandlers"]), + store: new AsyncParallelHook(["identifier", "etag", "data"]), + storeBuildDependencies: new AsyncParallelHook(["dependencies"]), + beginIdle: new SyncHook([]), + endIdle: new AsyncParallelHook([]), + shutdown: new AsyncParallelHook([]) + }; + } + + /** + * @param identifier the cache identifier + * @param etag the etag + * @param callback signals when the value is retrieved + * @returns + */ + get(identifier: string, etag: Etag | null, callback: CallbackCache) { + const gotHandlers: GotHandler[] = []; + + this.hooks.get.callAsync(identifier, etag, gotHandlers, (err, result) => { + if (err) { + callback(makeWebpackError(err, "Cache.hooks.get")); + return; + } + if (result === null) { + result = undefined; + } + if (gotHandlers.length > 1) { + const innerCallback = needCalls(gotHandlers.length, () => + callback(null, result) + ); + for (const gotHandler of gotHandlers) { + gotHandler(result, innerCallback); + } + } else if (gotHandlers.length === 1) { + gotHandlers[0](result, () => callback(null, result)); + } else { + callback(null, result); + } + }); + } + + /** + * @param identifier the cache identifier + * @param etag the etag + * @param data the value to store + * @param callback signals when the value is stored + * @returns + */ + store( + identifier: string, + etag: Etag | null, + data: T, + callback: CallbackCache + ) { + this.hooks.store.callAsync( + identifier, + etag, + data, + makeWebpackErrorCallback(callback, "Cache.hooks.store") + ); + } + + /** + * After this method has succeeded the cache can only be restored when build dependencies are + * @param dependencies list of all build dependencies + * @param callback signals when the dependencies are stored + * @returns + */ + storeBuildDependencies( + dependencies: Iterable, + callback: CallbackCache + ) { + this.hooks.storeBuildDependencies.callAsync( + dependencies, + makeWebpackErrorCallback(callback, "Cache.hooks.storeBuildDependencies") + ); + } + + beginIdle() { + this.hooks.beginIdle.call(); + } + + /** + * @param callback signals when the call finishes + * @returns + */ + endIdle(callback: CallbackCache) { + this.hooks.endIdle.callAsync( + makeWebpackErrorCallback(callback, "Cache.hooks.endIdle") + ); + } + + /** + * @param callback signals when the call finishes + * @returns + */ + shutdown(callback: CallbackCache) { + this.hooks.shutdown.callAsync( + makeWebpackErrorCallback(callback, "Cache.hooks.shutdown") + ); + } +} + +export default Cache; diff --git a/packages/rspack/src/lib/CacheFacade.js b/packages/rspack/src/lib/CacheFacade.js deleted file mode 100644 index 793bfb69d89..00000000000 --- a/packages/rspack/src/lib/CacheFacade.js +++ /dev/null @@ -1,380 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -const asyncLib = require("neo-async"); -const getLazyHashedEtag = require("./cache/getLazyHashedEtag.js"); -const mergeEtags = require("./cache/mergeEtags.js"); - -/** - * @template T - * @template Z - * @param {T[]} array array - * @param {(arg0: T, arg1: (err?: null|Error, result?: null|Z) => void , arg2: number) => void} iterator iterator - * @param {(err?: null|Error, result?: null|Z, i?: number) => void} callback callback after all items are iterated - * @returns {void} - */ -function forEachBail(array, iterator, callback) { - if (array.length === 0) return callback(); - - let i = 0; - const next = () => { - /** @type {boolean|undefined} */ - let loop = undefined; - iterator( - array[i++], - (err, result) => { - if (err || result !== undefined || i >= array.length) { - return callback(err, result, i); - } - if (loop === false) while (next()); - loop = true; - }, - i - ); - if (!loop) loop = false; - return loop; - }; - while (next()); -} - -/** @typedef {import("./Cache")} Cache */ -/** @typedef {import("./Cache").Etag} Etag */ -/** @typedef {import("./WebpackError")} WebpackError */ -/** @typedef {import("./cache/getLazyHashedEtag").HashableObject} HashableObject */ -// /** @typedef {typeof import("./util/Hash")} HashConstructor */ -/** @typedef {any} HashConstructor */ - -/** - * @template T - * @callback CallbackCache - * @param {(WebpackError | null)=} err - * @param {T=} result - * @returns {void} - */ - -/** - * @template T - * @callback CallbackNormalErrorCache - * @param {(Error | null)=} err - * @param {T=} result - * @returns {void} - */ - -class MultiItemCache { - /** - * @param {ItemCacheFacade[]} items item caches - */ - constructor(items) { - this._items = items; - if (items.length === 1) return /** @type {any} */ (items[0]); - } - - /** - * @template T - * @param {CallbackCache} callback signals when the value is retrieved - * @returns {void} - */ - get(callback) { - // @ts-expect-error - forEachBail(this._items, (item, callback) => item.get(callback), callback); - } - - /** - * @template T - * @returns {Promise} promise with the data - */ - getPromise() { - // @ts-expect-error - const next = i => { - // @ts-ignore if your typescript version >= 5.5, this line will throw an error - return this._items[i].getPromise().then(result => { - if (result !== undefined) return result; - if (++i < this._items.length) return next(i); - }); - }; - return next(0); - } - - /** - * @template T - * @param {T} data the value to store - * @param {CallbackCache} callback signals when the value is stored - * @returns {void} - */ - store(data, callback) { - asyncLib.each( - this._items, - (item, callback) => item.store(data, callback), - callback - ); - } - - /** - * @template T - * @param {T} data the value to store - * @returns {Promise} promise signals when the value is stored - */ - storePromise(data) { - return Promise.all(this._items.map(item => item.storePromise(data))).then( - () => {} - ); - } -} - -class ItemCacheFacade { - /** - * @param {Cache} cache the root cache - * @param {string} name the child cache item name - * @param {Etag | null} etag the etag - */ - constructor(cache, name, etag) { - this._cache = cache; - this._name = name; - this._etag = etag; - } - - /** - * @template T - * @param {CallbackCache} callback signals when the value is retrieved - * @returns {void} - */ - get(callback) { - this._cache.get(this._name, this._etag, callback); - } - - /** - * @template T - * @returns {Promise} promise with the data - */ - getPromise() { - return new Promise((resolve, reject) => { - this._cache.get(this._name, this._etag, (err, data) => { - if (err) { - reject(err); - } else { - resolve(data); - } - }); - }); - } - - /** - * @template T - * @param {T} data the value to store - * @param {CallbackCache} callback signals when the value is stored - * @returns {void} - */ - store(data, callback) { - this._cache.store(this._name, this._etag, data, callback); - } - - /** - * @template T - * @param {T} data the value to store - * @returns {Promise} promise signals when the value is stored - */ - storePromise(data) { - return new Promise((resolve, reject) => { - this._cache.store(this._name, this._etag, data, err => { - if (err) { - reject(err); - } else { - resolve(); - } - }); - }); - } - - /** - * @template T - * @param {function(CallbackNormalErrorCache): void} computer function to compute the value if not cached - * @param {CallbackNormalErrorCache} callback signals when the value is retrieved - * @returns {void} - */ - provide(computer, callback) { - this.get((err, cacheEntry) => { - if (err) return callback(err); - if (cacheEntry !== undefined) return cacheEntry; - computer((err, result) => { - if (err) return callback(err); - this.store(result, err => { - if (err) return callback(err); - callback(null, result); - }); - }); - }); - } - - /** - * @template T - * @param {function(): Promise | T} computer function to compute the value if not cached - * @returns {Promise} promise with the data - */ - async providePromise(computer) { - const cacheEntry = await this.getPromise(); - if (cacheEntry !== undefined) return cacheEntry; - const result = await computer(); - await this.storePromise(result); - return result; - } -} - -class CacheFacade { - /** - * @param {Cache} cache the root cache - * @param {string} name the child cache name - * @param {string | HashConstructor} hashFunction the hash function to use - */ - constructor(cache, name, hashFunction) { - this._cache = cache; - this._name = name; - this._hashFunction = hashFunction; - } - - /** - * @param {string} name the child cache name# - * @returns {CacheFacade} child cache - */ - getChildCache(name) { - return new CacheFacade( - this._cache, - `${this._name}|${name}`, - this._hashFunction - ); - } - - /** - * @param {string} identifier the cache identifier - * @param {Etag | null} etag the etag - * @returns {ItemCacheFacade} item cache - */ - getItemCache(identifier, etag) { - return new ItemCacheFacade( - this._cache, - `${this._name}|${identifier}`, - etag - ); - } - - /** - * @param {HashableObject} obj an hashable object - * @returns {Etag} an etag that is lazy hashed - */ - getLazyHashedEtag(obj) { - return getLazyHashedEtag(obj, this._hashFunction); - } - - /** - * @param {Etag} a an etag - * @param {Etag} b another etag - * @returns {Etag} an etag that represents both - */ - mergeEtags(a, b) { - return mergeEtags(a, b); - } - - /** - * @template T - * @param {string} identifier the cache identifier - * @param {Etag | null} etag the etag - * @param {CallbackCache} callback signals when the value is retrieved - * @returns {void} - */ - get(identifier, etag, callback) { - this._cache.get(`${this._name}|${identifier}`, etag, callback); - } - - /** - * @template T - * @param {string} identifier the cache identifier - * @param {Etag | null} etag the etag - * @returns {Promise} promise with the data - */ - getPromise(identifier, etag) { - return new Promise((resolve, reject) => { - this._cache.get(`${this._name}|${identifier}`, etag, (err, data) => { - if (err) { - reject(err); - } else { - resolve(data); - } - }); - }); - } - - /** - * @template T - * @param {string} identifier the cache identifier - * @param {Etag | null} etag the etag - * @param {T} data the value to store - * @param {CallbackCache} callback signals when the value is stored - * @returns {void} - */ - store(identifier, etag, data, callback) { - this._cache.store(`${this._name}|${identifier}`, etag, data, callback); - } - - /** - * @template T - * @param {string} identifier the cache identifier - * @param {Etag | null} etag the etag - * @param {T} data the value to store - * @returns {Promise} promise signals when the value is stored - */ - storePromise(identifier, etag, data) { - return new Promise((resolve, reject) => { - this._cache.store(`${this._name}|${identifier}`, etag, data, err => { - if (err) { - reject(err); - } else { - resolve(); - } - }); - }); - } - - /** - * @template T - * @param {string} identifier the cache identifier - * @param {Etag | null} etag the etag - * @param {function(CallbackNormalErrorCache): void} computer function to compute the value if not cached - * @param {CallbackNormalErrorCache} callback signals when the value is retrieved - * @returns {void} - */ - provide(identifier, etag, computer, callback) { - this.get(identifier, etag, (err, cacheEntry) => { - if (err) return callback(err); - if (cacheEntry !== undefined) return cacheEntry; - computer((err, result) => { - if (err) return callback(err); - this.store(identifier, etag, result, err => { - if (err) return callback(err); - callback(null, result); - }); - }); - }); - } - - /** - * @template T - * @param {string} identifier the cache identifier - * @param {Etag | null} etag the etag - * @param {function(): Promise | T} computer function to compute the value if not cached - * @returns {Promise} promise with the data - */ - async providePromise(identifier, etag, computer) { - const cacheEntry = await this.getPromise(identifier, etag); - if (cacheEntry !== undefined) return cacheEntry; - const result = await computer(); - await this.storePromise(identifier, etag, result); - return result; - } -} - -module.exports = CacheFacade; -module.exports.ItemCacheFacade = ItemCacheFacade; -module.exports.MultiItemCache = MultiItemCache; diff --git a/packages/rspack/src/lib/CacheFacade.ts b/packages/rspack/src/lib/CacheFacade.ts new file mode 100644 index 00000000000..4583ec47ed9 --- /dev/null +++ b/packages/rspack/src/lib/CacheFacade.ts @@ -0,0 +1,405 @@ +/** + * The following code is modified based on + * https://github.com/webpack/webpack/blob/4b4ca3b/lib/CacheFacade.js + * + * MIT Licensed + * Author Tobias Koppers @sokra + * Copyright (c) JS Foundation and other contributors + * https://github.com/webpack/webpack/blob/main/LICENSE + */ + +import asyncLib from "neo-async"; +import { getter as getLazyHashedEtag } from "./cache/getLazyHashedEtag.js"; +import { mergeEtags } from "./cache/mergeEtags.js"; + +import type { Cache, CallbackCache, Etag } from "./Cache"; +import type WebpackError from "./WebpackError"; +import type { + HashConstructor, + HashableObject +} from "./cache/getLazyHashedEtag"; + +type CallbackNormalErrorCache = ( + err?: WebpackError | null, + result?: T +) => void; + +type CallbackNormalErrorCacheWithIndex = ( + err?: WebpackError | null, + result?: T, + i?: number +) => void; + +function forEachBail( + array: T[], + iterator: (arg0: T, arg1: CallbackNormalErrorCache, arg2: number) => void, + callback: CallbackNormalErrorCacheWithIndex +): void { + if (array.length === 0) { + callback(); + return; + } + + let i = 0; + const next = () => { + /** @type {boolean|undefined} */ + let loop: boolean | undefined = undefined; + iterator( + array[i++], + (err, result) => { + if (err || result !== undefined || i >= array.length) { + return callback(err, result, i); + } + if (loop === false) while (next()); + loop = true; + }, + i + ); + if (!loop) loop = false; + return loop; + }; + while (next()); +} + +abstract class BaseCache { + abstract get(callback: CallbackCache): void; + abstract getPromise(): Promise; + abstract store(data: T, callback: CallbackCache): void; + abstract storePromise(data: T): Promise; +} + +export class MultiItemCache implements BaseCache { + _items: ItemCacheFacade[]; + + /** + * @param items item caches + * @returns + */ + constructor(items: ItemCacheFacade[]) { + this._items = items; + if (items.length === 1) return items[0] as any; + } + + /** + * @param callback signals when the value is retrieved + * @returns + */ + get(callback: CallbackCache) { + forEachBail( + this._items, + (item: ItemCacheFacade, callback: any) => item.get(callback), + callback + ); + } + + /** + * @returns promise with the data + */ + getPromise(): Promise { + const next = async (i: number): Promise => { + const result_1 = await this._items[i].getPromise(); + if (result_1 !== undefined) return result_1; + if (++i < this._items.length) return next(i); + }; + return next(0); + } + + /** + * @param data the value to store + * @param callback signals when the value is stored + * @returns + */ + store(data: T, callback: CallbackCache): void { + asyncLib.each( + this._items, + (item, callback) => item.store(data, callback), + callback + ); + } + + /** + * @param data the value to store + * @returns promise signals when the value is stored + */ + async storePromise(data: T): Promise { + await Promise.all(this._items.map(item => item.storePromise(data))); + } +} + +export class ItemCacheFacade implements BaseCache { + _cache: Cache; + _name: string; + _etag: Etag | null; + + /** + * @param cache the root cache + * @param name the child cache item name + * @param etag the etag + * @returns + */ + constructor(cache: Cache, name: string, etag: Etag | null) { + this._cache = cache; + this._name = name; + this._etag = etag; + } + + /** + * @param callback signals when the value is retrieved + * @returns + */ + get(callback: CallbackCache): void { + this._cache.get(this._name, this._etag, callback); + } + + /** + * @returns promise with the data + */ + getPromise(): Promise { + return new Promise((resolve, reject) => { + this._cache.get(this._name, this._etag, (err, data) => { + if (err) { + reject(err); + } else { + resolve(data); + } + }); + }); + } + + /** + * @param data the value to store + * @param callback signals when the value is stored + * @returns + */ + store(data: T, callback: CallbackCache): void { + this._cache.store(this._name, this._etag, data, callback); + } + + /** + * @param data the value to store + * @returns promise signals when the value is stored + */ + storePromise(data: T): Promise { + return new Promise((resolve, reject) => { + this._cache.store(this._name, this._etag, data, err => { + if (err) { + reject(err); + } else { + resolve(); + } + }); + }); + } + + /** + * @param computer function to compute the value if not cached + * @param callback signals when the value is retrieved + * @returns + */ + provide( + computer: (callback: CallbackNormalErrorCache) => void, + callback: CallbackNormalErrorCache + ) { + this.get((err, cacheEntry) => { + if (err) return callback(err); + if (cacheEntry !== undefined) return cacheEntry; + computer((err, result) => { + if (err) return callback(err); + this.store(result, err => { + if (err) return callback(err); + callback(null, result); + }); + }); + }); + } + + /** + * @param computer function to compute the value if not cached + * @returns promise with the data + */ + async providePromise(computer: () => Promise | T): Promise { + const cacheEntry = await this.getPromise(); + if (cacheEntry !== undefined) return cacheEntry; + const result = await computer(); + await this.storePromise(result); + return result; + } +} + +export class CacheFacade { + _name: string; + _cache: Cache; + _hashFunction: string | HashConstructor; + + /** + * @param cache the root cache + * @param name the child cache name + * @param hashFunction the hash function to use + */ + constructor( + cache: Cache, + name: string, + hashFunction: string | HashConstructor + ) { + this._cache = cache; + this._name = name; + this._hashFunction = hashFunction; + } + + /** + * @param name the child cache name# + * @returns child cache + */ + getChildCache(name: string): CacheFacade { + return new CacheFacade( + this._cache, + `${this._name}|${name}`, + this._hashFunction + ); + } + + /** + * @param identifier the cache identifier + * @param etag the etag + * @returns item cache + */ + getItemCache(identifier: string, etag: Etag | null): ItemCacheFacade { + return new ItemCacheFacade( + this._cache, + `${this._name}|${identifier}`, + etag + ); + } + + /** + * @param obj an hashable object + * @returns an etag that is lazy hashed + */ + getLazyHashedEtag(obj: HashableObject): Etag { + return getLazyHashedEtag(obj, this._hashFunction); + } + + /** + * @param a an etag + * @param b another etag + * @returns an etag that represents both + */ + mergeEtags(a: Etag, b: Etag): Etag { + return mergeEtags(a, b); + } + + /** + * @param identifier the cache identifier + * @param etag the etag + * @param callback signals when the value is retrieved + * @returns + */ + get( + identifier: string, + etag: Etag | null, + callback: CallbackCache + ): void { + this._cache.get(`${this._name}|${identifier}`, etag, callback); + } + + /** + * @param identifier the cache identifier + * @param etag the etag + * @returns promise with the data + */ + getPromise(identifier: string, etag: Etag | null): Promise { + return new Promise((resolve, reject) => { + this._cache.get(`${this._name}|${identifier}`, etag, (err, data) => { + if (err) { + reject(err); + } else { + resolve(data); + } + }); + }); + } + + /** + * @param identifier the cache identifier + * @param etag the etag + * @param data the value to store + * @param callback signals when the value is stored + * @returns + */ + store( + identifier: string, + etag: Etag | null, + data: T, + callback: CallbackCache + ): void { + this._cache.store(`${this._name}|${identifier}`, etag, data, callback); + } + + /** + * @param identifier the cache identifier + * @param etag the etag + * @param data the value to store + * @returns promise signals when the value is stored + */ + storePromise( + identifier: string, + etag: Etag | null, + data: T + ): Promise { + return new Promise((resolve, reject) => { + this._cache.store(`${this._name}|${identifier}`, etag, data, err => { + if (err) { + reject(err); + } else { + resolve(); + } + }); + }); + } + + /** + * @param identifier the cache identifier + * @param etag the etag + * @param computer function to compute the value if not cached + * @param callback signals when the value is retrieved + * @returns + */ + provide( + identifier: string, + etag: Etag | null, + computer: (callback: CallbackNormalErrorCache) => void, + callback: CallbackNormalErrorCache + ): void { + this.get(identifier, etag, (err, cacheEntry) => { + if (err) return callback(err); + if (cacheEntry !== undefined) return cacheEntry; + computer((err, result) => { + if (err) return callback(err); + this.store(identifier, etag, result, err => { + if (err) return callback(err); + callback(null, result); + }); + }); + }); + } + + /** + * @param identifier the cache identifier + * @param etag the etag + * @param computer function to compute the value if not cached + * @returns promise with the data + */ + async providePromise( + identifier: string, + etag: Etag | null, + computer: () => Promise | T + ) { + const cacheEntry = await this.getPromise(identifier, etag); + if (cacheEntry !== undefined) return cacheEntry; + const result = await computer(); + await this.storePromise(identifier, etag, result); + return result; + } +} + +export default CacheFacade; diff --git a/packages/rspack/src/lib/EntryOptionPlugin.ts b/packages/rspack/src/lib/EntryOptionPlugin.ts index fc25b02e578..b50d3fd99dc 100644 --- a/packages/rspack/src/lib/EntryOptionPlugin.ts +++ b/packages/rspack/src/lib/EntryOptionPlugin.ts @@ -11,13 +11,14 @@ import assert from "node:assert"; import type { Compiler, EntryDescriptionNormalized, EntryNormalized } from ".."; -import { - DynamicEntryPlugin, - type EntryOptions, - EntryPlugin -} from "../builtin-plugin"; +import { DynamicEntryPlugin, EntryPlugin } from "../builtin-plugin"; +import type { EntryOptions } from "../builtin-plugin"; -export default class EntryOptionPlugin { +export class EntryOptionPlugin { + /** + * @param compiler the compiler instance one is tapping into + * @returns + */ apply(compiler: Compiler) { compiler.hooks.entryOption.tap("EntryOptionPlugin", (context, entry) => { EntryOptionPlugin.applyEntryOption(compiler, context, entry); @@ -25,6 +26,12 @@ export default class EntryOptionPlugin { }); } + /** + * @param compiler the compiler + * @param context context directory + * @param entry request + * @returns + */ static applyEntryOption( compiler: Compiler, context: string, @@ -51,6 +58,12 @@ export default class EntryOptionPlugin { } } + /** + * @param compiler the compiler + * @param name entry name + * @param desc entry description + * @returns options for the entry + */ static entryDescriptionToOptions( compiler: Compiler, name: string, @@ -89,3 +102,5 @@ export default class EntryOptionPlugin { return options; } } + +export default EntryOptionPlugin; diff --git a/packages/rspack/src/lib/EnvironmentPlugin.js b/packages/rspack/src/lib/EnvironmentPlugin.ts similarity index 62% rename from packages/rspack/src/lib/EnvironmentPlugin.js rename to packages/rspack/src/lib/EnvironmentPlugin.ts index b08a23d3241..df86782e34f 100644 --- a/packages/rspack/src/lib/EnvironmentPlugin.js +++ b/packages/rspack/src/lib/EnvironmentPlugin.ts @@ -1,22 +1,26 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Authors Simen Brekken @simenbrekken, Einar Löve @einarlove -*/ - -"use strict"; +/** + * The following code is modified based on + * https://github.com/webpack/webpack/blob/4b4ca3b/lib/EnvironmentPlugin.js + * + * MIT Licensed + * Author Tobias Koppers @sokra + * Copyright (c) JS Foundation and other contributors + * https://github.com/webpack/webpack/blob/main/LICENSE + */ import { DefinePlugin } from "../builtin-plugin"; +import WebpackError from "./WebpackError"; -const WebpackError = require("./WebpackError"); +import type { Compiler } from "../Compiler"; -// /** @typedef {import("./Compiler")} Compiler */ -// /** @typedef {import("./DefinePlugin").CodeValue} CodeValue */ -/** @typedef {any} Compiler */ -/** @typedef {any} CodeValue */ +// Waiting to adapt > import("./DefinePlugin").CodeValue +type CodeValue = any; class EnvironmentPlugin { - // @ts-expect-error - constructor(...keys) { + keys: string[]; + defaultValues: Record; + + constructor(...keys: string[] | [Record | string]) { if (keys.length === 1 && Array.isArray(keys[0])) { this.keys = keys[0]; this.defaultValues = {}; @@ -24,19 +28,18 @@ class EnvironmentPlugin { this.keys = Object.keys(keys[0]); this.defaultValues = keys[0]; } else { - this.keys = keys; + this.keys = keys as string[]; this.defaultValues = {}; } } /** * Apply the plugin - * @param {Compiler} compiler the compiler instance - * @returns {void} + * @param compiler the compiler instance + * @returns */ - apply(compiler) { - /** @type {Record} */ - const definitions = {}; + apply(compiler: Compiler) { + const definitions: Record = {}; for (const key of this.keys) { const value = process.env[key] !== undefined @@ -44,7 +47,6 @@ class EnvironmentPlugin { : this.defaultValues[key]; if (value === undefined) { - // @ts-expect-error compiler.hooks.thisCompilation.tap("EnvironmentPlugin", compilation => { const error = new WebpackError( `EnvironmentPlugin - ${key} environment variable is undefined.\n\n` + diff --git a/packages/rspack/src/lib/HookWebpackError.js b/packages/rspack/src/lib/HookWebpackError.js deleted file mode 100644 index ba0a9034f44..00000000000 --- a/packages/rspack/src/lib/HookWebpackError.js +++ /dev/null @@ -1,95 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Sean Larkin @thelarkinn -*/ - -"use strict"; - -const WebpackError = require("./WebpackError.js"); - -// /** @typedef {import("./Module")} Module */ -/** @typedef {any} Module */ - -/** - * @template T - * @callback Callback - * @param {Error=} err - * @param {T=} stats - * @returns {void} - */ - -class HookWebpackError extends WebpackError { - /** - * Creates an instance of HookWebpackError. - * @param {Error} error inner error - * @param {string} hook name of hook - */ - constructor(error, hook) { - super(error.message); - - this.name = "HookWebpackError"; - this.hook = hook; - this.error = error; - this.hideStack = true; - this.details = `caused by plugins in ${hook}\n${error.stack}`; - - this.stack += `\n-- inner error --\n${error.stack}`; - } -} - -module.exports = HookWebpackError; - -/** - * @param {Error} error an error - * @param {string} hook name of the hook - * @returns {WebpackError} a webpack error - */ -const makeWebpackError = (error, hook) => { - if (error instanceof WebpackError) return error; - return new HookWebpackError(error, hook); -}; -module.exports.makeWebpackError = makeWebpackError; - -/** - * @template T - * @param {function((WebpackError | null)=, T=): void} callback webpack error callback - * @param {string} hook name of hook - * @returns {Callback} generic callback - */ -const makeWebpackErrorCallback = (callback, hook) => { - return (err, result) => { - if (err) { - if (err instanceof WebpackError) { - callback(err); - return; - } - callback(new HookWebpackError(err, hook)); - return; - } - callback(null, result); - }; -}; - -module.exports.makeWebpackErrorCallback = makeWebpackErrorCallback; - -/** - * @template T - * @param {function(): T} fn function which will be wrapping in try catch - * @param {string} hook name of hook - * @returns {T} the result - */ -const tryRunOrWebpackError = (fn, hook) => { - let r; - try { - r = fn(); - } catch (err) { - if (err instanceof WebpackError) { - throw err; - } - // @ts-expect-error - throw new HookWebpackError(err, hook); - } - return r; -}; - -module.exports.tryRunOrWebpackError = tryRunOrWebpackError; diff --git a/packages/rspack/src/lib/HookWebpackError.ts b/packages/rspack/src/lib/HookWebpackError.ts new file mode 100644 index 00000000000..14667ad47d0 --- /dev/null +++ b/packages/rspack/src/lib/HookWebpackError.ts @@ -0,0 +1,86 @@ +/** + * The following code is modified based on + * https://github.com/webpack/webpack/blob/4b4ca3b/lib/HookWebpackError.js + * + * MIT Licensed + * Author Tobias Koppers @sokra + * Copyright (c) JS Foundation and other contributors + * https://github.com/webpack/webpack/blob/main/LICENSE + */ + +import type { Callback } from "@rspack/lite-tapable"; +import WebpackError from "./WebpackError"; + +export class HookWebpackError extends WebpackError { + hook: string; + error: Error; + + /** + * Creates an instance of HookWebpackError. + * @param error inner error + * @param hook name of hook + */ + constructor(error: Error, hook: string) { + super(error.message); + + this.name = "HookWebpackError"; + this.hook = hook; + this.error = error; + this.hideStack = true; + this.details = `caused by plugins in ${hook}\n${error.stack}`; + + this.stack += `\n-- inner error --\n${error.stack}`; + } +} + +export default HookWebpackError; + +/** + * @param error an error + * @param hook name of the hook + * @returns a webpack error + */ +export const makeWebpackError = (error: Error, hook: string): WebpackError => { + if (error instanceof WebpackError) return error; + return new HookWebpackError(error, hook); +}; + +/** + * @param callback webpack error callback + * @param hook name of hook + * @returns generic callback + */ +export const makeWebpackErrorCallback = ( + callback: (error?: WebpackError | null, result?: T) => void, + hook: string +): Callback => { + return (err, result) => { + if (err) { + if (err instanceof WebpackError) { + callback(err); + return; + } + callback(new HookWebpackError(err, hook)); + return; + } + callback(null, result); + }; +}; + +/** + * @param fn function which will be wrapping in try catch + * @param hook name of hook + * @returns the result + */ +export const tryRunOrWebpackError = (fn: () => T, hook: string): T => { + let r; + try { + r = fn(); + } catch (err) { + if (err instanceof WebpackError) { + throw err; + } + throw new HookWebpackError(err as Error, hook); + } + return r; +}; diff --git a/packages/rspack/src/lib/ignoreWarningsPlugin.ts b/packages/rspack/src/lib/IgnoreWarningsPlugin.ts similarity index 50% rename from packages/rspack/src/lib/ignoreWarningsPlugin.ts rename to packages/rspack/src/lib/IgnoreWarningsPlugin.ts index 34749e39cd7..a7abb8f381c 100644 --- a/packages/rspack/src/lib/ignoreWarningsPlugin.ts +++ b/packages/rspack/src/lib/IgnoreWarningsPlugin.ts @@ -1,17 +1,35 @@ +/** + * The following code is modified based on + * https://github.com/webpack/webpack/blob/4b4ca3b/lib/IgnoreWarningsPlugin.js + * + * MIT Licensed + * Author Tobias Koppers @sokra + * Copyright (c) JS Foundation and other contributors + * https://github.com/webpack/webpack/blob/main/LICENSE + */ + import type { Compiler, IgnoreWarningsNormalized, RspackPluginInstance -} from "../"; +} from ".."; -export default class IgnoreWarningsPlugin implements RspackPluginInstance { +class IgnoreWarningsPlugin implements RspackPluginInstance { _ignorePattern: IgnoreWarningsNormalized; name = "IgnoreWarningsPlugin"; + /** + * @param ignoreWarnings conditions to ignore warnings + */ constructor(ignorePattern: IgnoreWarningsNormalized) { this._ignorePattern = ignorePattern; } + /** + * Apply the plugin + * @param compiler the compiler instance + * @returns + */ apply(compiler: Compiler) { compiler.hooks.compilation.tap(this.name, compilation => { compilation.hooks.processWarnings.tap(this.name, warnings => { @@ -24,3 +42,5 @@ export default class IgnoreWarningsPlugin implements RspackPluginInstance { }); } } + +export default IgnoreWarningsPlugin; diff --git a/packages/rspack/src/lib/LoaderOptionsPlugin.js b/packages/rspack/src/lib/LoaderOptionsPlugin.js deleted file mode 100644 index 887fdd3606f..00000000000 --- a/packages/rspack/src/lib/LoaderOptionsPlugin.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -const ModuleFilenameHelpers = require("./ModuleFilenameHelpers"); -const { NormalModule } = require("../NormalModule"); - -// /** @typedef {import("../declarations/plugins/LoaderOptionsPlugin").LoaderOptionsPluginOptions} LoaderOptionsPluginOptions */ -/** @typedef {import("../Compiler").Compiler} Compiler */ -/** @typedef {any} LoaderOptionsPluginOptions */ - -class LoaderOptionsPlugin { - /** - * @param {LoaderOptionsPluginOptions} options options object - */ - constructor(options = {}) { - if (typeof options !== "object") options = {}; - if (!options.test) { - options.test = { - test: () => true - }; - } - this.options = options; - } - - /** - * Apply the plugin - * @param {Compiler} compiler the compiler instance - * @returns {void} - */ - apply(compiler) { - const options = this.options; - compiler.hooks.compilation.tap("LoaderOptionsPlugin", compilation => { - NormalModule.getCompilationHooks(compilation).loader.tap( - "LoaderOptionsPlugin", - context => { - const resource = context.resourcePath; - if (!resource) return; - if (ModuleFilenameHelpers.matchObject(options, resource)) { - for (const key of Object.keys(options)) { - if (key === "include" || key === "exclude" || key === "test") { - continue; - } - // @ts-expect-error - context[key] = options[key]; - } - } - } - ); - }); - } -} - -export { LoaderOptionsPlugin }; diff --git a/packages/rspack/src/lib/LoaderOptionsPlugin.ts b/packages/rspack/src/lib/LoaderOptionsPlugin.ts new file mode 100644 index 00000000000..4dad56b1688 --- /dev/null +++ b/packages/rspack/src/lib/LoaderOptionsPlugin.ts @@ -0,0 +1,60 @@ +/** + * The following code is modified based on + * https://github.com/webpack/webpack/blob/4b4ca3b/lib/LoaderOptionsPlugin.js + * + * MIT Licensed + * Author Tobias Koppers @sokra + * Copyright (c) JS Foundation and other contributors + * https://github.com/webpack/webpack/blob/main/LICENSE + */ + +import { NormalModule } from "../NormalModule"; +import * as ModuleFilenameHelpers from "./ModuleFilenameHelpers"; + +import type { Compiler } from "../Compiler"; +import type { MatchObject } from "./ModuleFilenameHelpers"; + +type LoaderOptionsPluginOptions = any; + +export class LoaderOptionsPlugin { + options: MatchObject; + + /** + * @param options options object + */ + constructor(options: LoaderOptionsPluginOptions = {}) { + if (typeof options !== "object") options = {}; + if (!options.test) { + options.test = { + test: () => true + } as any; + } + this.options = options; + } + + /** + * Apply the plugin + * @param compiler the compiler instance + * @returns + */ + apply(compiler: Compiler): void { + const options = this.options; + compiler.hooks.compilation.tap("LoaderOptionsPlugin", compilation => { + NormalModule.getCompilationHooks(compilation).loader.tap( + "LoaderOptionsPlugin", + context => { + const resource = context.resourcePath; + if (!resource) return; + if (ModuleFilenameHelpers.matchObject(options, resource)) { + for (const key of Object.keys(options)) { + if (key === "include" || key === "exclude" || key === "test") { + continue; + } + (context as any)[key] = options[key as keyof MatchObject]; + } + } + } + ); + }); + } +} diff --git a/packages/rspack/src/lib/LoaderTargetPlugin.js b/packages/rspack/src/lib/LoaderTargetPlugin.js deleted file mode 100644 index f32f5cea15b..00000000000 --- a/packages/rspack/src/lib/LoaderTargetPlugin.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -const NormalModule = require("../NormalModule"); - -// /** @typedef {import("./Compiler")} Compiler */ -/** @typedef {any} Compiler */ - -class LoaderTargetPlugin { - /** - * @param {string} target the target - */ - constructor(target) { - this.target = target; - } - - /** - * Apply the plugin - * @param {Compiler} compiler the compiler instance - * @returns {void} - */ - apply(compiler) { - // @ts-expect-error - compiler.hooks.compilation.tap("LoaderTargetPlugin", compilation => { - // @ts-expect-error - NormalModule.getCompilationHooks(compilation).loader.tap( - "LoaderTargetPlugin", - // @ts-expect-error - loaderContext => { - loaderContext.target = this.target; - } - ); - }); - } -} - -export { LoaderTargetPlugin }; diff --git a/packages/rspack/src/lib/LoaderTargetPlugin.ts b/packages/rspack/src/lib/LoaderTargetPlugin.ts new file mode 100644 index 00000000000..f9a415d2db4 --- /dev/null +++ b/packages/rspack/src/lib/LoaderTargetPlugin.ts @@ -0,0 +1,36 @@ +/** + * The following code is modified based on + * https://github.com/webpack/webpack/blob/4b4ca3b/lib/LoaderTargetPlugin.js + * + * MIT Licensed + * Author Tobias Koppers @sokra + * Copyright (c) JS Foundation and other contributors + * https://github.com/webpack/webpack/blob/main/LICENSE + */ + +import type { Compiler } from "../Compiler"; +import NormalModule from "../NormalModule"; +import type { Target } from "../config"; + +export class LoaderTargetPlugin { + /** + * @param target the target + */ + constructor(public readonly target: Target) {} + + /** + * Apply the plugin + * @param compiler the compiler instance + * @returns + */ + apply(compiler: Compiler): void { + compiler.hooks.compilation.tap("LoaderTargetPlugin", compilation => { + NormalModule.getCompilationHooks(compilation).loader.tap( + "LoaderTargetPlugin", + loaderContext => { + loaderContext.target = this.target; + } + ); + }); + } +} diff --git a/packages/rspack/src/lib/ModuleFilenameHelpers.ts b/packages/rspack/src/lib/ModuleFilenameHelpers.ts index 2ad27a15f6c..600855631ef 100644 --- a/packages/rspack/src/lib/ModuleFilenameHelpers.ts +++ b/packages/rspack/src/lib/ModuleFilenameHelpers.ts @@ -1,3 +1,13 @@ +/** + * The following code is modified based on + * https://github.com/webpack/webpack/blob/4b4ca3b/lib/ModuleFilenameHelpers.js + * + * MIT Licensed + * Author Tobias Koppers @sokra + * Copyright (c) JS Foundation and other contributors + * https://github.com/webpack/webpack/blob/main/LICENSE + */ + type Matcher = string | RegExp | (string | RegExp)[]; /** @@ -29,7 +39,7 @@ export const matchPart = (str: string, test: Matcher) => { return asRegExp(test).test(str); }; -interface MatchObject { +export interface MatchObject { test?: Matcher; include?: Matcher; exclude?: Matcher; diff --git a/packages/rspack/src/lib/NormalModuleReplacementPlugin.ts b/packages/rspack/src/lib/NormalModuleReplacementPlugin.ts index e08ca5336e1..55f509d895d 100644 --- a/packages/rspack/src/lib/NormalModuleReplacementPlugin.ts +++ b/packages/rspack/src/lib/NormalModuleReplacementPlugin.ts @@ -1,7 +1,11 @@ /** - * Based on [webpack/lib/NormalModuleReplacementPlugin.js]{@link https://github.com/webpack/webpack/blob/29cc4ead7eb6aafc3a5f6d0b10ce41d33d1ad874/lib/NormalModuleReplacementPlugin.js} - * Licensed with [MIT License]{@link http://www.opensource.org/licenses/mit-license.php} - * Original Author Tobias Koppers @sokra + * The following code is modified based on + * https://github.com/webpack/webpack/blob/4b4ca3b/lib/NormalModuleReplacementPlugin.js + * + * MIT Licensed + * Author Tobias Koppers @sokra + * Copyright (c) JS Foundation and other contributors + * https://github.com/webpack/webpack/blob/main/LICENSE */ import * as NodePath from "node:path"; @@ -13,14 +17,20 @@ type ModuleReplacer = (createData: ResolveData) => void; export class NormalModuleReplacementPlugin { /** - * @param {RegExp} resourceRegExp the resource matcher - * @param {string|ModuleReplacer} newResource the resource replacement + * Create an instance of the plugin + * @param resourceRegExp the resource matcher + * @param newResource the resource replacement */ constructor( public readonly resourceRegExp: RegExp, public readonly newResource: string | ModuleReplacer ) {} + /** + * Apply the plugin + * @param compiler the compiler instance + * @returns + */ apply(compiler: Compiler) { const { resourceRegExp, newResource } = this; diff --git a/packages/rspack/src/lib/WebpackError.js b/packages/rspack/src/lib/WebpackError.js deleted file mode 100644 index 37182ce615c..00000000000 --- a/packages/rspack/src/lib/WebpackError.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Jarid Margolin @jaridmargolin -*/ - -"use strict"; - -const inspect = require("node:util").inspect.custom; - -// /** @typedef {import("./Chunk")} Chunk */ -// /** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ -// /** @typedef {import("./Module")} Module */ -/** @typedef {any} Chunk */ -/** @typedef {any} DependencyLocation */ -/** @typedef {any} Module */ - -class WebpackError extends Error { - /** - * Creates an instance of WebpackError. - * @param {string=} message error message - */ - constructor(message) { - super(message); - // @ts-expect-error - this.details = undefined; - /** @type {Module} */ - this.module = undefined; - /** @type {DependencyLocation} */ - this.loc = undefined; - /** @type {boolean} */ - // @ts-expect-error - this.hideStack = undefined; - /** @type {Chunk} */ - this.chunk = undefined; - /** @type {string} */ - // @ts-expect-error - this.file = undefined; - } - - [inspect]() { - return this.stack + (this.details ? `\n${this.details}` : ""); - } - - // serialize({ write }) { - // write(this.name); - // write(this.message); - // write(this.stack); - // write(this.details); - // write(this.loc); - // write(this.hideStack); - // } - // - // deserialize({ read }) { - // this.name = read(); - // this.message = read(); - // this.stack = read(); - // this.details = read(); - // this.loc = read(); - // this.hideStack = read(); - // } -} - -// makeSerializable(WebpackError, "webpack/lib/WebpackError"); - -module.exports = WebpackError; diff --git a/packages/rspack/src/lib/WebpackError.ts b/packages/rspack/src/lib/WebpackError.ts new file mode 100644 index 00000000000..2eb79b36991 --- /dev/null +++ b/packages/rspack/src/lib/WebpackError.ts @@ -0,0 +1,40 @@ +/** + * The following code is modified based on + * https://github.com/webpack/webpack/blob/4b4ca3b/lib/WebpackError.js + * + * MIT Licensed + * Author Tobias Koppers @sokra + * Copyright (c) JS Foundation and other contributors + * https://github.com/webpack/webpack/blob/main/LICENSE + */ + +import { inspect } from "node:util"; +import type { Chunk } from "../Chunk"; +import type { Module } from "../Module"; + +// Waiting to adapt +type DependencyLocation = any; + +export class WebpackError extends Error { + loc?: DependencyLocation; + file?: string; + chunk?: Chunk; + module?: Module; + details?: string; + hideStack?: boolean; + + /** + * Creates an instance of WebpackError. + * @param message error message + * @returns + */ + constructor(message?: string) { + super(message); + } + + [inspect.custom]() { + return this.stack + (this.details ? `\n${this.details}` : ""); + } +} + +export default WebpackError; diff --git a/packages/rspack/src/lib/cache/getLazyHashedEtag.js b/packages/rspack/src/lib/cache/getLazyHashedEtag.js deleted file mode 100644 index b69a0a0877c..00000000000 --- a/packages/rspack/src/lib/cache/getLazyHashedEtag.js +++ /dev/null @@ -1,84 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; - -const createHash = require("../../util/createHash"); - -// /** @typedef {import("../util/Hash")} Hash */ -// /** @typedef {typeof import("../util/Hash")} HashConstructor */ -/** @typedef {any} Hash */ -/** @typedef {any} HashConstructor */ - -/** - * @typedef {Object} HashableObject - * @property {function(Hash): void} updateHash - */ - -class LazyHashedEtag { - /** - * @param {HashableObject} obj object with updateHash method - * @param {string | HashConstructor} hashFunction the hash function to use - */ - constructor(obj, hashFunction = "md4") { - this._obj = obj; - this._hash = undefined; - this._hashFunction = hashFunction; - } - - /** - * @returns {string} hash of object - */ - toString() { - if (this._hash === undefined) { - // @ts-expect-error - const hash = createHash(this._hashFunction); - this._obj.updateHash(hash); - this._hash = /** @type {string} */ (hash.digest("base64")); - } - return this._hash; - } -} - -/** @type {Map>} */ -const mapStrings = new Map(); - -/** @type {WeakMap>} */ -const mapObjects = new WeakMap(); - -/** - * @param {HashableObject} obj object with updateHash method - * @param {string | HashConstructor} hashFunction the hash function to use - * @returns {LazyHashedEtag} etag - */ -const getter = (obj, hashFunction = "md4") => { - let innerMap; - if (typeof hashFunction === "string") { - innerMap = mapStrings.get(hashFunction); - if (innerMap === undefined) { - const newHash = new LazyHashedEtag(obj, hashFunction); - innerMap = new WeakMap(); - innerMap.set(obj, newHash); - mapStrings.set(hashFunction, innerMap); - return newHash; - } - } else { - innerMap = mapObjects.get(hashFunction); - if (innerMap === undefined) { - const newHash = new LazyHashedEtag(obj, hashFunction); - innerMap = new WeakMap(); - innerMap.set(obj, newHash); - mapObjects.set(hashFunction, innerMap); - return newHash; - } - } - const hash = innerMap.get(obj); - if (hash !== undefined) return hash; - const newHash = new LazyHashedEtag(obj, hashFunction); - innerMap.set(obj, newHash); - return newHash; -}; - -module.exports = getter; diff --git a/packages/rspack/src/lib/cache/getLazyHashedEtag.ts b/packages/rspack/src/lib/cache/getLazyHashedEtag.ts new file mode 100644 index 00000000000..567a2658c3b --- /dev/null +++ b/packages/rspack/src/lib/cache/getLazyHashedEtag.ts @@ -0,0 +1,97 @@ +/** + * The following code is modified based on + * https://github.com/webpack/webpack/blob/4b4ca3b/lib/cache/getLazyHashedEtag.js + * + * MIT Licensed + * Author Tobias Koppers @sokra + * Copyright (c) JS Foundation and other contributors + * https://github.com/webpack/webpack/blob/main/LICENSE + */ + +import { createHash } from "../../util/createHash"; +import type Hash from "../../util/hash"; + +export type HashConstructor = typeof Hash; + +export interface HashableObject { + updateHash(hash: Hash): void; +} + +class LazyHashedEtag { + _obj: HashableObject; + _hash?: string; + _hashFunction: string | HashConstructor; + + /** + * @param obj object with updateHash method + * @param hashFunction the hash function to use + */ + constructor( + obj: HashableObject, + hashFunction: string | HashConstructor = "md4" + ) { + this._obj = obj; + this._hash = undefined; + this._hashFunction = hashFunction; + } + + /** + * @returns hash of object + */ + toString(): string { + if (this._hash === undefined) { + const hash = createHash(this._hashFunction); + this._obj.updateHash(hash); + this._hash = hash.digest("base64") as string; + } + return this._hash; + } +} + +const mapStrings = new Map< + string | HashConstructor, + WeakMap +>(); + +const mapObjects = new WeakMap< + HashConstructor, + WeakMap +>(); + +/** + * @param obj object with updateHash method + * @param ashFunction the hash function to use + * @returns etag + */ +export const getter = ( + obj: HashableObject, + hashFunction: string | HashConstructor = "md4" +): LazyHashedEtag => { + let innerMap; + if (typeof hashFunction === "string") { + innerMap = mapStrings.get(hashFunction); + if (innerMap === undefined) { + const newHash = new LazyHashedEtag(obj, hashFunction); + innerMap = new WeakMap(); + innerMap.set(obj, newHash); + mapStrings.set(hashFunction, innerMap); + return newHash; + } + } else { + innerMap = mapObjects.get(hashFunction); + if (innerMap === undefined) { + const newHash = new LazyHashedEtag(obj, hashFunction); + innerMap = new WeakMap(); + innerMap.set(obj, newHash); + mapObjects.set(hashFunction, innerMap); + return newHash; + } + } + const hash = innerMap.get(obj); + if (hash !== undefined) return hash; + const newHash = new LazyHashedEtag(obj, hashFunction); + innerMap.set(obj, newHash); + return newHash; +}; + +export default getter; diff --git a/packages/rspack/src/lib/cache/mergeEtags.js b/packages/rspack/src/lib/cache/mergeEtags.ts similarity index 65% rename from packages/rspack/src/lib/cache/mergeEtags.js rename to packages/rspack/src/lib/cache/mergeEtags.ts index 6699e3c2db8..2de9402f57d 100644 --- a/packages/rspack/src/lib/cache/mergeEtags.js +++ b/packages/rspack/src/lib/cache/mergeEtags.ts @@ -1,18 +1,24 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; +/** + * The following code is modified based on + * https://github.com/webpack/webpack/blob/4b4ca3b/lib/cache/mergeEtags.js + * + * MIT Licensed + * Author Tobias Koppers @sokra + * Copyright (c) JS Foundation and other contributors + * https://github.com/webpack/webpack/blob/main/LICENSE + */ -/** @typedef {import("../Cache").Etag} Etag */ +import type { Etag } from "../Cache"; class MergedEtag { + a: Etag; + b: Etag; + /** - * @param {Etag} a first - * @param {Etag} b second + * @param a first + * @param b second */ - constructor(a, b) { + constructor(a: Etag, b: Etag) { this.a = a; this.b = b; } @@ -26,11 +32,11 @@ const dualObjectMap = new WeakMap(); const objectStringMap = new WeakMap(); /** - * @param {Etag} a first - * @param {Etag} b second - * @returns {Etag} result + * @param a first + * @param b second + * @returns result */ -const mergeEtags = (a, b) => { +export const mergeEtags = (a: Etag, b: Etag): Etag => { if (typeof a === "string") { if (typeof b === "string") { return `${a}|${b}`; @@ -68,4 +74,4 @@ const mergeEtags = (a, b) => { return mergedEtag; }; -module.exports = mergeEtags; +export default mergeEtags; diff --git a/packages/rspack/src/lib/formatLocation.js b/packages/rspack/src/lib/formatLocation.ts similarity index 66% rename from packages/rspack/src/lib/formatLocation.js rename to packages/rspack/src/lib/formatLocation.ts index feeaa664d72..6ec32d593f1 100644 --- a/packages/rspack/src/lib/formatLocation.js +++ b/packages/rspack/src/lib/formatLocation.ts @@ -1,20 +1,22 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -"use strict"; +/** + * The following code is modified based on + * https://github.com/webpack/webpack/blob/4b4ca3b/lib/formatLocation.js + * + * MIT Licensed + * Author Tobias Koppers @sokra + * Copyright (c) JS Foundation and other contributors + * https://github.com/webpack/webpack/blob/main/LICENSE + */ -// /** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ -// /** @typedef {import("./Dependency").SourcePosition} SourcePosition */ -/** @typedef {any} DependencyLocation */ -/** @typedef {any} SourcePosition */ +// Waiting to adapt +type DependencyLocation = any; +type SourcePosition = any; /** - * @param {SourcePosition} pos position - * @returns {string} formatted position + * @param pos position + * @returns formatted position */ -const formatPosition = pos => { +const formatPosition = (pos: SourcePosition): string => { if (pos && typeof pos === "object") { if ("line" in pos && "column" in pos) { return `${pos.line}:${pos.column}`; @@ -27,10 +29,10 @@ const formatPosition = pos => { }; /** - * @param {DependencyLocation} loc location - * @returns {string} formatted location + * @param loc location + * @returns formatted location */ -const formatLocation = loc => { +const formatLocation = (loc: DependencyLocation): string => { if (loc && typeof loc === "object") { if ("start" in loc && loc.start && "end" in loc && loc.end) { if ( @@ -68,4 +70,4 @@ const formatLocation = loc => { return ""; }; -module.exports = formatLocation; +export default formatLocation; diff --git a/packages/rspack/src/rspackOptionsApply.ts b/packages/rspack/src/rspackOptionsApply.ts index 7b5f4c1afaf..65d06b69802 100644 --- a/packages/rspack/src/rspackOptionsApply.ts +++ b/packages/rspack/src/rspackOptionsApply.ts @@ -67,7 +67,7 @@ import { WorkerPlugin } from "./builtin-plugin"; import EntryOptionPlugin from "./lib/EntryOptionPlugin"; -import IgnoreWarningsPlugin from "./lib/ignoreWarningsPlugin"; +import IgnoreWarningsPlugin from "./lib/IgnoreWarningsPlugin"; import { DefaultStatsFactoryPlugin } from "./stats/DefaultStatsFactoryPlugin"; import { DefaultStatsPresetPlugin } from "./stats/DefaultStatsPresetPlugin"; import { DefaultStatsPrinterPlugin } from "./stats/DefaultStatsPrinterPlugin";