/* * This file was automatically generated. * DO NOT MODIFY BY HAND. * Run `yarn fix:special` to update */ import { Parser as ParserImport } from "acorn"; import { Buffer } from "buffer"; import { ArrayExpression, ArrayPattern, ArrowFunctionExpression, AssignmentExpression, AssignmentPattern, AssignmentProperty, AwaitExpression, BigIntLiteral, BinaryExpression, BlockStatement, BreakStatement, CatchClause, ChainExpression, ClassBody, ClassDeclaration, ClassExpression, Comment as CommentImport, ConditionalExpression, ContinueStatement, DebuggerStatement, Directive, DoWhileStatement, EmptyStatement, ExportAllDeclaration, ExportDefaultDeclaration, ExportNamedDeclaration, ExportSpecifier, ExpressionStatement, ForInStatement, ForOfStatement, ForStatement, FunctionDeclaration, FunctionExpression, Identifier, IfStatement, ImportDeclaration, ImportDefaultSpecifier, ImportExpression as ImportExpressionImport, ImportNamespaceSpecifier, ImportSpecifier, LabeledStatement, LogicalExpression, MaybeNamedClassDeclaration, MaybeNamedFunctionDeclaration, MemberExpression, MetaProperty, MethodDefinition, NewExpression, ObjectExpression, ObjectPattern, PrivateIdentifier, Program, Property, PropertyDefinition, RegExpLiteral, RestElement, ReturnStatement, SequenceExpression, SimpleCallExpression, SimpleLiteral, SourceLocation, SpreadElement, StaticBlock, Super, SwitchCase, SwitchStatement, TaggedTemplateExpression, TemplateElement, TemplateLiteral, ThisExpression, ThrowStatement, TryStatement, UnaryExpression, UpdateExpression, VariableDeclaration, VariableDeclarator, WhileStatement, WithStatement, YieldExpression } from "estree"; import { IncomingMessage, Server as ServerImportHttp, ServerOptions as ServerOptionsImportHttp } from "http"; import { Server as ServerImportHttps, ServerOptions as ServerOptionsImportHttps } from "https"; import { Session as SessionImportInspectorClass_1, Session as SessionImportInspectorClass_2 } from "inspector"; import { JSONSchema4, JSONSchema6, JSONSchema7 } from "json-schema"; import { ListenOptions } from "net"; import { ExtendedSchema, ValidationErrorConfiguration, validate as validateFunction } from "schema-utils"; import { default as ValidationError } from "schema-utils/declarations/ValidationError"; import { AsArray, AsyncParallelHook, AsyncSeriesBailHook, AsyncSeriesHook, AsyncSeriesWaterfallHook, HookMap, IfSet, MultiHook, SyncBailHook, SyncHook, SyncWaterfallHook, TapOptions, TypedHookMap } from "tapable"; import { URL } from "url"; import { Context as ContextImport } from "vm"; declare interface Abortable { signal?: AbortSignal; } /** * Represents AbstractLibraryPlugin. */ declare class AbstractLibraryPlugin { /** * Creates an instance of AbstractLibraryPlugin. */ constructor(__0: AbstractLibraryPluginOptions); /** * Applies the plugin by registering its hooks on the compiler. */ apply(compiler: Compiler): void; /** * Returns preprocess as needed by overriding. */ parseOptions(library: LibraryOptions): T; /** * Finish entry module. */ finishEntryModule( module: Module, entryName: string, libraryContext: LibraryContext ): void; /** * Embed in runtime bailout. */ embedInRuntimeBailout( module: Module, renderContext: RenderContextJavascriptModulesPlugin, libraryContext: LibraryContext ): undefined | string; /** * Strict runtime bailout. */ strictRuntimeBailout( renderContext: RenderContextJavascriptModulesPlugin, libraryContext: LibraryContext ): undefined | string; /** * Processes the provided chunk. */ runtimeRequirements( chunk: Chunk, set: Set, libraryContext: LibraryContext ): void; /** * Returns source with library export. */ render( source: Source, renderContext: RenderContextJavascriptModulesPlugin, libraryContext: LibraryContext ): Source; /** * Renders source with library export. */ renderStartup( source: Source, module: Module, renderContext: StartupRenderContext, libraryContext: LibraryContext ): Source; /** * Renders module content. */ renderModuleContent( source: Source, module: Module, renderContext: ModuleRenderContext, libraryContext: Omit, "options"> ): Source; /** * Processes the provided chunk. */ chunkHash( chunk: Chunk, hash: Hash, chunkHashContext: ChunkHashContext, libraryContext: LibraryContext ): void; static COMMON_LIBRARY_NAME_MESSAGE: string; } declare interface AbstractLibraryPluginOptions { /** * name of the plugin */ pluginName: string; /** * used library type */ type: string; } declare interface AdditionalData { [index: string]: any; webpackAST: object; } type AfterContextResolveData = ContextResolveData & ContextOptions & { resource: string | string[]; resourceQuery?: string; resourceFragment?: string; resolveDependencies: ( fs: InputFileSystem, options: ContextModuleOptions, callback: ( err: null | Error, dependencies?: ContextElementDependency[] ) => void ) => void; }; declare class AggressiveMergingPlugin { /** * Creates an instance of AggressiveMergingPlugin. */ constructor(options?: AggressiveMergingPluginOptions); options: AggressiveMergingPluginOptions; /** * Applies the plugin by registering its hooks on the compiler. */ apply(compiler: Compiler): void; } declare interface AggressiveMergingPluginOptions { /** * minimal size reduction to trigger merging */ minSizeReduce?: number; } declare class AggressiveSplittingPlugin { /** * Creates an instance of AggressiveSplittingPlugin. */ constructor(options?: AggressiveSplittingPluginOptions); options: AggressiveSplittingPluginOptions; /** * Applies the plugin by registering its hooks on the compiler. */ apply(compiler: Compiler): void; /** * Was chunk recorded. */ static wasChunkRecorded(chunk: Chunk): boolean; } declare interface AggressiveSplittingPluginOptions { /** * Extra cost for each chunk (Default: 9.8kiB). */ chunkOverhead?: number; /** * Extra cost multiplicator for entry chunks (Default: 10). */ entryChunkMultiplicator?: number; /** * Byte, max size of per file (Default: 50kiB). */ maxSize?: number; /** * Byte, split point. (Default: 30kiB). */ minSize?: number; } type Alias = string | false | string[]; declare interface AliasOption { alias: Alias; name: string; onlyModule?: boolean; } declare interface AllCodeGenerationSchemas { /** * top level declarations for javascript modules */ topLevelDeclarations: Set; /** * free identifier names in the rendered source for javascript modules */ freeNames: Set; /** * chunk init fragments for javascript modules */ chunkInitFragments: InitFragment[]; /** * url for asset modules */ url: { javascript?: string; "asset-url"?: string }; /** * a filename for asset modules */ filename: string; /** * an asset info for asset modules */ assetInfo: AssetInfo; /** * a full content hash for asset modules */ fullContentHash: string; /** * share-init for modules federation */ "share-init": [{ shareScope: string; initStage: number; init: string }]; } type AnyLoaderContext = NormalModuleLoaderContext & LoaderRunnerLoaderContext & LoaderPluginLoaderContext & HotModuleReplacementPluginLoaderContext; /** * Returns object of arguments. */ declare interface Argument { description?: string; simpleType: SimpleType; multiple: boolean; configs: ArgumentConfig[]; } /** * Returns object of arguments. */ declare interface ArgumentConfig { description?: string; negatedDescription?: string; path: string; multiple: boolean; type: "string" | "number" | "boolean" | "path" | "enum" | "RegExp" | "reset"; values?: EnumValue[]; } declare interface Asset { /** * the filename of the asset */ name: string; /** * source of the asset */ source: Source; /** * info about the asset */ info: AssetInfo; } declare abstract class AssetBytesGenerator extends Generator { /** * Generates fallback output for the provided error condition. */ generateError( error: Error, module: NormalModule, generateContext: GenerateContext ): null | Source; } declare abstract class AssetBytesParser extends ParserClass {} declare interface AssetDependencyMeta { sourceType: "asset-url" | "css-url"; } /** * Checks whether this object is sorted. */ declare interface AssetEmittedInfo { content: Buffer; source: Source; compilation: Compilation; outputPath: string; targetPath: string; } type AssetFilterItemTypes = string | RegExp | ((name: string, asset: StatsAsset) => boolean); declare abstract class AssetGenerator extends Generator { dataUrlOptions?: | AssetGeneratorDataUrlOptions | (( source: string | Buffer, context: { filename: string; module: Module } ) => string); filename?: string | TemplatePathFn; publicPath?: string | TemplatePathFn; outputPath?: string | TemplatePathFn; emit?: boolean; /** * Returns mime type. */ getMimeType(module: NormalModule): string; /** * Generates data uri. */ generateDataUri(module: NormalModule): string; /** * Generates fallback output for the provided error condition. */ generateError( error: Error, module: NormalModule, generateContext: GenerateContext ): null | Source; } /** * Options object for data url generation. */ declare interface AssetGeneratorDataUrlOptions { /** * Asset encoding (defaults to base64). */ encoding?: false | "base64"; /** * Asset mimetype (getting from file extension by default). */ mimetype?: string; } type AssetGeneratorOptions = AssetInlineGeneratorOptions & AssetResourceGeneratorOptions; type AssetInfo = KnownAssetInfo & Record; /** * Generator options for asset/inline modules. */ declare interface AssetInlineGeneratorOptions { /** * Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text. */ binary?: boolean; /** * The options for data url generator. */ dataUrl?: | AssetGeneratorDataUrlOptions | (( source: string | Buffer, context: { filename: string; module: Module } ) => string); } type AssetModuleBuildInfo = KnownBuildInfo & Record & KnownNormalModuleBuildInfo & KnownAssetModuleBuildInfo; declare abstract class AssetParser extends ParserClass { dataUrlCondition?: | boolean | AssetParserDataUrlOptions | (( source: string | Buffer, context: { filename: string; module: Module } ) => boolean); } /** * Options object for DataUrl condition. */ declare interface AssetParserDataUrlOptions { /** * Maximum size of asset that should be inline as modules. Default: 8kb. */ maxSize?: number; } /** * Parser options for asset modules. */ declare interface AssetParserOptions { /** * The condition for inlining the asset as DataUrl. */ dataUrlCondition?: | AssetParserDataUrlOptions | (( source: string | Buffer, context: { filename: string; module: Module } ) => boolean); } /** * Generator options for asset/resource modules. */ declare interface AssetResourceGeneratorOptions { /** * Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text. */ binary?: boolean; /** * Emit an output asset from this asset module. This can be set to 'false' to omit emitting e. g. for SSR. */ emit?: boolean; /** * The filename of asset modules as relative path inside the 'output.path' directory. */ filename?: string | TemplatePathFn; /** * Emit the asset in the specified folder relative to 'output.path'. This should only be needed when custom 'publicPath' is specified to match the folder structure there. */ outputPath?: string | TemplatePathFn; /** * The 'publicPath' specifies the public URL address of the output files when referenced in a browser. */ publicPath?: string | TemplatePathFn; } declare abstract class AssetSourceGenerator extends Generator { /** * Generates fallback output for the provided error condition. */ generateError( error: Error, module: NormalModule, generateContext: GenerateContext ): null | Source; } declare abstract class AssetSourceParser extends ParserClass {} declare class AsyncDependenciesBlock extends DependenciesBlock { constructor( groupOptions: null | string | GroupOptionsAsyncDependenciesBlock, loc?: null | SyntheticDependencyLocation | RealDependencyLocation, request?: null | string ); groupOptions: GroupOptionsAsyncDependenciesBlock; loc?: null | SyntheticDependencyLocation | RealDependencyLocation; request?: null | string; chunkName?: null | string; get circular(): boolean; module: any; } /** * Represents AsyncQueue. */ declare abstract class AsyncQueue { hooks: { beforeAdd: AsyncSeriesHook<[T]>; added: SyncHook<[T]>; beforeStart: AsyncSeriesHook<[T]>; started: SyncHook<[T]>; result: SyncHook< [T, undefined | null | WebpackError, undefined | null | R] >; }; /** * Returns context of execution. */ getContext(): string; /** * Updates context using the provided value. */ setContext(value: string): void; /** * Processes the provided item. */ add(item: T, callback: CallbackAsyncQueue): void; /** * Processes the provided item. */ invalidate(item: T): void; /** * Waits for an already started item */ waitFor(item: T, callback: CallbackAsyncQueue): void; /** * Describes how this stop operation behaves. */ stop(): void; /** * Increase parallelism. */ increaseParallelism(): void; /** * Decrease parallelism. */ decreaseParallelism(): void; /** * Checks whether this async queue is processing. */ isProcessing(item: T): boolean; /** * Checks whether this async queue is queued. */ isQueued(item: T): boolean; /** * Checks whether this async queue is done. */ isDone(item: T): boolean; clear(): void; } declare class AsyncWebAssemblyModulesPlugin { /** * Creates an instance of AsyncWebAssemblyModulesPlugin. */ constructor(options: AsyncWebAssemblyModulesPluginOptions); options: AsyncWebAssemblyModulesPluginOptions; /** * Applies the plugin by registering its hooks on the compiler. */ apply(compiler: Compiler): void; /** * Renders the newly generated source from rendering. */ renderModule( module: Module, renderContext: WebAssemblyRenderContext, hooks: CompilationHooks ): Source; static getCompilationHooks: (compilation: Compilation) => CompilationHooks; } declare interface AsyncWebAssemblyModulesPluginOptions { /** * mangle imports */ mangleImports?: boolean; } declare abstract class AsyncWebAssemblyParser extends ParserClass {} /** * Records modules from one compilation and adds them back as prefetch * dependencies in the next compilation. */ declare class AutomaticPrefetchPlugin { constructor(); /** * Registers hooks that remember previously built normal modules and enqueue * them as `PrefetchDependency` requests during the next make phase. */ apply(compiler: Compiler): void; } type AuxiliaryComment = string | LibraryCustomUmdCommentObject; declare interface BackendApi { dispose: (callback: (err?: null | Error) => void) => void; module: (module: Module) => ModuleResult; } /** * Prepends or appends banner text to emitted assets that match the configured * file filters. */ declare class BannerPlugin { /** * Normalizes banner options and compiles the configured banner source into a * function that can render per-asset banner text. */ constructor(options: BannerPluginArgument); options: BannerPluginOptions; banner: (data: { hash?: string; chunk: Chunk; filename: string }) => string; /** * Validates the configured options and injects rendered banner comments into * matching compilation assets at the configured process-assets stage. */ apply(compiler: Compiler): void; } type BannerPluginArgument = | string | BannerPluginOptions | ((data: { hash?: string; chunk: Chunk; filename: string }) => string); declare interface BannerPluginOptions { /** * Specifies the banner. */ banner: | string | ((data: { hash?: string; chunk: Chunk; filename: string }) => string); /** * If true, the banner will only be added to the entry chunks. */ entryOnly?: boolean; /** * Exclude all modules matching any of these conditions. */ exclude?: string | RegExp | ((str: string) => boolean) | Rule[]; /** * If true, banner will be placed at the end of the output. */ footer?: boolean; /** * Include all modules matching any of these conditions. */ include?: string | RegExp | ((str: string) => boolean) | Rule[]; /** * If true, banner will not be wrapped in a comment. */ raw?: boolean; /** * Specifies the stage when add a banner. */ stage?: number; /** * Include all modules that pass test assertion. */ test?: string | RegExp | ((str: string) => boolean) | Rule[]; } declare interface BaseResolveRequest { /** * path */ path: string | false; /** * content */ context?: ContextTypes; /** * description file path */ descriptionFilePath?: string; /** * description file root */ descriptionFileRoot?: string; /** * description file data */ descriptionFileData?: JsonObjectTypes; /** * tsconfig paths map */ tsconfigPathsMap?: null | TsconfigPathsMap; /** * relative path */ relativePath?: string; /** * true when need to ignore symlinks, otherwise false */ ignoreSymlinks?: boolean; /** * true when full specified, otherwise false */ fullySpecified?: boolean; /** * inner request for internal usage */ __innerRequest?: string; /** * inner request for internal usage */ __innerRequest_request?: string; /** * inner relative path for internal usage */ __innerRequest_relativePath?: string; /** * internal: shared marker `RestrictionsPlugin` flips when it filters out an existing target, letting `ExportsFieldPlugin` fall back instead of erroring */ __restrictionsMarker?: { blocked: boolean }; } declare interface BasenameCacheEntry { /** * cached dirname function */ fn: (maybePath: string, suffix?: string) => string; /** * the underlying cache map */ cache: Map>; } /** * An instance is allocated for a large share of walked expressions, so the * boolean facts live in one packed flags slot and the scalar/identifier * fields in five slots shared by type, with accessors keeping every public * field readable. This shrinks instances from 224 to 144 bytes on V8. */ declare abstract class BasicEvaluatedExpression { expression?: | Program | ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | ImportExpressionImport | UnaryExpression | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ClassExpression | ConditionalExpression | FunctionExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UpdateExpression | YieldExpression | SpreadElement | PrivateIdentifier | Super | FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | ExportDefaultDeclaration | MethodDefinition | PropertyDefinition | VariableDeclarator | AssignmentProperty | Property | CatchClause | ClassBody | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | SwitchCase | TemplateElement; quasis?: BasicEvaluatedExpression[]; parts?: BasicEvaluatedExpression[]; items?: BasicEvaluatedExpression[]; options?: BasicEvaluatedExpression[]; prefix?: null | BasicEvaluatedExpression; postfix?: null | BasicEvaluatedExpression; wrappedInnerExpressions?: BasicEvaluatedExpression[]; /** * Served lazily from the attached expression when not set explicitly: * `evaluateExpression`'s plain results share the expression's range, and * most evaluations never read it, so the node's range array is only * materialized on demand. */ range?: [number, number]; type: number; truthy: boolean; falsy: boolean; nullish?: boolean; sideEffects: boolean; bool?: boolean; number?: number; bigint?: bigint; regExp?: RegExp; string?: string; templateStringKind?: "cooked" | "raw"; array?: any[]; identifier?: string | VariableInfo; rootInfo?: string | VariableInfo; getMembers?: () => string[]; getMembersOptionals?: () => boolean[]; getMemberRanges?: () => [number, number][]; isUnknown(): boolean; isNull(): boolean; isUndefined(): boolean; isString(): boolean; isNumber(): boolean; isBigInt(): boolean; isBoolean(): boolean; isRegExp(): boolean; isConditional(): boolean; isArray(): boolean; isConstArray(): boolean; isIdentifier(): boolean; isWrapped(): boolean; isTemplateString(): boolean; /** * Is expression a primitive or an object type value? */ isPrimitiveType(): undefined | boolean; /** * Is expression a runtime or compile-time value? */ isCompileTimeValue(): boolean; /** * As compile time value. */ asCompileTimeValue(): undefined | null | string | number | bigint | boolean | RegExp | any[]; isTruthy(): boolean; isFalsy(): boolean; isNullish(): undefined | boolean; /** * Can this expression have side effects? */ couldHaveSideEffects(): boolean; /** * Creates a boolean representation of this evaluated expression. */ asBool(): undefined | boolean; /** * Creates a nullish coalescing representation of this evaluated expression. */ asNullish(): undefined | boolean; /** * Creates a string representation of this evaluated expression. */ asString(): undefined | string; /** * Updates string using the provided string. */ setString(string: string): BasicEvaluatedExpression; setUndefined(): BasicEvaluatedExpression; setNull(): BasicEvaluatedExpression; /** * Set's the value of this expression to a number */ setNumber(number: number): BasicEvaluatedExpression; /** * Set's the value of this expression to a BigInt */ setBigInt(bigint: bigint): BasicEvaluatedExpression; /** * Set's the value of this expression to a boolean */ setBoolean(bool: boolean): BasicEvaluatedExpression; /** * Set's the value of this expression to a regular expression */ setRegExp(regExp: RegExp): BasicEvaluatedExpression; /** * Set's the value of this expression to a particular identifier and its members. */ setIdentifier( identifier: string | VariableInfo, rootInfo: string | VariableInfo, getMembers: () => string[], getMembersOptionals?: () => boolean[], getMemberRanges?: () => [number, number][] ): BasicEvaluatedExpression; /** * Wraps an array of expressions with a prefix and postfix expression. */ setWrapped( prefix?: null | BasicEvaluatedExpression, postfix?: null | BasicEvaluatedExpression, innerExpressions?: BasicEvaluatedExpression[] ): BasicEvaluatedExpression; /** * Stores the options of a conditional expression. */ setOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression; /** * Adds the provided basic evaluated expression to the basic evaluated expression. */ addOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression; /** * Set's the value of this expression to an array of expressions. */ setItems(items: BasicEvaluatedExpression[]): BasicEvaluatedExpression; /** * Set's the value of this expression to an array of strings. */ setArray(array: string[]): BasicEvaluatedExpression; /** * Set's the value of this expression to a processed/unprocessed template string. Used * for evaluating TemplateLiteral expressions in the JavaScript Parser. */ setTemplateString( quasis: BasicEvaluatedExpression[], parts: BasicEvaluatedExpression[], kind: "cooked" | "raw" ): BasicEvaluatedExpression; setTruthy(): BasicEvaluatedExpression; setFalsy(): BasicEvaluatedExpression; /** * Set's the value of the expression to nullish. */ setNullish(value: boolean): BasicEvaluatedExpression; /** * Set's the range for the expression. */ setRange(range: [number, number]): BasicEvaluatedExpression; /** * Set whether or not the expression has side effects. */ setSideEffects(sideEffects?: boolean): BasicEvaluatedExpression; /** * Set the expression node for the expression. */ setExpression( expression?: | Program | ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | ImportExpressionImport | UnaryExpression | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ClassExpression | ConditionalExpression | FunctionExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UpdateExpression | YieldExpression | SpreadElement | PrivateIdentifier | Super | FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | ExportDefaultDeclaration | MethodDefinition | PropertyDefinition | VariableDeclarator | AssignmentProperty | Property | CatchClause | ClassBody | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | SwitchCase | TemplateElement ): BasicEvaluatedExpression; } type BeforeContextResolveData = ContextResolveData & ContextOptions; declare interface Bootstrap { header: string[]; beforeStartup: string[]; startup: string[]; afterStartup: string[]; allowInlineStartup: boolean; } type BufferEncoding = | "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex"; type BufferEncodingOption = "buffer" | { encoding: "buffer" }; declare interface BufferEntry { map?: null | RawSourceMap; bufferedMap?: null | BufferedMap; } declare interface BufferedMap { /** * version */ version: number; /** * sources */ sources: string[]; /** * name */ names: string[]; /** * source root */ sourceRoot?: string; /** * sources content */ sourcesContent?: ("" | Buffer)[]; /** * mappings */ mappings?: Buffer; /** * file */ file: string; } type BuildInfo = KnownBuildInfo & Record; type BuildMeta = KnownBuildMeta & Record; declare abstract class ByTypeGenerator extends Generator { map: { [index: string]: undefined | Generator }; generateError?: ( error: Error, module: NormalModule, generateContext: GenerateContext ) => null | Source; } declare const CIRCULAR_CONNECTION: unique symbol; /** * Abstract cache interface backed by tapable hooks for reading, writing, idle * transitions, and shutdown across webpack cache implementations. */ declare class CacheClass { /** * Initializes the cache lifecycle hooks implemented by cache backends. */ constructor(); hooks: { get: AsyncSeriesBailHook<[string, null | Etag, GotHandler[]], any>; store: AsyncParallelHook<[string, null | Etag, any]>; storeBuildDependencies: AsyncParallelHook<[Iterable]>; beginIdle: SyncHook<[]>; endIdle: AsyncParallelHook<[]>; shutdown: AsyncParallelHook<[]>; }; /** * Retrieves a cached value and lets registered `gotHandlers` observe the * result before the caller receives it. */ get( identifier: string, etag: null | Etag, callback: CallbackCacheCache ): void; /** * Stores a cache entry for the identifier and etag through the registered * cache backend hooks. */ store( identifier: string, etag: null | Etag, data: T, callback: CallbackCacheCache ): void; /** * Persists the set of build dependencies required to determine whether the * cache can be restored in a future compilation. */ storeBuildDependencies( dependencies: Iterable, callback: CallbackCacheCache ): void; /** * Signals that webpack is entering an idle phase and cache backends may flush * or compact pending work. */ beginIdle(): void; /** * Signals that webpack is leaving the idle phase and waits for cache * backends to finish any asynchronous resume work. */ endIdle(callback: CallbackCacheCache): void; /** * Shuts down every registered cache backend and waits for cleanup to finish. */ shutdown(callback: CallbackCacheCache): void; static STAGE_MEMORY: number; static STAGE_DEFAULT: number; static STAGE_DISK: number; static STAGE_NETWORK: number; } declare abstract class CacheFacade { /** * Returns whether a cache backend is active. */ isEnabled(): boolean; /** * Returns child cache. */ getChildCache(name: string): CacheFacade; /** * Returns item cache. */ getItemCache(identifier: string, etag: null | Etag): ItemCacheFacade; /** * Gets lazy hashed etag. */ getLazyHashedEtag(obj: HashableObject): Etag; /** * Merges the provided values into a single result. */ mergeEtags(a: Etag, b: Etag): Etag; /** * Returns value. */ get( identifier: string, etag: null | Etag, callback: CallbackCacheCacheFacade ): void; /** * Returns promise with the data. */ getPromise(identifier: string, etag: null | Etag): Promise; /** * Processes the provided identifier. */ store( identifier: string, etag: null | Etag, data: T, callback: CallbackCacheCacheFacade ): void; /** * Stores the provided identifier. */ storePromise( identifier: string, etag: null | Etag, data: T ): Promise; /** * Processes the provided identifier. */ provide( identifier: string, etag: null | Etag, computer: (callback: CallbackNormalErrorCache) => void, callback: CallbackNormalErrorCache ): void; /** * Returns promise with the data. */ providePromise( identifier: string, etag: null | Etag, computer: () => T | Promise ): Promise; } declare interface CacheGroupSource { key: string; priority?: number; getName?: ( module: Module, chunks: Chunk[], key: string ) => undefined | string; chunksFilter?: (chunk: Chunk) => undefined | boolean; enforce?: boolean; minSize: SplitChunksSizes; minSizeReduction: SplitChunksSizes; minRemainingSize: SplitChunksSizes; enforceSizeThreshold: SplitChunksSizes; maxAsyncSize: SplitChunksSizes; maxInitialSize: SplitChunksSizes; minChunks?: number; maxAsyncRequests?: number; maxInitialRequests?: number; filename?: string | ((pathData: PathDataChunk, assetInfo?: AssetInfo) => string); idHint?: string; automaticNameDelimiter?: string; reuseExistingChunk?: boolean; usedExports?: boolean; } declare interface CacheGroupsContext { moduleGraph: ModuleGraph; chunkGraph: ChunkGraph; } type CacheOptionsNormalized = false | FileCacheOptions | MemoryCacheOptions; declare interface CacheTypes { [index: string]: undefined | ResolveRequest | ResolveRequest[]; } declare interface CachedData { /** * source */ source?: boolean; /** * buffer */ buffer: Buffer; /** * size */ size?: number; /** * maps */ maps: Map; /** * hash */ hash?: (string | Buffer)[]; } declare class CachedSource extends Source { constructor(source: Source | (() => Source), cachedData?: CachedData); getCachedData(): CachedData; originalLazy(): Source | (() => Source); original(): Source; streamChunks( options: StreamChunksOptions, onChunk: ( chunk: undefined | string, generatedLine: number, generatedColumn: number, sourceIndex: number, originalLine: number, originalColumn: number, nameIndex: number ) => void, onSource: ( sourceIndex: number, source: null | string, sourceContent?: string ) => void, onName: (nameIndex: number, name: string) => void ): GeneratedSourceInfo; } declare interface CalculatedStringResult { range?: [number, number]; value: string; code: boolean; conditional: false | CalculatedStringResult[]; } type CallExpression = SimpleCallExpression | NewExpression; declare interface CallExpressionInfo { type: "call"; call: CallExpression; calleeName: string; rootInfo: string | VariableInfo; getCalleeMembers: () => string[]; name: string; getMembers: () => string[]; getMembersOptionals: () => boolean[]; getMemberRanges: () => [number, number][]; } declare interface CallbackAsyncQueue { (err?: null | WebpackError, result?: null | T): void; } /** * Creates a callback wrapper that waits for a fixed number of completions and * forwards the first error immediately. */ declare interface CallbackCacheCache { /** * Creates a callback wrapper that waits for a fixed number of completions and * forwards the first error immediately. */ (err: null | Error, result?: T): void; } declare interface CallbackCacheCacheFacade { (err?: null | Error, result?: null | T): void; } declare interface CallbackNormalErrorCache { (err?: null | Error, result?: T): void; } /** * Creates a multi compiler. */ declare interface CallbackWebpackFunction_1 { /** * Creates a multi compiler. */ (err: null | Error, result?: T): void; } /** * Creates a multi compiler. */ declare interface CallbackWebpackFunction_2 { /** * Creates a multi compiler. */ (err: null | Error, result?: T): R; } type Cell = undefined | T; /** * A Chunk is a unit of encapsulation for Modules. * Chunks are "rendered" into bundles that get emitted when the build completes. */ declare class Chunk { /** * Creates an instance of Chunk. */ constructor(name?: null | string, backCompat?: boolean); id: null | string | number; ids: null | ChunkId[]; debugId: number; name?: null | string; idNameHints: SortableSet; preventIntegration: boolean; filenameTemplate?: string | ((pathData: PathDataChunk, assetInfo?: AssetInfo) => string); cssFilenameTemplate?: string | ((pathData: PathDataChunk, assetInfo?: AssetInfo) => string); runtime: RuntimeSpec; files: Set; auxiliaryFiles: Set; rendered: boolean; hash?: string; contentHash: Record; contentHashFull: Record; renderedHash?: string; chunkReason?: string; extraAsync: boolean; /** * Returns entry module. * @deprecated */ get entryModule(): Module; /** * Checks whether this chunk has an entry module. * @deprecated */ hasEntryModule(): boolean; /** * Adds the provided module to the chunk. * @deprecated */ addModule(module: Module): boolean; /** * Removes the provided module from the chunk. * @deprecated */ removeModule(module: Module): void; /** * Gets the number of modules in this chunk. * @deprecated */ getNumberOfModules(): number; /** * @deprecated */ get modulesIterable(): Iterable; /** * Compares this chunk with another chunk. * @deprecated */ compareTo(otherChunk: Chunk): 0 | 1 | -1; /** * Checks whether this chunk contains the module. * @deprecated */ containsModule(module: Module): boolean; /** * Returns the modules for this chunk. * @deprecated */ getModules(): Module[]; /** * Removes this chunk from the chunk graph and chunk groups. * @deprecated */ remove(): void; /** * Moves a module from this chunk to another chunk. * @deprecated */ moveModule(module: Module, otherChunk: Chunk): void; /** * Integrates another chunk into this chunk when possible. * @deprecated */ integrate(otherChunk: Chunk): boolean; /** * Checks whether this chunk can be integrated with another chunk. * @deprecated */ canBeIntegrated(otherChunk: Chunk): boolean; /** * Checks whether this chunk is empty. * @deprecated */ isEmpty(): boolean; /** * Returns the total size of all modules in this chunk. * @deprecated */ modulesSize(): number; /** * Returns the estimated size for the requested source type. * @deprecated */ size(options?: ChunkSizeOptions): number; /** * Returns the integrated size with another chunk. * @deprecated */ integratedSize(otherChunk: Chunk, options: ChunkSizeOptions): number; /** * Gets chunk module maps. * @deprecated */ getChunkModuleMaps(filterFn: (m: Module) => boolean): ChunkModuleMaps; /** * Checks whether this chunk contains a matching module in the graph. * @deprecated */ hasModuleInGraph( filterFn: (m: Module) => boolean, filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean ): boolean; /** * Returns the chunk map information. * @deprecated */ getChunkMaps(realHash: boolean): ChunkMaps; /** * Checks whether this chunk has runtime. */ hasRuntime(): boolean; /** * Checks whether it can be initial. */ canBeInitial(): boolean; /** * Checks whether this chunk is only initial. */ isOnlyInitial(): boolean; /** * Gets entry options. */ getEntryOptions(): undefined | EntryOptions; /** * Adds the provided chunk group to the chunk. */ addGroup(chunkGroup: ChunkGroup): void; /** * Removes the provided chunk group from the chunk. */ removeGroup(chunkGroup: ChunkGroup): void; /** * Checks whether this chunk is in group. */ isInGroup(chunkGroup: ChunkGroup): boolean; /** * Gets number of groups. */ getNumberOfGroups(): number; /** * Gets groups iterable. */ get groupsIterable(): SortableSet; /** * Disconnects from groups. */ disconnectFromGroups(): void; /** * Processes the provided new chunk. */ split(newChunk: Chunk): void; /** * Updates the hash with the data contributed by this instance. */ updateHash(hash: Hash, chunkGraph: ChunkGraph): void; /** * Gets all async chunks. */ getAllAsyncChunks(): Set; /** * Gets all initial chunks. */ getAllInitialChunks(): Set; /** * Gets all referenced chunks. */ getAllReferencedChunks(): Set; /** * Gets all referenced async entrypoints. */ getAllReferencedAsyncEntrypoints(): Set; /** * Checks whether this chunk has async chunks. */ hasAsyncChunks(): boolean; /** * Gets child ids by orders. */ getChildIdsByOrders( chunkGraph: ChunkGraph, filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean ): Record; /** * Gets children of type in order. */ getChildrenOfTypeInOrder( chunkGraph: ChunkGraph, type: string ): undefined | ChunkChildOfTypeInOrder[]; /** * Gets child ids by orders map. */ getChildIdsByOrdersMap( chunkGraph: ChunkGraph, includeDirectChildren?: boolean, filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean ): ChunkChildIdsByOrdersMapByData; /** * Checks whether this chunk contains the chunk graph. */ hasChildByOrder( chunkGraph: ChunkGraph, type: string, includeDirectChildren?: boolean, filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean ): boolean; } declare interface ChunkChildIdsByOrdersMap { [index: string]: ChunkId[]; } declare interface ChunkChildIdsByOrdersMapByData { [index: string]: ChunkChildIdsByOrdersMap; } declare interface ChunkChildOfTypeInOrder { onChunks: Chunk[]; chunks: Set; } declare interface ChunkConditionMap { [index: number]: boolean; [index: string]: boolean; } type ChunkFilenameTemplate = string | ((pathData: PathDataChunk, assetInfo?: AssetInfo) => string); declare class ChunkGraph { /** * Creates an instance of ChunkGraph. */ constructor(moduleGraph: ModuleGraph, hashFunction?: HashFunction); moduleGraph: ModuleGraph; /** * Connects chunk and module. */ connectChunkAndModule(chunk: Chunk, module: Module): void; /** * Disconnects chunk and module. */ disconnectChunkAndModule(chunk: Chunk, module: Module): void; /** * Processes the provided chunk. */ disconnectChunk(chunk: Chunk): void; /** * Processes the provided chunk. */ attachModules(chunk: Chunk, modules: Iterable): void; /** * Attach runtime modules. */ attachRuntimeModules(chunk: Chunk, modules: Iterable): void; /** * Attach full hash modules. */ attachFullHashModules(chunk: Chunk, modules: Iterable): void; /** * Attach dependent hash modules. */ attachDependentHashModules( chunk: Chunk, modules: Iterable ): void; /** * Processes the provided old module. */ replaceModule(oldModule: Module, newModule: Module): void; /** * Checks whether this chunk graph is module in chunk. */ isModuleInChunk(module: Module, chunk: Chunk): boolean; /** * Checks whether this chunk graph is module in chunk group. */ isModuleInChunkGroup(module: Module, chunkGroup: ChunkGroup): boolean; /** * Checks whether this chunk graph is entry module. */ isEntryModule(module: Module): boolean; /** * Gets module chunks iterable. */ getModuleChunksIterable(module: Module): Iterable; /** * Gets ordered module chunks iterable. */ getOrderedModuleChunksIterable( module: Module, sortFn: (a: Chunk, b: Chunk) => 0 | 1 | -1 ): Iterable; /** * Gets module chunks. */ getModuleChunks(module: Module): Chunk[]; /** * Gets number of module chunks. */ getNumberOfModuleChunks(module: Module): number; /** * Gets module runtimes. */ getModuleRuntimes(module: Module): RuntimeSpecSet; /** * Gets number of chunk modules. */ getNumberOfChunkModules(chunk: Chunk): number; /** * Gets number of chunk full hash modules. */ getNumberOfChunkFullHashModules(chunk: Chunk): number; /** * Gets chunk modules iterable. */ getChunkModulesIterable(chunk: Chunk): Iterable; /** * Gets chunk modules iterable by source type. */ getChunkModulesIterableBySourceType( chunk: Chunk, sourceType: string ): undefined | Iterable; /** * Sets chunk module source types. */ setChunkModuleSourceTypes( chunk: Chunk, module: Module, sourceTypes: ReadonlySet ): void; /** * Gets chunk module source types. */ getChunkModuleSourceTypes(chunk: Chunk, module: Module): ReadonlySet; /** * Gets module source types. */ getModuleSourceTypes(module: Module): ReadonlySet; /** * Gets ordered chunk modules iterable. */ getOrderedChunkModulesIterable( chunk: Chunk, comparator: (a: Module, b: Module) => 0 | 1 | -1 ): Iterable; /** * Gets ordered chunk modules iterable by source type. */ getOrderedChunkModulesIterableBySourceType( chunk: Chunk, sourceType: string, comparator: (a: Module, b: Module) => 0 | 1 | -1 ): undefined | Iterable; /** * Gets chunk modules. */ getChunkModules(chunk: Chunk): Module[]; /** * Gets ordered chunk modules. */ getOrderedChunkModules( chunk: Chunk, comparator: (a: Module, b: Module) => 0 | 1 | -1 ): Module[]; /** * Gets chunk module id map. */ getChunkModuleIdMap( chunk: Chunk, filterFn: (m: Module) => boolean, includeAllChunks?: boolean ): ChunkModuleIdMapEs5Alias_2; /** * Gets chunk module rendered hash map. */ getChunkModuleRenderedHashMap( chunk: Chunk, filterFn: (m: Module) => boolean, hashLength?: number, includeAllChunks?: boolean ): ChunkModuleHashMap; /** * Gets chunk condition map. */ getChunkConditionMap( chunk: Chunk, filterFn: (c: Chunk, chunkGraph: ChunkGraph) => boolean ): ChunkConditionMap; /** * Checks whether this chunk graph contains the chunk. */ hasModuleInGraph( chunk: Chunk, filterFn: (m: Module) => boolean, filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean ): boolean; /** * Compares the provided values and returns their ordering. */ compareChunks(chunkA: Chunk, chunkB: Chunk): 0 | 1 | -1; /** * Gets chunk modules size. */ getChunkModulesSize(chunk: Chunk): number; /** * Gets chunk modules sizes. */ getChunkModulesSizes(chunk: Chunk): Record; /** * Gets chunk root modules. */ getChunkRootModules(chunk: Chunk): Module[]; /** * Returns total size of the chunk. */ getChunkSize(chunk: Chunk, options?: ChunkSizeOptions): number; /** * Gets integrated chunks size. */ getIntegratedChunksSize( chunkA: Chunk, chunkB: Chunk, options?: ChunkSizeOptions ): number; /** * Checks whether it can chunks be integrated. */ canChunksBeIntegrated(chunkA: Chunk, chunkB: Chunk): boolean; /** * Processes the provided chunk a. */ integrateChunks(chunkA: Chunk, chunkB: Chunk): void; /** * Upgrade dependent to full hash modules. */ upgradeDependentToFullHashModules(chunk: Chunk): void; /** * Checks whether this chunk graph is entry module in chunk. */ isEntryModuleInChunk(module: Module, chunk: Chunk): boolean; /** * Connects chunk and entry module. */ connectChunkAndEntryModule( chunk: Chunk, module: Module, entrypoint: Entrypoint ): void; /** * Connects chunk and runtime module. */ connectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void; /** * Adds full hash module to chunk. */ addFullHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void; /** * Adds dependent hash module to chunk. */ addDependentHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void; /** * Disconnects chunk and entry module. */ disconnectChunkAndEntryModule(chunk: Chunk, module: Module): void; /** * Disconnects chunk and runtime module. */ disconnectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void; /** * Disconnects entry module. */ disconnectEntryModule(module: Module): void; /** * Disconnects entries. */ disconnectEntries(chunk: Chunk): void; /** * Gets number of entry modules. */ getNumberOfEntryModules(chunk: Chunk): number; /** * Gets number of runtime modules. */ getNumberOfRuntimeModules(chunk: Chunk): number; /** * Gets chunk entry modules iterable. */ getChunkEntryModulesIterable(chunk: Chunk): Iterable; /** * Gets chunk entry dependent chunks iterable. */ getChunkEntryDependentChunksIterable(chunk: Chunk): Iterable; /** * Gets runtime chunk dependent chunks iterable. */ getRuntimeChunkDependentChunksIterable(chunk: Chunk): Iterable; /** * Checks whether this chunk graph contains the chunk. */ hasChunkEntryDependentChunks(chunk: Chunk): boolean; /** * Gets chunk runtime modules iterable. */ getChunkRuntimeModulesIterable(chunk: Chunk): Iterable; /** * Gets chunk runtime modules in order. */ getChunkRuntimeModulesInOrder(chunk: Chunk): RuntimeModule[]; /** * Gets chunk full hash modules iterable. */ getChunkFullHashModulesIterable( chunk: Chunk ): undefined | Iterable; /** * Gets chunk full hash modules set. */ getChunkFullHashModulesSet( chunk: Chunk ): undefined | ReadonlySet; /** * Gets chunk dependent hash modules iterable. */ getChunkDependentHashModulesIterable( chunk: Chunk ): undefined | Iterable; /** * Gets chunk entry modules with chunk group iterable. */ getChunkEntryModulesWithChunkGroupIterable( chunk: Chunk ): Iterable<[Module, undefined | Entrypoint]>; /** * Gets block chunk group. */ getBlockChunkGroup(depBlock: AsyncDependenciesBlock): undefined | ChunkGroup; /** * Connects block and chunk group. */ connectBlockAndChunkGroup( depBlock: AsyncDependenciesBlock, chunkGroup: ChunkGroup ): void; /** * Disconnects chunk group. */ disconnectChunkGroup(chunkGroup: ChunkGroup): void; /** * Returns the id of the module. */ getModuleId(module: Module): null | string | number; /** * Updates module id using the provided module. */ setModuleId(module: Module, id: ModuleId): void; /** * Returns the id of the runtime. */ getRuntimeId(runtime: string): RuntimeId; /** * Updates runtime id using the provided runtime. */ setRuntimeId(runtime: string, id: RuntimeId): void; /** * Checks whether this chunk graph contains the module. */ hasModuleHashes(module: Module, runtime: RuntimeSpec): boolean; /** * Returns hash. */ getModuleHash(module: Module, runtime: RuntimeSpec): string; /** * Gets rendered module hash. */ getRenderedModuleHash(module: Module, runtime: RuntimeSpec): string; /** * Sets module hashes. */ setModuleHashes( module: Module, runtime: RuntimeSpec, hash: string, renderedHash: string ): void; /** * Adds module runtime requirements. */ addModuleRuntimeRequirements( module: Module, runtime: RuntimeSpec, items: Set, transferOwnership?: boolean ): void; /** * Adds chunk runtime requirements. */ addChunkRuntimeRequirements(chunk: Chunk, items: Set): void; /** * Adds tree runtime requirements. */ addTreeRuntimeRequirements(chunk: Chunk, items: Iterable): void; /** * Gets module runtime requirements. */ getModuleRuntimeRequirements( module: Module, runtime: RuntimeSpec ): ReadonlySet; /** * Gets chunk runtime requirements. */ getChunkRuntimeRequirements(chunk: Chunk): ReadonlySet; /** * Gets module graph hash. */ getModuleGraphHash( module: Module, runtime: RuntimeSpec, withConnections?: boolean ): string; /** * Gets module graph hash big int. */ getModuleGraphHashBigInt( module: Module, runtime: RuntimeSpec, withConnections?: boolean ): bigint; /** * Gets tree runtime requirements. */ getTreeRuntimeRequirements(chunk: Chunk): ReadonlySet; /** * Gets chunk graph for module. * @deprecated */ static getChunkGraphForModule( module: Module, deprecateMessage: string, deprecationCode: string ): ChunkGraph; /** * Sets chunk graph for module. * @deprecated */ static setChunkGraphForModule(module: Module, chunkGraph: ChunkGraph): void; /** * Clear chunk graph for module. * @deprecated */ static clearChunkGraphForModule(module: Module): void; /** * Gets chunk graph for chunk. * @deprecated */ static getChunkGraphForChunk( chunk: Chunk, deprecateMessage: string, deprecationCode: string ): ChunkGraph; /** * Sets chunk graph for chunk. * @deprecated */ static setChunkGraphForChunk(chunk: Chunk, chunkGraph: ChunkGraph): void; /** * Clear chunk graph for chunk. * @deprecated */ static clearChunkGraphForChunk(chunk: Chunk): void; } /** * Represents a connected group of chunks along with the parent/child * relationships, async blocks, and traversal metadata webpack tracks for it. */ declare abstract class ChunkGroup { groupDebugId: number; options: ChunkGroupOptions; chunks: Chunk[]; origins: OriginRecord[]; index?: number; /** * Merges additional options into the chunk group. * Order-based options are combined by taking the higher priority, while * unsupported conflicts surface as an explicit error. */ addOptions(options: ChunkGroupOptions): void; /** * Returns the configured name of the chunk group, if one was assigned. * Updates the configured name of the chunk group. */ name?: null | string; /** * Returns a debug-only identifier derived from the group's member chunk * debug ids. This is primarily useful in diagnostics and assertions. */ get debugId(): string; /** * Returns an identifier derived from the ids of the chunks currently in * the group. */ get id(): string; /** * Moves a chunk to the front of the group or inserts it when it is not * already present. */ unshiftChunk(chunk: Chunk): boolean; /** * Inserts a chunk directly before another chunk that already belongs to the * group, preserving the rest of the ordering. */ insertChunk(chunk: Chunk, before: Chunk): boolean; /** * Appends a chunk to the group when it is not already a member. */ pushChunk(chunk: Chunk): boolean; /** * Replaces one member chunk with another while preserving the group's * ordering and avoiding duplicates. */ replaceChunk(oldChunk: Chunk, newChunk: Chunk): undefined | boolean; /** * Removes a chunk from this group. */ removeChunk(chunk: Chunk): boolean; /** * Indicates whether this chunk group is loaded as part of the initial page * load instead of being created lazily. */ isInitial(): boolean; /** * Adds a child chunk group to the current group. */ addChild(group: ChunkGroup): boolean; /** * Returns the child chunk groups reachable from this group. */ getChildren(): ChunkGroup[]; getNumberOfChildren(): number; get childrenIterable(): SortableSet; /** * Removes a child chunk group and clears the corresponding parent link on * the removed child. */ removeChild(group: ChunkGroup): boolean; /** * Records a parent chunk group relationship. */ addParent(parentChunk: ChunkGroup): boolean; /** * Returns the parent chunk groups that can lead to this group. */ getParents(): ChunkGroup[]; getNumberOfParents(): number; /** * Checks whether the provided group is registered as a parent. */ hasParent(parent: ChunkGroup): boolean; get parentsIterable(): SortableSet; /** * Removes a parent chunk group and clears the reverse child relationship. */ removeParent(chunkGroup: ChunkGroup): boolean; /** * Registers an async entrypoint that is rooted in this chunk group. */ addAsyncEntrypoint(entrypoint: Entrypoint): boolean; get asyncEntrypointsIterable(): SortableSet; /** * Returns the async dependency blocks that create or reference this group. */ getBlocks(): AsyncDependenciesBlock[]; getNumberOfBlocks(): number; /** * Checks whether an async dependency block is associated with this group. */ hasBlock(block: AsyncDependenciesBlock): boolean; /** * Exposes the group's async dependency blocks as an iterable. */ get blocksIterable(): Iterable; /** * Associates an async dependency block with this chunk group. */ addBlock(block: AsyncDependenciesBlock): boolean; /** * Records where this chunk group originated from in user code. * The origin is used for diagnostics, ordering, and reporting. */ addOrigin( module: null | Module, loc: DependencyLocation, request: string ): void; /** * Collects the emitted files produced by every chunk in the group. */ getFiles(): string[]; /** * Disconnects this group from its parents, children, and chunks. * Child groups are reconnected to this group's parents so the surrounding * graph remains intact after removal. */ remove(): void; sortItems(): void; /** * Sorting predicate which allows current ChunkGroup to be compared against another. * Sorting values are based off of number of chunks in ChunkGroup. */ compareTo(chunkGraph: ChunkGraph, otherGroup: ChunkGroup): 0 | 1 | -1; /** * Aggregates per-block `*Order` options for the blocks that bridge this * chunk group to the given child chunk group. `*Order` options are tied to * the originating `import()` call and must not be sourced from the child's * shared options, otherwise a webpackPrefetch/Preload directive from one * parent would leak into other parents that share the child by name. */ getChildOrderOptions( childGroup: ChunkGroup, chunkGraph: ChunkGraph ): Record; /** * Groups child chunk groups by their `*Order` options and sorts each group * by descending order and deterministic chunk-group comparison. */ getChildrenByOrders( moduleGraph: ModuleGraph, chunkGraph: ChunkGraph ): Record; /** * Stores the module's top-down traversal index within this group. */ setModulePreOrderIndex(module: Module, index: number): void; /** * Returns the module's top-down traversal index within this group. */ getModulePreOrderIndex(module: Module): undefined | number; /** * Stores the module's bottom-up traversal index within this group. */ setModulePostOrderIndex(module: Module, index: number): void; /** * Returns the module's bottom-up traversal index within this group. */ getModulePostOrderIndex(module: Module): undefined | number; checkConstraints(): void; getModuleIndex: (module: Module) => undefined | number; getModuleIndex2: (module: Module) => undefined | number; } declare interface ChunkGroupInfoWithName { name: string; chunkGroup: ChunkGroup; } type ChunkGroupOptions = RawChunkGroupOptions & { name?: null | string }; declare interface ChunkHashContext { /** * results of code generation */ codeGenerationResults: CodeGenerationResults; /** * the runtime template */ runtimeTemplate: RuntimeTemplate; /** * the module graph */ moduleGraph: ModuleGraph; /** * the chunk graph */ chunkGraph: ChunkGraph; } declare interface ChunkHashes { [index: number]: string; [index: string]: string; } type ChunkId = string | number; declare interface ChunkMaps { hash: Record; contentHash: Record>; name: Record; } declare interface ChunkModuleHashMap { [index: number]: IdToHashMap; [index: string]: IdToHashMap; } declare interface ChunkModuleHashes { [index: string]: string; } declare interface ChunkModuleIdMapEs5Alias_1 { [index: number]: ChunkId[]; [index: string]: ChunkId[]; } declare interface ChunkModuleIdMapEs5Alias_2 { [index: number]: ModuleId[]; [index: string]: ModuleId[]; } declare class ChunkModuleIdRangePlugin { /** * Creates an instance of ChunkModuleIdRangePlugin. */ constructor(options: ChunkModuleIdRangePluginOptions); options: ChunkModuleIdRangePluginOptions; /** * Applies the plugin by registering its hooks on the compiler. */ apply(compiler: Compiler): void; } declare interface ChunkModuleIdRangePluginOptions { /** * the chunk name */ name: string; /** * order */ order?: "index" | "index2" | "preOrderIndex" | "postOrderIndex"; /** * start id */ start?: number; /** * end id */ end?: number; } declare interface ChunkModuleIds { [index: number]: ModuleId[]; [index: string]: ModuleId[]; } declare interface ChunkModuleMaps { id: ChunkModuleIdMapEs5Alias_1; hash: chunkModuleHashMap; } type ChunkName = null | string; declare interface ChunkPathData { id: string | number; name?: string; hash: string; hashWithLength?: (length: number) => string; /** * builds `[chunkhash:]` per chunk in the runtime chunk-filename map */ hashWithDigest?: (digest: string, length?: number) => string; contentHash?: Record; contentHashWithLength?: Record string>; /** * builds `[contenthash:]` per chunk in the runtime chunk-filename map */ contentHashWithDigest?: Record< string, (digest: string, length?: number) => string >; } /** * Adds runtime support for chunk prefetch and preload relationships discovered * in the chunk graph. */ declare class ChunkPrefetchPreloadPlugin { constructor(); /** * Registers compilation hooks that emit the runtime modules responsible for * scheduling chunk prefetch and preload requests. */ apply(compiler: Compiler): void; } declare interface ChunkRenderContextCssModulesPlugin { /** * the chunk */ chunk?: Chunk; /** * the chunk graph */ chunkGraph?: ChunkGraph; /** * results of code generation */ codeGenerationResults?: CodeGenerationResults; /** * the runtime template */ runtimeTemplate: RuntimeTemplate; /** * undo path to css file */ undoPath: string; /** * compilation hash */ hash?: string; /** * moduleFactoryCache */ moduleFactoryCache: WeakMap; /** * content */ moduleSourceContent: Source; } declare interface ChunkRenderContextJavascriptModulesPlugin { /** * the chunk */ chunk: Chunk; /** * the dependency templates */ dependencyTemplates: DependencyTemplates; /** * the runtime template */ runtimeTemplate: RuntimeTemplate; /** * the module graph */ moduleGraph: ModuleGraph; /** * the chunk graph */ chunkGraph: ChunkGraph; /** * results of code generation */ codeGenerationResults: CodeGenerationResults; /** * init fragments for the chunk */ chunkInitFragments: InitFragment[]; /** * rendering in strict context */ strictMode?: boolean; /** * entry module inlined at the chunk top level instead of the registry */ inlinedEntryModule?: Module; /** * rendered body of the inlined entry module */ inlinedEntrySource?: Source; } declare interface ChunkRuntime { [index: number]: string; [index: string]: string; } declare interface ChunkSizeOptions { /** * constant overhead for a chunk */ chunkOverhead?: number; /** * multiplicator for initial chunks */ entryChunkMultiplicator?: number; } declare abstract class ChunkTemplate { hooks: Readonly<{ renderManifest: { tap: ( options: string | (TapOptions & { name: string } & IfSet), fn: ( renderManifestEntries: RenderManifestEntry[], renderManifestOptions: RenderManifestOptions ) => RenderManifestEntry[] ) => void; }; modules: { tap: ( options: string | (TapOptions & { name: string } & IfSet), fn: ( source: Source, moduleTemplate: ModuleTemplate, renderContext: RenderContextJavascriptModulesPlugin ) => Source ) => void; }; render: { tap: ( options: string | (TapOptions & { name: string } & IfSet), fn: ( source: Source, moduleTemplate: ModuleTemplate, renderContext: RenderContextJavascriptModulesPlugin ) => Source ) => void; }; renderWithEntry: { tap: ( options: string | (TapOptions & { name: string } & IfSet), fn: (source: Source, chunk: Chunk) => Source ) => void; }; hash: { tap: ( options: string | (TapOptions & { name: string } & IfSet), fn: (hash: Hash) => void ) => void; }; hashForChunk: { tap: ( options: string | (TapOptions & { name: string } & IfSet), fn: ( hash: Hash, chunk: Chunk, chunkHashContext: ChunkHashContext ) => void ) => void; }; }>; get outputOptions(): OutputNormalizedWithDefaults; } /** * Advanced options for cleaning assets. */ declare interface CleanOptions { /** * Log the assets that should be removed instead of deleting them. */ dry?: boolean; /** * Keep these assets. */ keep?: string | RegExp | ((path: string) => undefined | boolean); } declare class CleanPlugin { constructor(options?: CleanOptions); options: CleanOptions; /** * Applies the plugin by registering its hooks on the compiler. */ apply(compiler: Compiler): void; static getCompilationHooks: (compilation: Compilation) => { /** * When returning true the file/directory will be kept during cleaning, returning false will clean it and ignore the following plugins and config. * @since 5.20.0 */ keep: SyncBailHook<[string], boolean | void>; }; } declare interface ClearCacheOptions { /** * drop cached source maps (default `true`) */ maps?: boolean; /** * drop cached source/buffer copies (default `true`) */ source?: boolean; /** * drop the parsed object form of cached source maps on `SourceMapSource` instances (default `false` — re-parsing JSON is significantly more expensive than `toString`). Only takes effect when a serialized form (buffer or string) is also retained, so the data remains recoverable. */ parsedMap?: boolean; } declare interface CodeGenMapOverloads { get: (key: K) => undefined | CodeGenValue; set: ( key: K, value: CodeGenValue ) => CodeGenerationResultData; has: (key: K) => boolean; delete: (key: K) => boolean; } type CodeGenValue = K extends | "filename" | "assetInfo" | "share-init" | "topLevelDeclarations" | "freeNames" | "chunkInitFragments" | "url" | "fullContentHash" ? AllCodeGenerationSchemas[K] : any; declare interface CodeGenerationContext { /** * the dependency templates */ dependencyTemplates: DependencyTemplates; /** * the runtime template */ runtimeTemplate: RuntimeTemplate; /** * the module graph */ moduleGraph: ModuleGraph; /** * the chunk graph */ chunkGraph: ChunkGraph; /** * the runtimes code should be generated for */ runtime: RuntimeSpec; /** * all runtimes code should be generated for */ runtimes: RuntimeSpec[]; /** * when in concatenated module, information about other concatenated modules */ concatenationScope?: ConcatenationScope; /** * code generation results of other modules (need to have a codeGenerationDependency to use that) */ codeGenerationResults?: CodeGenerationResults; /** * the compilation */ compilation?: Compilation; /** * source types */ sourceTypes?: ReadonlySet; } declare interface CodeGenerationJob { module: Module; hash: string; runtime: RuntimeSpec; runtimes: RuntimeSpec[]; } declare interface CodeGenerationResult { /** * the resulting sources for all source types */ sources: Map; /** * the resulting data for all source types */ data?: CodeGenerationResultData; /** * the runtime requirements */ runtimeRequirements: null | ReadonlySet; /** * a hash of the code generation result (will be automatically calculated from sources and runtimeRequirements if not provided) */ hash?: string; } type CodeGenerationResultData = Omit< Map, "get" | "set" | "has" | "delete" > & CodeGenMapOverloads; /** * Stores code generation results keyed by module and runtime so later stages * can retrieve emitted sources, metadata, and derived hashes. */ declare abstract class CodeGenerationResults { map: Map>; /** * Returns the code generation result for a module/runtime pair, rejecting * ambiguous lookups where no unique runtime-independent result exists. */ get(module: Module, runtime: RuntimeSpec): CodeGenerationResult; /** * Reports whether a module has a stored result for the requested runtime, or * a single unambiguous result when no runtime is specified. */ has(module: Module, runtime: RuntimeSpec): boolean; /** * Returns a generated source of the requested source type from a stored code * generation result. */ getSource(module: Module, runtime: RuntimeSpec, sourceType: string): Source; /** * Returns the runtime requirements captured during code generation for the * requested module/runtime pair. */ getRuntimeRequirements( module: Module, runtime: RuntimeSpec ): null | ReadonlySet; /** * Returns an arbitrary metadata entry recorded during code generation. */ getData(module: Module, runtime: RuntimeSpec, key: string): any; /** * Returns a stable hash for the generated sources and runtime requirements, * computing and caching it on first access. */ getHash(module: Module, runtime: RuntimeSpec): string; /** * Stores a code generation result for a module/runtime pair, creating the * per-module runtime map when needed. */ add(module: Module, runtime: RuntimeSpec, result: CodeGenerationResult): void; } type CodeValue = | undefined | null | string | number | bigint | boolean | Function | RegExp | RuntimeValue | { [index: string]: RecursiveArrayOrRecord< | undefined | null | string | number | bigint | boolean | Function | RegExp | RuntimeValue >; } | RecursiveArrayOrRecord< | undefined | null | string | number | bigint | boolean | Function | RegExp | RuntimeValue >[]; type CodeValuePrimitive = undefined | null | string | number | bigint | boolean | Function | RegExp; declare interface Colors { reset: (value?: any) => string; bold: (value?: any) => string; dim: (value?: any) => string; italic: (value?: any) => string; underline: (value?: any) => string; inverse: (value?: any) => string; hidden: (value?: any) => string; strikethrough: (value?: any) => string; black: (value?: any) => string; red: (value?: any) => string; green: (value?: any) => string; yellow: (value?: any) => string; blue: (value?: any) => string; magenta: (value?: any) => string; cyan: (value?: any) => string; white: (value?: any) => string; gray: (value?: any) => string; bgBlack: (value?: any) => string; bgRed: (value?: any) => string; bgGreen: (value?: any) => string; bgYellow: (value?: any) => string; bgBlue: (value?: any) => string; bgMagenta: (value?: any) => string; bgCyan: (value?: any) => string; bgWhite: (value?: any) => string; blackBright: (value?: any) => string; redBright: (value?: any) => string; greenBright: (value?: any) => string; yellowBright: (value?: any) => string; blueBright: (value?: any) => string; magentaBright: (value?: any) => string; cyanBright: (value?: any) => string; whiteBright: (value?: any) => string; bgBlackBright: (value?: any) => string; bgRedBright: (value?: any) => string; bgGreenBright: (value?: any) => string; bgYellowBright: (value?: any) => string; bgBlueBright: (value?: any) => string; bgMagentaBright: (value?: any) => string; bgCyanBright: (value?: any) => string; bgWhiteBright: (value?: any) => string; } /** * Creates a colors from the provided colors option. */ declare interface ColorsOptions { /** * force use colors */ useColor?: boolean; } type CommentJavascriptParser = CommentImport & { start: number; end: number; loc?: null | SourceLocation; }; declare interface CommonJsImportSettings { name?: string; context: string; } declare interface Comparator { (a: T, b: T): 0 | 1 | -1; } declare class CompatSource extends Source { constructor(sourceLike: SourceLike); static from(sourceLike: SourceLike): Source; } declare interface CompatibilitySettings { name: string; declaration: CompatibilitySettingsDeclaration; } declare interface CompatibilitySettingsDeclaration { updated: boolean; loc: DependencyLocation; range: [number, number]; } declare class Compilation { /** * Creates an instance of Compilation. */ constructor(compiler: Compiler, params: CompilationParams); hooks: Readonly<{ buildModule: SyncHook<[Module]>; rebuildModule: SyncHook<[Module]>; failedModule: SyncHook<[Module, WebpackError]>; succeedModule: SyncHook<[Module]>; stillValidModule: SyncHook<[Module]>; addEntry: SyncHook<[Dependency, EntryOptions]>; failedEntry: SyncHook<[Dependency, EntryOptions, Error]>; succeedEntry: SyncHook<[Dependency, EntryOptions, Module]>; dependencyReferencedExports: SyncWaterfallHook< [(string[] | ReferencedExport)[], Dependency, RuntimeSpec], (string[] | ReferencedExport)[] >; /** * @since 5.32.0 */ executeModule: SyncHook<[ExecuteModuleArgument, ExecuteModuleContext]>; /** * @since 5.33.0 */ prepareModuleExecution: AsyncParallelHook< [ExecuteModuleArgument, ExecuteModuleContext] >; finishModules: AsyncSeriesHook<[Iterable]>; finishRebuildingModule: AsyncSeriesHook<[Module]>; unseal: SyncHook<[]>; seal: SyncHook<[]>; beforeChunks: SyncHook<[]>; /** * The `afterChunks` hook is called directly after the chunks and module graph have * been created and before the chunks and modules have been optimized. This hook is useful to * inspect, analyze, and/or modify the chunk graph. */ afterChunks: SyncHook<[Iterable]>; optimizeDependencies: SyncBailHook<[Iterable], boolean | void>; afterOptimizeDependencies: SyncHook<[Iterable]>; optimize: SyncHook<[]>; optimizeModules: SyncBailHook<[Iterable], boolean | void>; afterOptimizeModules: SyncHook<[Iterable]>; optimizeChunks: SyncBailHook< [Iterable, ChunkGroup[]], boolean | void >; afterOptimizeChunks: SyncHook<[Iterable, ChunkGroup[]]>; optimizeTree: AsyncSeriesHook<[Iterable, Iterable]>; afterOptimizeTree: SyncHook<[Iterable, Iterable]>; optimizeChunkModules: AsyncSeriesBailHook< [Iterable, Iterable], void >; afterOptimizeChunkModules: SyncHook<[Iterable, Iterable]>; shouldRecord: SyncBailHook<[], boolean | void>; additionalChunkRuntimeRequirements: SyncHook< [Chunk, Set, RuntimeRequirementsContext] >; runtimeRequirementInChunk: HookMap< SyncBailHook<[Chunk, Set, RuntimeRequirementsContext], void> >; additionalModuleRuntimeRequirements: SyncHook< [Module, Set, RuntimeRequirementsContext] >; runtimeRequirementInModule: HookMap< SyncBailHook<[Module, Set, RuntimeRequirementsContext], void> >; additionalTreeRuntimeRequirements: SyncHook< [Chunk, Set, RuntimeRequirementsContext] >; runtimeRequirementInTree: HookMap< SyncBailHook<[Chunk, Set, RuntimeRequirementsContext], void> >; runtimeModule: SyncHook<[RuntimeModule, Chunk]>; reviveModules: SyncHook<[Iterable, Records]>; beforeModuleIds: SyncHook<[Iterable]>; moduleIds: SyncHook<[Iterable]>; optimizeModuleIds: SyncHook<[Iterable]>; afterOptimizeModuleIds: SyncHook<[Iterable]>; reviveChunks: SyncHook<[Iterable, Records]>; beforeChunkIds: SyncHook<[Iterable]>; chunkIds: SyncHook<[Iterable]>; optimizeChunkIds: SyncHook<[Iterable]>; afterOptimizeChunkIds: SyncHook<[Iterable]>; recordModules: SyncHook<[Iterable, Records]>; recordChunks: SyncHook<[Iterable, Records]>; optimizeCodeGeneration: SyncHook<[Iterable]>; beforeModuleHash: SyncHook<[]>; afterModuleHash: SyncHook<[]>; beforeCodeGeneration: SyncHook<[]>; afterCodeGeneration: SyncHook<[]>; beforeRuntimeRequirements: SyncHook<[]>; afterRuntimeRequirements: SyncHook<[]>; beforeHash: SyncHook<[]>; contentHash: SyncHook<[Chunk]>; afterHash: SyncHook<[]>; recordHash: SyncHook<[Records]>; record: SyncHook<[Compilation, Records]>; beforeModuleAssets: SyncHook<[]>; shouldGenerateChunkAssets: SyncBailHook<[], boolean | void>; beforeChunkAssets: SyncHook<[]>; /** * @deprecated */ additionalChunkAssets: FakeHook< Pick< AsyncSeriesHook<[Set]>, "name" | "tap" | "tapAsync" | "tapPromise" > >; /** * @deprecated */ additionalAssets: FakeHook< Pick, "name" | "tap" | "tapAsync" | "tapPromise"> >; /** * @deprecated */ optimizeChunkAssets: FakeHook< Pick< AsyncSeriesHook<[Set]>, "name" | "tap" | "tapAsync" | "tapPromise" > >; /** * @deprecated */ afterOptimizeChunkAssets: FakeHook< Pick< AsyncSeriesHook<[Set]>, "name" | "tap" | "tapAsync" | "tapPromise" > >; /** * @deprecated */ optimizeAssets: AsyncSeriesHook< [CompilationAssets], ProcessAssetsAdditionalOptions >; /** * @deprecated */ afterOptimizeAssets: SyncHook<[CompilationAssets]>; processAssets: AsyncSeriesHook< [CompilationAssets], ProcessAssetsAdditionalOptions >; afterProcessAssets: SyncHook<[CompilationAssets]>; /** * @since 5.8.0 */ processAdditionalAssets: AsyncSeriesHook<[CompilationAssets]>; needAdditionalSeal: SyncBailHook<[], boolean | void>; afterSeal: AsyncSeriesHook<[]>; renderManifest: SyncWaterfallHook< [RenderManifestEntry[], RenderManifestOptions], RenderManifestEntry[] >; fullHash: SyncHook<[Hash]>; chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>; moduleAsset: SyncHook<[Module, string]>; chunkAsset: SyncHook<[Chunk, string]>; assetPath: SyncWaterfallHook< [string, PathData, undefined | AssetInfo], string >; needAdditionalPass: SyncBailHook<[], boolean | void>; childCompiler: SyncHook<[Compiler, string, number]>; log: SyncBailHook<[string, LogEntry], boolean | void>; processWarnings: SyncWaterfallHook<[Error[]], Error[]>; processErrors: SyncWaterfallHook<[Error[]], Error[]>; statsPreset: HookMap< SyncHook<[Partial, CreateStatsOptionsContext]> >; statsNormalize: SyncHook< [Partial, CreateStatsOptionsContext] >; statsFactory: SyncHook<[StatsFactory, NormalizedStatsOptions]>; statsPrinter: SyncHook<[StatsPrinter, NormalizedStatsOptions]>; /** * Gets normal module loader. * @deprecated */ get normalModuleLoader(): SyncHook<[AnyLoaderContext, NormalModule]>; }>; name?: string; startTime?: number; endTime?: number; compiler: Compiler; resolverFactory: ResolverFactory; inputFileSystem: InputFileSystem; fileSystemInfo: FileSystemInfo; valueCacheVersions: Map; requestShortener: RequestShortener; compilerPath: string; logger: WebpackLogger; options: WebpackOptionsNormalizedWithDefaults; outputOptions: OutputNormalizedWithDefaults; bail: boolean; profile: boolean; params: CompilationParams; mainTemplate: MainTemplate; chunkTemplate: ChunkTemplate; runtimeTemplate: RuntimeTemplate; moduleTemplates: ModuleTemplates; moduleMemCaches?: Map>; moduleMemCaches2?: Map>; moduleGraph: ModuleGraph; chunkGraph: ChunkGraph; codeGenerationResults?: CodeGenerationResults; processDependenciesQueue: AsyncQueue; addModuleQueue: AsyncQueue; factorizeQueue: AsyncQueue< FactorizeModuleOptions, string, Module | ModuleFactoryResult >; buildQueue: AsyncQueue; rebuildQueue: AsyncQueue; /** * Modules in value are building during the build of Module in key. * Means value blocking key from finishing. * Needed to detect build cycles. */ creatingModuleDuringBuild: WeakMap>; entries: Map; globalEntry: EntryData; entrypoints: Map; asyncEntrypoints: Entrypoint[]; chunks: Set; chunkGroups: ChunkGroup[]; namedChunkGroups: Map; namedChunks: Map; modules: Set; records: null | Records; additionalChunkAssets: string[]; assets: CompilationAssets; assetsInfo: Map; errors: Error[]; warnings: Error[]; children: Compilation[]; logging: Map; dependencyFactories: Map; dependencyTemplates: DependencyTemplates; childrenCounters: Record; usedChunkIds: null | Set; usedModuleIds: null | Set; needAdditionalPass: boolean; builtModules: WeakSet; codeGeneratedModules: WeakSet; buildTimeExecutedModules: WeakSet; emittedAssets: Set; comparedForEmitAssets: Set; fileDependencies: LazySet; contextDependencies: LazySet; missingDependencies: LazySet; buildDependencies: LazySet; /** * @deprecated */ compilationDependencies: { add: (item: string) => LazySet }; getStats(): Stats; /** * Creates a stats options. */ createStatsOptions( optionsOrPreset?: string | boolean | StatsOptions, context?: CreateStatsOptionsContext ): NormalizedStatsOptions; /** * Creates a stats factory. */ createStatsFactory(options: NormalizedStatsOptions): StatsFactory; /** * Creates a stats printer. */ createStatsPrinter(options: NormalizedStatsOptions): StatsPrinter; /** * Returns the cache facade instance. */ getCache(name: string): CacheFacade; /** * Returns a logger with that name. */ getLogger(name: string | (() => string)): WebpackLogger; /** * Adds the provided module to the compilation. */ addModule( module: Module, callback: (err?: null | WebpackError, result?: null | Module) => void ): void; /** * Fetches a module from a compilation by its identifier */ getModule(module: Module): Module; /** * Attempts to search for a module by its identifier */ findModule(identifier: string): undefined | Module; /** * Schedules a build of the module object */ buildModule( module: Module, callback: (err?: null | WebpackError, result?: null | Module) => void ): void; /** * Process module dependencies. */ processModuleDependencies( module: Module, callback: (err?: null | WebpackError, result?: null | Module) => void ): void; /** * Process module dependencies non recursive. */ processModuleDependenciesNonRecursive(module: Module): void; /** * Processes the provided |. */ /** * Processes the provided module callback. */ factorizeModule( options: FactorizeModuleOptions & { factoryResult?: false }, callback: (err?: null | WebpackError, result?: null | Module) => void ): void; /** * Processes the provided |. */ /** * Processes the provided module factory result callback. */ factorizeModule( options: FactorizeModuleOptions & { factoryResult: true }, callback: ( err?: null | WebpackError, result?: null | ModuleFactoryResult ) => void ): void; /** * Handle module creation. */ handleModuleCreation( __0: HandleModuleCreationOptions, callback: (err?: null | WebpackError, result?: null | Module) => void ): void; /** * Adds the provided string to the compilation. */ addModuleChain( context: string, dependency: Dependency, callback: (err?: null | WebpackError, result?: null | Module) => void ): void; /** * Adds the provided object to the compilation. */ addModuleTree( __0: { /** * context string path */ context: string; /** * dependency used to create Module chain */ dependency: Dependency; /** * additional context info for the root module */ contextInfo?: Partial; }, callback: (err?: null | WebpackError, result?: null | Module) => void ): void; /** * Adds the provided string to the compilation. */ addEntry( context: string, entry: Dependency, optionsOrName: string | EntryOptions, callback: (err?: null | WebpackError, result?: null | Module) => void ): void; /** * Adds the provided string to the compilation. */ addInclude( context: string, dependency: Dependency, options: EntryOptions, callback: (err?: null | WebpackError, result?: null | Module) => void ): void; /** * Processes the provided module. */ rebuildModule( module: Module, callback: (err?: null | WebpackError, result?: null | Module) => void ): void; /** * Processes the provided callback. */ finish(callback: (err?: null | WebpackError) => void): void; unseal(): void; /** * Processes the provided callback. */ seal(callback: (err?: null | WebpackError) => void): void; /** * Report dependency errors and warnings. */ reportDependencyErrorsAndWarnings( module: Module, blocks: DependenciesBlock[] ): boolean; /** * Generates code and runtime requirements for this module. */ codeGeneration(callback: (err?: null | WebpackError) => void): void; /** * Process runtime requirements. */ processRuntimeRequirements(__0?: { /** * the chunk graph */ chunkGraph?: ChunkGraph; /** * modules */ modules?: Iterable; /** * chunks */ chunks?: Iterable; /** * codeGenerationResults */ codeGenerationResults?: CodeGenerationResults; /** * chunkGraphEntries */ chunkGraphEntries?: Iterable; }): void; /** * Adds runtime module. */ addRuntimeModule( chunk: Chunk, module: RuntimeModule, chunkGraph?: ChunkGraph ): void; /** * If `module` is passed, `loc` and `request` must also be passed. */ addChunkInGroup( groupOptions: string | ChunkGroupOptions, module?: Module, loc?: SyntheticDependencyLocation | RealDependencyLocation, request?: string ): ChunkGroup; /** * Adds the provided async entrypoint to this chunk group. */ addAsyncEntrypoint( options: EntryOptions, module: Module, loc: DependencyLocation, request: string ): Entrypoint; /** * This method first looks to see if a name is provided for a new chunk, * and first looks to see if any named chunks already exist and reuse that chunk instead. */ addChunk(name?: null | string): Chunk; /** * Processes the provided module. * @deprecated */ assignDepth(module: Module): void; /** * Assigns depth values to the provided modules. */ assignDepths(modules: Module[] | Set): void; /** * Gets dependency referenced exports. */ getDependencyReferencedExports( dependency: Dependency, runtime: RuntimeSpec ): (string[] | ReferencedExport)[]; /** * Removes reasons of dependency block. */ removeReasonsOfDependencyBlock( module: Module, block: DependenciesBlockLike ): void; /** * Patch chunks after reason removal. */ patchChunksAfterReasonRemoval(module: Module, chunk: Chunk): void; /** * Removes chunk from dependencies. */ removeChunkFromDependencies(block: DependenciesBlock, chunk: Chunk): void; assignRuntimeIds(): void; sortItemsWithChunkIds(): void; summarizeDependencies(): void; createModuleHashes(): void; createHash(): CodeGenerationJob[]; fullHash?: string; hash?: string; /** * Processes the provided file. */ emitAsset(file: string, source: Source, assetInfo?: AssetInfo): void; /** * Updates asset using the provided file. */ updateAsset( file: string, newSourceOrFunction: Source | ((source: Source) => Source), assetInfoUpdateOrFunction?: AssetInfo | ((assetInfo?: AssetInfo) => undefined | AssetInfo) ): void; /** * Processes the provided file. */ renameAsset(file: string, newFile: string): void; /** * Processes the provided file. */ deleteAsset(file: string): void; getAssets(): Readonly[]; /** * Returns the asset or undefined when not found. */ getAsset(name: string): undefined | Readonly; clearAssets(): void; createModuleAssets(): void; /** * Gets render manifest. */ getRenderManifest(options: RenderManifestOptions): RenderManifestEntry[]; /** * Creates a chunk assets. */ createChunkAssets(callback: (err?: null | WebpackError) => void): void; /** * Returns interpolated path. */ getPath( filename: string | TemplatePathFn, data?: T ): string; /** * Gets path with info. */ getPathWithInfo( filename: string | TemplatePathFn, data?: T ): InterpolatedPathAndAssetInfo; /** * Returns interpolated path. */ getAssetPath( filename: string | TemplatePathFn, data: T ): string; /** * Gets asset path with info. */ getAssetPathWithInfo( filename: string | TemplatePathFn, data: T ): InterpolatedPathAndAssetInfo; getWarnings(): Error[]; getErrors(): Error[]; /** * This function allows you to run another instance of webpack inside of webpack however as * a child with different settings and configurations (if desired) applied. It copies all hooks, plugins * from parent (or top level compiler) and creates a child Compilation */ createChildCompiler( name: string, outputOptions?: Partial, plugins?: ( | undefined | null | false | "" | 0 | ((this: Compiler, compiler: Compiler) => void) | WebpackPluginInstance )[] ): Compiler; /** * Processes the provided module. */ executeModule( module: Module, options: ExecuteModuleOptions, callback: ( err?: null | WebpackError, result?: null | ExecuteModuleResult ) => void ): void; checkConstraints(): void; /** * Add additional assets to the compilation. */ static PROCESS_ASSETS_STAGE_ADDITIONAL: number; /** * Basic preprocessing of assets. */ static PROCESS_ASSETS_STAGE_PRE_PROCESS: number; /** * Derive new assets from existing assets. * Existing assets should not be treated as complete. */ static PROCESS_ASSETS_STAGE_DERIVED: number; /** * Add additional sections to existing assets, like a banner or initialization code. */ static PROCESS_ASSETS_STAGE_ADDITIONS: number; /** * Optimize existing assets in a general way. */ static PROCESS_ASSETS_STAGE_OPTIMIZE: number; /** * Optimize the count of existing assets, e. g. by merging them. * Only assets of the same type should be merged. * For assets of different types see PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE. */ static PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT: number; /** * Optimize the compatibility of existing assets, e. g. add polyfills or vendor-prefixes. */ static PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY: number; /** * Optimize the size of existing assets, e. g. by minimizing or omitting whitespace. */ static PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE: number; /** * Add development tooling to assets, e. g. by extracting a SourceMap. */ static PROCESS_ASSETS_STAGE_DEV_TOOLING: number; /** * Optimize the count of existing assets, e. g. by inlining assets of into other assets. * Only assets of different types should be inlined. * For assets of the same type see PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT. */ static PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE: number; /** * Summarize the list of existing assets * e. g. creating an assets manifest of Service Workers. */ static PROCESS_ASSETS_STAGE_SUMMARIZE: number; /** * Optimize the hashes of the assets, e. g. by generating real hashes of the asset content. */ static PROCESS_ASSETS_STAGE_OPTIMIZE_HASH: number; /** * Optimize the transfer of existing assets, e. g. by preparing a compressed (gzip) file as separate asset. */ static PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER: number; /** * Analyse existing assets. */ static PROCESS_ASSETS_STAGE_ANALYSE: number; /** * Creating assets for reporting purposes. */ static PROCESS_ASSETS_STAGE_REPORT: number; } declare interface CompilationAssets { [index: string]: Source; } declare interface CompilationHooks { renderModuleContent: SyncWaterfallHook< [Source, Module, WebAssemblyRenderContext], Source >; } /** * Checks whether this object is sorted. */ declare interface CompilationParams { normalModuleFactory: NormalModuleFactory; contextModuleFactory: ContextModuleFactory; } declare interface CompiledAliasOption { /** * original alias name */ name: string; /** * name + "/" — precomputed to avoid per-resolve concat */ nameWithSlash: string; /** * alias target(s) */ alias: Alias; /** * normalized onlyModule flag */ onlyModule: boolean; /** * absolute form of `name` (with slash ending), null when not absolute */ absolutePath: null | string; /** * substring before the single "*" in `name`, null when no wildcard */ wildcardPrefix: null | string; /** * substring after the single "*" in `name`, null when no wildcard */ wildcardSuffix: null | string; /** * first character code of `name` — used as a cheap screen on the hot path. `-1` indicates "matches any first char" (empty wildcard prefix). */ firstCharCode: number; /** * true when `alias` is an array — precomputed so the hot path skips `Array.isArray` */ arrayAlias: boolean; } declare interface CompiledAliasOptions { /** * declaration-ordered list */ all: CompiledAliasOption[]; /** * bucketed by first char code */ byFirstChar: Map; /** * true when an empty-prefix wildcard is present */ hasAnyFirstChar: boolean; /** * true when the bucket fast-path should be used at resolve time */ useBuckets: boolean; } declare class Compiler { /** * Creates an instance of Compiler. */ constructor(context: string, options?: WebpackOptionsNormalized); hooks: Readonly<{ initialize: SyncHook<[]>; shouldEmit: SyncBailHook<[Compilation], boolean | void>; done: AsyncSeriesHook<[Stats]>; afterDone: SyncHook<[Stats]>; additionalPass: AsyncSeriesHook<[]>; beforeRun: AsyncSeriesHook<[Compiler]>; run: AsyncSeriesHook<[Compiler]>; emit: AsyncSeriesHook<[Compilation]>; assetEmitted: AsyncSeriesHook<[string, AssetEmittedInfo]>; afterEmit: AsyncSeriesHook<[Compilation]>; thisCompilation: SyncHook<[Compilation, CompilationParams]>; compilation: SyncHook<[Compilation, CompilationParams]>; normalModuleFactory: SyncHook<[NormalModuleFactory]>; contextModuleFactory: SyncHook<[ContextModuleFactory]>; beforeCompile: AsyncSeriesHook<[CompilationParams]>; compile: SyncHook<[CompilationParams]>; make: AsyncParallelHook<[Compilation]>; finishMake: AsyncParallelHook<[Compilation]>; afterCompile: AsyncSeriesHook<[Compilation]>; /** * @since 5.67.0 */ readRecords: AsyncSeriesHook<[]>; /** * @since 5.67.0 */ emitRecords: AsyncSeriesHook<[]>; watchRun: AsyncSeriesHook<[Compiler]>; failed: SyncHook<[Error]>; invalid: SyncHook<[null | string, number]>; watchClose: SyncHook<[]>; /** * @since 5.17.0 */ shutdown: AsyncSeriesHook<[]>; infrastructureLog: SyncBailHook< [string, string, undefined | any[]], true | void >; /** * @since 5.106.0 */ validate: SyncHook<[]>; environment: SyncHook<[]>; afterEnvironment: SyncHook<[]>; afterPlugins: SyncHook<[Compiler]>; afterResolvers: SyncHook<[Compiler]>; entryOption: SyncBailHook<[string, EntryNormalized], boolean | void>; }>; webpack: typeof exports; name?: string; parentCompilation?: Compilation; root: Compiler; outputPath: string; watching?: Watching; outputFileSystem: null | OutputFileSystem; intermediateFileSystem: null | IntermediateFileSystem; inputFileSystem: null | InputFileSystem; watchFileSystem: null | WatchFileSystem; recordsInputPath: null | string; recordsOutputPath: null | string; records: Records; managedPaths: Set; unmanagedPaths: Set; immutablePaths: Set; modifiedFiles?: ReadonlySet; removedFiles?: ReadonlySet; fileTimestamps?: Map< string, | null | "ignore" | EntryTypesIndex | OnlySafeTimeEntry | ExistenceOnlyTimeEntryTypesIndex >; contextTimestamps?: Map< string, | null | "ignore" | EntryTypesIndex | OnlySafeTimeEntry | ExistenceOnlyTimeEntryTypesIndex >; fsStartTime?: number; resolverFactory: ResolverFactory; infrastructureLogger?: ( value: string, type: LogTypeEnum, args?: any[] ) => void; platform: Readonly; options: WebpackOptionsNormalized; context: string; requestShortener: RequestShortener; cache: CacheClass; moduleMemCaches?: Map; compilerPath: string; running: boolean; idle: boolean; watchMode: boolean; /** * Returns the cache facade instance. */ getCache(name: string): CacheFacade; /** * Gets infrastructure logger. */ getInfrastructureLogger(name: string | (() => string)): WebpackLogger; /** * Returns a compiler watcher. */ watch( watchOptions: WatchOptions, handler: CallbackWebpackFunction_2 ): undefined | Watching; /** * Processes the provided stat. */ run(callback: CallbackWebpackFunction_2): void; /** * Processes the provided run as child callback. */ runAsChild( callback: ( err: null | Error, entries?: Chunk[], compilation?: Compilation ) => void ): void; purgeInputFileSystem(): void; /** * Processes the provided compilation. */ emitAssets( compilation: Compilation, callback: (err: null | Error, result?: void) => void ): void; /** * Processes the provided error callback. */ emitRecords(callback: (err: null | Error, result?: void) => void): void; /** * Processes the provided error callback. */ readRecords(callback: (err: null | Error, result?: void) => void): void; /** * Creates a child compiler. */ createChildCompiler( compilation: Compilation, compilerName: string, compilerIndex: number, outputOptions?: Partial, plugins?: ( | undefined | null | false | "" | 0 | ((this: Compiler, compiler: Compiler) => void) | WebpackPluginInstance )[] ): Compiler; isChild(): boolean; /** * Creates a compilation. */ createCompilation(params: CompilationParams): Compilation; /** * Returns the created compilation. */ newCompilation(params: CompilationParams): Compilation; createNormalModuleFactory(): NormalModuleFactory; createContextModuleFactory(): ContextModuleFactory; newCompilationParams(): { normalModuleFactory: NormalModuleFactory; contextModuleFactory: ContextModuleFactory; }; /** * Processes the provided compilation. */ compile(callback: CallbackWebpackFunction_2): void; /** * Processes the provided error callback. */ close(callback: (err: null | Error, result?: void) => void): void; /** * Schema validation function with optional pre-compiled check */ validate[1] = object>( schema: | (JSONSchema4 & ExtendedSchema) | (JSONSchema6 & ExtendedSchema) | (JSONSchema7 & ExtendedSchema) | (() => Parameters[0]), value: T, options?: ValidationErrorConfiguration, check?: (value: T) => boolean ): void; } declare class ConcatSource extends Source { constructor(...args: ConcatSourceChild[]); getChildren(): Source[]; add(item: ConcatSourceChild): void; addAllSkipOptimizing(items: ConcatSourceChild[]): void; streamChunks( options: StreamChunksOptions, onChunk: ( chunk: undefined | string, generatedLine: number, generatedColumn: number, sourceIndex: number, originalLine: number, originalColumn: number, nameIndex: number ) => void, onSource: ( sourceIndex: number, source: null | string, sourceContent?: string ) => void, onName: (nameIndex: number, name: string) => void ): GeneratedSourceInfo; } type ConcatSourceChild = string | Source | SourceLike; /** * Advanced options for module concatenation. * @since 5.109.0 */ declare interface ConcatenateModulesOptions { /** * Also concatenate CommonJS modules with statically analyzable exports. Defaults to 'true'. */ commonjs?: boolean; } type ConcatenatedModuleBuildInfo = KnownBuildInfo & Record & KnownConcatenatedModuleBuildInfo; declare interface ConcatenatedModuleInfo { type: "concatenated"; module: Module; index: number; /** * a "weird" CommonJS module executed via the CJS wrapper runtime helper with real module/exports objects */ cjsWrapped?: boolean; ast?: Program; internalSource?: Source; source?: ReplaceSource; chunkInitFragments?: InitFragment[]; runtimeRequirements?: ReadonlySet; globalScope?: Scope; moduleScope?: Scope; internalNames: Map; exportMap?: Map; rawExportMap?: Map; namespaceExportSymbol?: string; namespaceObjectName?: string; /** * decoupled namespace object that keeps original export names when the exports are mangled */ escapeNamespaceObjectName?: string; concatenationScope?: ConcatenationScope; /** * "default-with-named" namespace */ interopNamespaceObjectUsed: boolean; /** * "default-with-named" namespace */ interopNamespaceObjectName?: string; /** * "default-only" namespace */ interopNamespaceObject2Used: boolean; /** * "default-only" namespace */ interopNamespaceObject2Name?: string; /** * runtime namespace object that detects "__esModule" */ interopDefaultAccessUsed: boolean; /** * runtime namespace object that detects "__esModule" */ interopDefaultAccessName?: string; /** * memoized getExportsType(strict=true) */ exportsTypeStrict?: "namespace" | "dynamic" | "default-only" | "default-with-named"; /** * memoized getExportsType(strict=false) */ exportsTypeNonStrict?: "namespace" | "dynamic" | "default-only" | "default-with-named"; } declare interface ConcatenationBailoutReasonContext { /** * the module graph */ moduleGraph: ModuleGraph; /** * the chunk graph */ chunkGraph: ChunkGraph; /** * whether eligible CommonJS modules may be concatenated */ concatenateCommonJsModules?: boolean; } /** * Tracks the symbols and cross-module references needed while rendering a * concatenated module. */ declare class ConcatenationScope { /** * Creates the mutable scope object used while rendering a concatenated * module and its cross-module references. */ constructor( modulesMap: ModuleInfo[] | Map, currentModule: ConcatenatedModuleInfo, usedNames: Set ); usedNames: Set; /** * Checks whether a module participates in the current concatenation scope. */ isModuleInScope(module: Module): boolean; /** * Records the symbol that should be used when the current module exports a * named binding. */ registerExport(exportName: string, symbol: string): void; /** * Records a raw expression that can be used to reference an export without * going through the normal symbol map. */ registerRawExport(exportName: string, expression: string): void; /** * Returns the raw expression registered for an export, if one exists. */ getRawExport(exportName: string): undefined | string; /** * Replaces the raw expression for an export only when that export already * has an entry in the raw export map. */ setRawExportMap(exportName: string, expression: string): void; /** * Records the symbol that should be used for the synthetic namespace export. */ registerNamespaceExport(symbol: string): void; /** * Encodes a reference to another concatenated module as a placeholder * identifier that can be parsed later during code generation. */ createModuleReference( module: Module, __1: Partial ): string; /** * Checks whether an identifier is one of webpack's encoded concatenation * module references. */ static isModuleReference(name: string): boolean; /** * Parses an encoded module reference back into its module index and * reference flags. */ static matchModuleReference( name: string ): null | (ModuleReferenceOptions & { index: number }); static DEFAULT_EXPORT: string; static NAMESPACE_OBJECT_EXPORT: string; } /** * Options object as provided by the user. */ declare interface Configuration { /** * Set the value of `require.amd` and `define.amd`. Or disable AMD support. */ amd?: false | { [index: string]: any }; /** * Report the first error as a hard error instead of tolerating it. */ bail?: boolean; /** * Cache generated modules and chunks to improve performance for multiple incremental builds. */ cache?: boolean | FileCacheOptions | MemoryCacheOptions; /** * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory. */ context?: string; /** * References to other configurations to depend on. */ dependencies?: string[]; /** * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). */ devtool?: | string | false | { /** * Which asset type should receive this devtool value. */ type: "css" | "all" | "javascript"; /** * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). */ use: RawDevTool; }[]; /** * Enable and configure the Dotenv plugin to load environment variables from .env files. */ dotenv?: boolean | DotenvPluginOptions; /** * The entry point(s) of the compilation. */ entry?: | string | (() => string | EntryObject | string[] | Promise) | EntryObject | string[]; /** * Enables/Disables experiments (experimental features with relax SemVer compatibility). */ experiments?: Experiments; /** * Extend configuration from another configuration (only works when using webpack-cli). */ extends?: string | string[]; /** * Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`. */ externals?: | string | RegExp | (ExternalItemObjectKnown & ExternalItemObjectUnknown) | (( data: ExternalItemFunctionData, callback: ( err?: null | Error, result?: | string | boolean | string[] | (ExternalItemValueObjectKnown & ExternalItemValueObjectUnknown) ) => void ) => void) | ((data: ExternalItemFunctionData) => Promise) | ExternalItem[]; /** * Enable presets of externals for specific targets. */ externalsPresets?: ExternalsPresets; /** * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value). */ externalsType?: | "import" | "var" | "module" | "assign" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "jsonp" | "system" | "amd-async" | "promise" | "module-import" | "script" | "node-commonjs" | "asset" | "asset-url" | "css-import" | "css-url"; /** * Ignore specific warnings. */ ignoreWarnings?: ( | RegExp | { /** * A RegExp to select the origin file for the warning. */ file?: RegExp; /** * A RegExp to select the warning message. */ message?: RegExp; /** * A RegExp to select the origin module for the warning. */ module?: RegExp; } | ((warning: Error, compilation: Compilation) => boolean) )[]; /** * Options for infrastructure level logging. */ infrastructureLogging?: InfrastructureLogging; /** * Custom values available in the loader context. */ loader?: Loader; /** * Enable production optimizations or development hints. */ mode?: "none" | "development" | "production"; /** * Options affecting the normal modules (`NormalModuleFactory`). */ module?: ModuleOptions; /** * Name of the configuration. Used when loading multiple configurations. */ name?: string; /** * Include polyfills or mocks for various node stuff. */ node?: false | NodeOptions; /** * Enables/Disables integrated optimizations. */ optimization?: Optimization; /** * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk. */ output?: Output; /** * The number of parallel processed modules in the compilation. */ parallelism?: number; /** * Configuration for web performance recommendations. */ performance?: false | PerformanceOptions; /** * Add additional plugins to the compiler. */ plugins?: ( | undefined | null | false | "" | 0 | ((this: Compiler, compiler: Compiler) => void) | WebpackPluginInstance )[]; /** * Capture timing information for each module. */ profile?: boolean; /** * Store compiler state to a json file. */ recordsInputPath?: string | false; /** * Load compiler state from a json file. */ recordsOutputPath?: string | false; /** * Store/Load compiler state from/to a json file. This will result in persistent ids of modules and chunks. An absolute path is expected. `recordsPath` is used for `recordsInputPath` and `recordsOutputPath` if they left undefined. */ recordsPath?: string | false; /** * Options for the resolver. */ resolve?: ResolveOptions; /** * Options for the resolver when resolving loaders. */ resolveLoader?: ResolveOptions; /** * Options affecting how file system snapshots are created and validated. */ snapshot?: SnapshotOptionsWebpackOptions; /** * Stats options object or preset name. */ stats?: | boolean | StatsOptions | "none" | "summary" | "errors-only" | "errors-warnings" | "minimal" | "normal" | "detailed" | "verbose"; /** * Environment to build for. An array of environments to build for all of them when possible. */ target?: string | false | string[]; /** * Enable validation of webpack configuration. Defaults to true in development mode. In production mode, defaults to true unless futureDefaults is enabled, then defaults to false. */ validate?: boolean; /** * Enter watch mode, which rebuilds on file change. */ watch?: boolean; /** * Options for the watcher. */ watchOptions?: WatchOptions; } type ConnectionState = boolean | typeof CIRCULAR_CONNECTION | typeof TRANSITIVE_ONLY; declare class ConstDependency extends NullDependency { /** * Creates an instance of ConstDependency. */ constructor( expression: string, range: number | [number, number], runtimeRequirements?: null | string[] ); expression: string; range: number | [number, number]; runtimeRequirements: null | Set; static Template: typeof ConstDependencyTemplate; /** * Compares two dependencies by source location for sorting a module's * `dependencies`, without materializing the `loc` objects (`get loc` caches * its result, so comparing through it would retain a location object on every * sorted dependency). These dependencies always carry a real source position, * so only start (line, column) and the within-statement index are compared; a * dependency without an index sorts after one that has an index at the same * position. */ static compareLocations(a: Dependency, b: Dependency): 0 | 1 | -1; static NO_EXPORTS_REFERENCED: string[][]; static EXPORTS_OBJECT_REFERENCED: string[][]; static EXPORTS_OBJECT_REFERENCED_MANGLEABLE: string[][]; /** * Returns true if the dependency is a low priority dependency. */ static isLowPriorityDependency(dependency: Dependency): boolean; /** * Returns true if the dependency can be concatenated (scope hoisting). */ static canConcatenate(dependency: Dependency): boolean; static TRANSITIVE: symbol; static LAZY_UNTIL_LOCAL: "local"; static LAZY_UNTIL_ID: "id"; static LAZY_UNTIL_FALLBACK: "*"; static LAZY_UNTIL_REQUEST: "@"; } declare class ConstDependencyTemplate extends NullDependencyTemplate { constructor(); } declare interface Constructor { new (...params: any[]): any; } declare class ConsumeSharedPlugin { /** * Creates an instance of ConsumeSharedPlugin. */ constructor(options: ConsumeSharedPluginOptions); options: ConsumeSharedPluginOptions; /** * Applies the plugin by registering its hooks on the compiler. */ apply(compiler: Compiler): void; } /** * Options for consuming shared modules. */ declare interface ConsumeSharedPluginOptions { /** * Modules that should be consumed from share scope. When provided, property names are used to match requested modules in this compilation. */ consumes: Consumes; /** * Share scope name used for all consumed modules (defaults to 'default'). */ shareScope?: string; } type Consumes = (string | ConsumesObject)[] | ConsumesObject; /** * Advanced configuration for modules that should be consumed from share scope. */ declare interface ConsumesConfig { /** * Include the fallback module directly instead behind an async request. This allows to use fallback module in initial load too. All possible shared modules need to be eager too. */ eager?: boolean; /** * Fallback module if no shared module is found in share scope. Defaults to the property name. */ import?: string | false; /** * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request. */ packageName?: string; /** * Version requirement from module in share scope. */ requiredVersion?: string | false; /** * Module is looked up under this key from the share scope. */ shareKey?: string; /** * Share scope name. */ shareScope?: string; /** * Allow only a single version of the shared module in share scope (disabled by default). */ singleton?: boolean; /** * Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified). */ strictVersion?: boolean; } /** * Modules that should be consumed from share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash. */ declare interface ConsumesObject { [index: string]: string | ConsumesConfig; } type ContainerOptionsFormat = Item | (string | Item)[]; declare class ContainerPlugin { /** * Creates an instance of ContainerPlugin. */ constructor(options: ContainerPluginOptions); options: ContainerPluginOptions; /** * Applies the plugin by registering its hooks on the compiler. */ apply(compiler: Compiler): void; } declare interface ContainerPluginOptions { /** * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request. */ exposes: Exposes; /** * The filename for this container relative path inside the `output.path` directory. */ filename?: string; /** * Options for library. */ library?: LibraryOptions; /** * The name for this container. */ name: string; /** * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime. */ runtime?: string | false; /** * The name of the share scope which is shared with the host (defaults to 'default'). */ shareScope?: string; } declare class ContainerReferencePlugin { /** * Creates an instance of ContainerReferencePlugin. */ constructor(options: ContainerReferencePluginOptions); options: ContainerReferencePluginOptions; /** * Applies the plugin by registering its hooks on the compiler. */ apply(compiler: Compiler): void; } declare interface ContainerReferencePluginOptions { /** * The external type of the remote containers. */ remoteType: ExternalsType; /** * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location. */ remotes: Remotes; /** * The name of the share scope shared with all remotes (defaults to 'default'). */ shareScope?: string; } declare interface ContextAlternativeRequest { context: string; request: string; } declare abstract class ContextDependency extends Dependency { options: ContextDependencyOptions; userRequest: string; critical?: string | false; hadGlobalOrStickyRegExp: boolean; request?: string; range?: [number, number]; valueRange?: [number, number]; inShorthand?: string | boolean; replaces?: { value: string; range: [number, number] }[]; } type ContextDependencyOptions = ContextOptions & { request: string }; declare abstract class ContextElementDependency extends ModuleDependency { referencedExports?: null | string[][]; attributes?: ImportAttributes; } declare class ContextExclusionPlugin { /** * Creates an instance of ContextExclusionPlugin. */ constructor(negativeMatcher: RegExp); negativeMatcher: RegExp; /** * Applies the plugin by registering its hooks on the compiler. */ apply(compiler: Compiler): void; } declare interface ContextFileSystemInfoEntry { safeTime: number; timestampHash?: string; resolved?: ResolvedContextFileSystemInfoEntry; symlinks?: Set; } declare interface ContextHash { hash: string; resolved?: string; symlinks?: Set; } type ContextMode = "eager" | "weak" | "lazy" | "lazy-once" | "sync" | "async-weak"; type ContextModuleBuildInfo = KnownBuildInfo & Record & KnownContextModuleBuildInfo; declare abstract class ContextModuleFactory extends ModuleFactory { hooks: Readonly<{ beforeResolve: AsyncSeriesWaterfallHook< [BeforeContextResolveData], false | void | BeforeContextResolveData >; afterResolve: AsyncSeriesWaterfallHook< [AfterContextResolveData], false | void | AfterContextResolveData >; contextModuleFiles: SyncWaterfallHook<[string[]], string[]>; alternatives: FakeHook< Pick< AsyncSeriesWaterfallHook< [ContextAlternativeRequest[]], ContextAlternativeRequest[] >, "name" | "tap" | "tapAsync" | "tapPromise" > >; alternativeRequests: AsyncSeriesWaterfallHook< [ContextAlternativeRequest[], ContextModuleOptions], ContextAlternativeRequest[] >; }>; resolverFactory: ResolverFactory; /** * Resolves dependencies. */ resolveDependencies( fs: InputFileSystem, options: ContextModuleOptions, callback: ( err: null | Error, dependencies?: ContextElementDependency[] ) => void ): void; } type ContextModuleOptions = ContextOptions & ContextModuleOptionsExtras; declare interface ContextModuleOptionsExtras { resource: string | false | string[]; resourceQuery?: string; resourceFragment?: string; resolveOptions?: ResolveOptions; } declare interface ContextOptions { mode: ContextMode; recursive: boolean; regExp: null | false | RegExp; namespaceObject?: boolean | "strict"; addon?: string; chunkName?: null | string; include?: null | RegExp; exclude?: null | RegExp; groupOptions?: RawChunkGroupOptions; typePrefix?: string; category?: string; /** * exports referenced from modules (won't be mangled) */ referencedExports?: null | string[][]; layer?: null | string; attributes?: ImportAttributes; phase?: 0 | 1 | 2; /** * glob patterns for import.meta.glob */ patterns?: string[]; /** * importer context for import.meta.glob */ requestContext?: string; /** * import selection for import.meta.glob */ importName?: string; /** * exhaustive mode for import.meta.glob */ exhaustive?: boolean; /** * case-sensitive matching for import.meta.glob */ caseSensitive?: boolean; } declare class ContextReplacementPlugin { /** * Creates an instance of ContextReplacementPlugin. */ constructor( resourceRegExp: RegExp, newContentResource?: | string | boolean | RegExp | ((context: BeforeContextResolveData | AfterContextResolveData) => void), newContentRecursive?: boolean | RegExp | NewContentCreateContextMap, newContentRegExp?: RegExp ); resourceRegExp: RegExp; newContentCallback?: ( context: BeforeContextResolveData | AfterContextResolveData ) => void; newContentResource?: string; /** * Stores new content create context map. */ newContentCreateContextMap?: ( fs: InputFileSystem, callback: ( err: null | Error, newContentRecursive: NewContentCreateContextMap ) => void ) => void; newContentRecursive?: boolean; newContentRegExp?: RegExp; /** * Applies the plugin by registering its hooks on the compiler. */ apply(compiler: Compiler): void; } declare interface ContextResolveData { context: string; request: string; resolveOptions?: ResolveOptions; fileDependencies: LazySet; missingDependencies: LazySet; contextDependencies: LazySet; dependencies: ContextDependency[]; } type ContextTimestamp = | null | "ignore" | ContextFileSystemInfoEntry | ExistenceOnlyTimeEntryFileSystemInfo; declare interface ContextTimestampAndHash { safeTime: number; timestampHash?: string; hash: string; resolved?: ResolvedContextTimestampAndHash; symlinks?: Set; } type ContextTypes = KnownContext & Record; declare interface CreateData { /** * an optional layer in which the module is */ layer?: string; /** * module type. When deserializing, this is set to an empty string "". */ type: string; /** * request string */ request: string; /** * request intended by user (without loaders from config) */ userRequest: string; /** * request without resolving */ rawRequest: string; /** * list of loaders */ loaders: LoaderItem[]; /** * path + query of the real resource */ resource: string; /** * resource resolve data */ resourceResolveData?: ResourceSchemeData & Partial; /** * context directory for resolving */ context: string; /** * path + query of the matched resource (virtual) */ matchResource?: string; /** * the parser used */ parser: ParserClass; /** * the options of the parser used */ parserOptions?: ParserOptions; /** * the generator used */ generator: Generator; /** * the options of the generator used */ generatorOptions?: GeneratorOptions; /** * options used for resolving requests from this module */ resolveOptions?: ResolveOptions; /** * enable/disable extracting source map */ extractSourceMap: boolean; settings: ModuleSettings; } type CreateReadStreamFSImplementation = FSImplementation & { read: (...args: any[]) => any; }; type CreateStatsOptionsContext = KnownCreateStatsOptionsContext & Record; type CreateWriteStreamFSImplementation = FSImplementation & { write: (...args: any[]) => any; close?: (...args: any[]) => any; }; type CreatedObject = T extends ChunkGroupInfoWithName[] ? Record : T extends (infer V)[] ? StatsObject[] : StatsObject; /** * Parser options for css/auto and css/module modules. */ declare interface CssAutoOrModuleParserOptions { /** * Enable/disable renaming of `@keyframes`. */ animation?: boolean; /** * Configure how the CSS source is parsed: as a full stylesheet (default) or as a block's contents (e.g. the content of an HTML `style` attribute). */ as?: "stylesheet" | "block-contents"; /** * Enable/disable renaming of `@container` names. */ container?: boolean; /** * Enable/disable renaming of custom identifiers. */ customIdents?: boolean; /** * Enable/disable resolution of `@custom-media` at-rules (file-local build-time substitution). */ customMedia?: boolean; /** * Enable/disable resolution of `@custom-selector` at-rules (file-local build-time expansion to `:is(...)`). */ customSelectors?: boolean; /** * Enable/disable renaming of dashed identifiers, e. g. custom properties. */ dashedIdents?: boolean; /** * Configure how CSS content is exported as default. */ exportType?: "link" | "text" | "css-style-sheet" | "style"; /** * Auto-emit `` for the primary `src` URL of each `@font-face` reachable from an HTML entry's initial CSS. Only the first URL per `@font-face` is preloaded (preloading every format would double-download). Off by default; `parser.css.urlHints` rules and per-URL magic comments still override the seeded defaults. Set `output.crossOriginLoading` so the preload matches the font's CORS fetch. */ fontPreload?: boolean; /** * Enable/disable renaming of `@function` names. */ function?: boolean; /** * Enable/disable renaming of grid identifiers. */ grid?: boolean; /** * Enable/disable `@import` at-rules handling. */ import?: boolean; /** * Use ES modules named export for css exports. */ namedExports?: boolean; /** * Enable strict pure mode: every selector must contain at least one local class or id selector. */ pure?: boolean; /** * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling. */ url?: boolean; /** * URL-referenced-asset default hint rules for this parser (JavaScript `new URL(...)`, CSS `url(...)`, HTML `` / `` / `