package.types.d.ts Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of webpack Show documentation
Show all versions of webpack Show documentation
Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
The newest version!
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn special-lint-fix` to update
*/
import { Buffer } from "buffer";
import {
ArrayExpression,
ArrayPattern,
ArrowFunctionExpression,
AssignmentExpression,
AssignmentPattern,
AssignmentProperty,
AwaitExpression,
BigIntLiteral,
BinaryExpression,
BlockStatement,
BreakStatement,
CatchClause,
ChainExpression,
ClassBody,
ClassDeclaration,
ClassExpression,
Comment,
ConditionalExpression,
ContinueStatement,
DebuggerStatement,
Directive,
DoWhileStatement,
EmptyStatement,
ExportAllDeclaration,
ExportDefaultDeclaration,
ExportNamedDeclaration,
ExportSpecifier,
ExpressionStatement,
ForInStatement,
ForOfStatement,
ForStatement,
FunctionDeclaration,
FunctionExpression,
Identifier,
IfStatement,
ImportDeclaration,
ImportDefaultSpecifier,
ImportExpression,
ImportNamespaceSpecifier,
ImportSpecifier,
LabeledStatement,
LogicalExpression,
MemberExpression,
MetaProperty,
MethodDefinition,
NewExpression,
ObjectExpression,
ObjectPattern,
PrivateIdentifier,
Program,
Property,
PropertyDefinition,
RegExpLiteral,
RestElement,
ReturnStatement,
SequenceExpression,
SimpleCallExpression,
SimpleLiteral,
SpreadElement,
StaticBlock,
Super,
SwitchCase,
SwitchStatement,
TaggedTemplateExpression,
TemplateElement,
TemplateLiteral,
ThisExpression,
ThrowStatement,
TryStatement,
UnaryExpression,
UpdateExpression,
VariableDeclaration,
VariableDeclarator,
WhileStatement,
WithStatement,
YieldExpression
} from "estree";
import {
IncomingMessage,
ServerOptions as ServerOptionsImport,
ServerResponse
} from "http";
import { ListenOptions, Server } from "net";
import { validate as validateFunction } from "schema-utils";
import { default as ValidationError } from "schema-utils/declarations/ValidationError";
import { ValidationErrorConfiguration } from "schema-utils/declarations/validate";
import {
AsArray,
AsyncParallelHook,
AsyncSeriesBailHook,
AsyncSeriesHook,
AsyncSeriesWaterfallHook,
HookMap,
MultiHook,
SyncBailHook,
SyncHook,
SyncWaterfallHook
} from "tapable";
import { SecureContextOptions, TlsOptions } from "tls";
import { URL } from "url";
import { Context } from "vm";
declare interface Abortable {
/**
* When provided the corresponding `AbortController` can be used to cancel an asynchronous action.
*/
signal?: AbortSignal;
}
declare class AbstractLibraryPlugin {
constructor(__0: {
/**
* name of the plugin
*/
pluginName: string;
/**
* used library type
*/
type: string;
});
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
parseOptions(library: LibraryOptions): false | T;
finishEntryModule(
module: Module,
entryName: string,
libraryContext: LibraryContext
): void;
embedInRuntimeBailout(
module: Module,
renderContext: RenderContext,
libraryContext: LibraryContext
): undefined | string;
strictRuntimeBailout(
renderContext: RenderContext,
libraryContext: LibraryContext
): undefined | string;
runtimeRequirements(
chunk: Chunk,
set: Set,
libraryContext: LibraryContext
): void;
render(
source: Source,
renderContext: RenderContext,
libraryContext: LibraryContext
): Source;
renderStartup(
source: Source,
module: Module,
renderContext: StartupRenderContext,
libraryContext: LibraryContext
): Source;
chunkHash(
chunk: Chunk,
hash: Hash,
chunkHashContext: ChunkHashContext,
libraryContext: LibraryContext
): void;
static COMMON_LIBRARY_NAME_MESSAGE: string;
}
declare interface AdditionalData {
[index: string]: any;
webpackAST: object;
}
declare class AggressiveMergingPlugin {
constructor(options?: AggressiveMergingPluginOptions);
options: AggressiveMergingPluginOptions;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
}
declare interface AggressiveMergingPluginOptions {
/**
* minimal size reduction to trigger merging
*/
minSizeReduce?: number;
}
declare class AggressiveSplittingPlugin {
constructor(options?: AggressiveSplittingPluginOptions);
options: AggressiveSplittingPluginOptions;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
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;
}
type AliasOptionNewRequest = string | false | string[];
declare interface AliasOptions {
[index: string]: AliasOptionNewRequest;
}
declare interface Argument {
description: string;
simpleType: "string" | "number" | "boolean";
multiple: boolean;
configs: ArgumentConfig[];
}
declare interface ArgumentConfig {
description: string;
negatedDescription?: string;
path: string;
multiple: boolean;
type: "string" | "number" | "boolean" | "path" | "enum" | "RegExp" | "reset";
values?: any[];
}
type ArrayBufferView =
| Uint8Array
| Uint8ClampedArray
| Uint16Array
| Uint32Array
| Int8Array
| Int16Array
| Int32Array
| BigUint64Array
| BigInt64Array
| Float32Array
| Float64Array
| DataView;
declare interface Asset {
/**
* the filename of the asset
*/
name: string;
/**
* source of the asset
*/
source: Source;
/**
* info about the asset
*/
info: AssetInfo;
}
declare interface AssetEmittedInfo {
content: Buffer;
source: Source;
compilation: Compilation;
outputPath: string;
targetPath: string;
}
type AssetFilterItemTypes =
| string
| RegExp
| ((name: string, asset: StatsAsset) => boolean);
/**
* 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);
}
/**
* 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;
/**
* Specifies the filename template of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
*/
filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
/**
* 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 | ((pathData: PathData, assetInfo?: AssetInfo) => string);
/**
* The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
*/
publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
}
declare class AsyncDependenciesBlock extends DependenciesBlock {
constructor(
groupOptions:
| null
| (RawChunkGroupOptions & { name?: string } & {
entryOptions?: EntryOptions;
}),
loc?: null | SyntheticDependencyLocation | RealDependencyLocation,
request?: null | string
);
groupOptions: RawChunkGroupOptions & { name?: string } & {
entryOptions?: EntryOptions;
};
loc?: null | SyntheticDependencyLocation | RealDependencyLocation;
request?: null | string;
chunkName?: string;
module: any;
}
declare abstract class AsyncQueue {
hooks: {
beforeAdd: AsyncSeriesHook<[T]>;
added: SyncHook<[T]>;
beforeStart: AsyncSeriesHook<[T]>;
started: SyncHook<[T]>;
result: SyncHook<[T, Error, R]>;
};
add(item: T, callback: CallbackAsyncQueue): void;
invalidate(item: T): void;
/**
* Waits for an already started item
*/
waitFor(item: T, callback: CallbackAsyncQueue): void;
stop(): void;
increaseParallelism(): void;
decreaseParallelism(): void;
isProcessing(item: T): boolean;
isQueued(item: T): boolean;
isDone(item: T): boolean;
clear(): void;
}
declare class AsyncWebAssemblyModulesPlugin {
constructor(options: AsyncWebAssemblyModulesPluginOptions);
options: AsyncWebAssemblyModulesPluginOptions;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
renderModule(
module: Module,
renderContext: WebAssemblyRenderContext,
hooks: CompilationHooksAsyncWebAssemblyModulesPlugin
): Source;
static getCompilationHooks(
compilation: Compilation
): CompilationHooksAsyncWebAssemblyModulesPlugin;
}
declare interface AsyncWebAssemblyModulesPluginOptions {
/**
* mangle imports
*/
mangleImports?: boolean;
}
declare class AutomaticPrefetchPlugin {
constructor();
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
}
type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
declare interface BackendApi {
dispose: (arg0?: Error) => void;
module: (arg0: Module) => { client: string; data: string; active: boolean };
}
declare class BannerPlugin {
constructor(options: BannerPluginArgument);
options: BannerPluginOptions;
banner: (data: { hash?: string; chunk: Chunk; filename: string }) => string;
/**
* Apply the plugin
*/
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 | 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 | Rule[];
/**
* If true, banner will not be wrapped in a comment.
*/
raw?: boolean;
/**
* Specifies the banner.
*/
stage?: number;
/**
* Include all modules that pass test assertion.
*/
test?: string | RegExp | Rule[];
}
declare interface BaseResolveRequest {
path: string | false;
context?: object;
descriptionFilePath?: string;
descriptionFileRoot?: string;
descriptionFileData?: JsonObjectTypes;
relativePath?: string;
ignoreSymlinks?: boolean;
fullySpecified?: boolean;
__innerRequest?: string;
__innerRequest_request?: string;
__innerRequest_relativePath?: string;
}
declare abstract class BasicEvaluatedExpression {
type: number;
range?: [number, number];
falsy: boolean;
truthy: boolean;
nullish?: boolean;
sideEffects: boolean;
bool?: boolean;
number?: number;
bigint?: bigint;
regExp?: RegExp;
string?: string;
quasis?: BasicEvaluatedExpression[];
parts?: BasicEvaluatedExpression[];
array?: any[];
items?: BasicEvaluatedExpression[];
options?: BasicEvaluatedExpression[];
prefix?: null | BasicEvaluatedExpression;
postfix?: null | BasicEvaluatedExpression;
wrappedInnerExpressions?: BasicEvaluatedExpression[];
identifier?: string | VariableInfoInterface;
rootInfo?: string | VariableInfoInterface;
getMembers?: () => string[];
getMembersOptionals?: () => boolean[];
getMemberRanges?: () => [number, number][];
expression?:
| UnaryExpression
| ArrayExpression
| ArrowFunctionExpression
| AssignmentExpression
| AwaitExpression
| BinaryExpression
| SimpleCallExpression
| NewExpression
| ChainExpression
| ClassExpression
| ConditionalExpression
| FunctionExpression
| Identifier
| ImportExpression
| SimpleLiteral
| RegExpLiteral
| BigIntLiteral
| LogicalExpression
| MemberExpression
| MetaProperty
| ObjectExpression
| SequenceExpression
| TaggedTemplateExpression
| TemplateLiteral
| ThisExpression
| UpdateExpression
| YieldExpression
| FunctionDeclaration
| VariableDeclaration
| ClassDeclaration
| PrivateIdentifier
| ExpressionStatement
| BlockStatement
| StaticBlock
| EmptyStatement
| DebuggerStatement
| WithStatement
| ReturnStatement
| LabeledStatement
| BreakStatement
| ContinueStatement
| IfStatement
| SwitchStatement
| ThrowStatement
| TryStatement
| WhileStatement
| DoWhileStatement
| ForStatement
| ForInStatement
| ForOfStatement
| ImportDeclaration
| ExportNamedDeclaration
| ExportDefaultDeclaration
| ExportAllDeclaration
| MethodDefinition
| PropertyDefinition
| VariableDeclarator
| Program
| SwitchCase
| CatchClause
| ObjectPattern
| ArrayPattern
| RestElement
| AssignmentPattern
| SpreadElement
| Property
| AssignmentProperty
| ClassBody
| ImportSpecifier
| ImportDefaultSpecifier
| ImportNamespaceSpecifier
| ExportSpecifier
| Super
| TemplateElement;
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;
/**
* Gets the compile-time value of the expression
*/
asCompileTimeValue(): 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;
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 | VariableInfoInterface,
rootInfo: string | VariableInfoInterface,
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 options to a conditional 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: "raw" | "cooked"
): BasicEvaluatedExpression;
templateStringKind?: "raw" | "cooked";
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?:
| UnaryExpression
| ArrayExpression
| ArrowFunctionExpression
| AssignmentExpression
| AwaitExpression
| BinaryExpression
| SimpleCallExpression
| NewExpression
| ChainExpression
| ClassExpression
| ConditionalExpression
| FunctionExpression
| Identifier
| ImportExpression
| SimpleLiteral
| RegExpLiteral
| BigIntLiteral
| LogicalExpression
| MemberExpression
| MetaProperty
| ObjectExpression
| SequenceExpression
| TaggedTemplateExpression
| TemplateLiteral
| ThisExpression
| UpdateExpression
| YieldExpression
| FunctionDeclaration
| VariableDeclaration
| ClassDeclaration
| PrivateIdentifier
| ExpressionStatement
| BlockStatement
| StaticBlock
| EmptyStatement
| DebuggerStatement
| WithStatement
| ReturnStatement
| LabeledStatement
| BreakStatement
| ContinueStatement
| IfStatement
| SwitchStatement
| ThrowStatement
| TryStatement
| WhileStatement
| DoWhileStatement
| ForStatement
| ForInStatement
| ForOfStatement
| ImportDeclaration
| ExportNamedDeclaration
| ExportDefaultDeclaration
| ExportAllDeclaration
| MethodDefinition
| PropertyDefinition
| VariableDeclarator
| Program
| SwitchCase
| CatchClause
| ObjectPattern
| ArrayPattern
| RestElement
| AssignmentPattern
| SpreadElement
| Property
| AssignmentProperty
| ClassBody
| ImportSpecifier
| ImportDefaultSpecifier
| ImportNamespaceSpecifier
| ExportSpecifier
| Super
| TemplateElement
): BasicEvaluatedExpression;
}
type BufferEncoding =
| "ascii"
| "utf8"
| "utf-8"
| "utf16le"
| "utf-16le"
| "ucs2"
| "ucs-2"
| "latin1"
| "binary"
| "base64"
| "base64url"
| "hex";
type BufferEncodingOption = "buffer" | { encoding: "buffer" };
type BuildInfo = KnownBuildInfo & Record;
type BuildMeta = KnownBuildMeta & Record;
declare abstract class ByTypeGenerator extends Generator {
map: Record;
}
declare const CIRCULAR_CONNECTION: unique symbol;
declare class Cache {
constructor();
hooks: {
get: AsyncSeriesBailHook<
[
string,
null | Etag,
((result: any, callback: (arg0?: Error) => void) => void)[]
],
any
>;
store: AsyncParallelHook<[string, null | Etag, any]>;
storeBuildDependencies: AsyncParallelHook<[Iterable]>;
beginIdle: SyncHook<[]>;
endIdle: AsyncParallelHook<[]>;
shutdown: AsyncParallelHook<[]>;
};
get(
identifier: string,
etag: null | Etag,
callback: CallbackCacheCache
): void;
store(
identifier: string,
etag: null | Etag,
data: T,
callback: CallbackCacheCache
): void;
/**
* After this method has succeeded the cache can only be restored when build dependencies are
*/
storeBuildDependencies(
dependencies: Iterable,
callback: CallbackCacheCache
): void;
beginIdle(): void;
endIdle(callback: CallbackCacheCache): void;
shutdown(callback: CallbackCacheCache): void;
static STAGE_MEMORY: number;
static STAGE_DEFAULT: number;
static STAGE_DISK: number;
static STAGE_NETWORK: number;
}
declare abstract class CacheFacade {
getChildCache(name: string): CacheFacade;
getItemCache(identifier: string, etag: null | Etag): ItemCacheFacade;
getLazyHashedEtag(obj: HashableObject): Etag;
mergeEtags(a: Etag, b: Etag): Etag;
get(
identifier: string,
etag: null | Etag,
callback: CallbackCacheCacheFacade
): void;
getPromise(identifier: string, etag: null | Etag): Promise;
store(
identifier: string,
etag: null | Etag,
data: T,
callback: CallbackCacheCacheFacade
): void;
storePromise(
identifier: string,
etag: null | Etag,
data: T
): Promise;
provide(
identifier: string,
etag: null | Etag,
computer: (arg0: CallbackNormalErrorCache) => void,
callback: CallbackNormalErrorCache
): void;
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 | ((arg0: PathData, arg1?: AssetInfo) => string);
idHint?: string;
automaticNameDelimiter?: string;
reuseExistingChunk?: boolean;
usedExports?: boolean;
}
declare interface CacheGroupsContext {
moduleGraph: ModuleGraph;
chunkGraph: ChunkGraph;
}
type CacheOptionsNormalized = false | FileCacheOptions | MemoryCacheOptions;
declare class CachedSource extends Source {
constructor(source: Source);
constructor(source: Source | (() => Source), cachedData?: any);
original(): Source;
originalLazy(): Source | (() => Source);
getCachedData(): any;
}
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?: T): any;
}
declare interface CallbackCacheCache {
(err: null | WebpackError, result?: T): void;
}
declare interface CallbackCacheCacheFacade {
(err?: null | Error, result?: null | T): void;
}
declare interface CallbackFunction_1 {
(err: null | Error, result?: T): any;
}
declare interface CallbackFunction_2 {
(err?: null | Error, result?: T): any;
}
declare interface CallbackNormalErrorCache {
(err?: null | Error, result?: T): void;
}
declare interface CallbackNormalModuleFactory {
(err?: null | Error, stats?: T): void;
}
declare interface CallbackWebpack {
(err: null | Error, stats?: T): void;
}
type Cell = undefined | T;
declare class Chunk {
constructor(name?: string, backCompat?: boolean);
id: null | string | number;
ids: null | ChunkId[];
debugId: number;
name?: string;
idNameHints: SortableSet;
preventIntegration: boolean;
filenameTemplate?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
cssFilenameTemplate?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
runtime: RuntimeSpec;
files: Set;
auxiliaryFiles: Set;
rendered: boolean;
hash?: string;
contentHash: Record;
renderedHash?: string;
chunkReason?: string;
extraAsync: boolean;
get entryModule(): Module;
hasEntryModule(): boolean;
addModule(module: Module): boolean;
removeModule(module: Module): void;
getNumberOfModules(): number;
get modulesIterable(): Iterable;
compareTo(otherChunk: Chunk): 0 | 1 | -1;
containsModule(module: Module): boolean;
getModules(): Module[];
remove(): void;
moveModule(module: Module, otherChunk: Chunk): void;
integrate(otherChunk: Chunk): boolean;
canBeIntegrated(otherChunk: Chunk): boolean;
isEmpty(): boolean;
modulesSize(): number;
size(options?: ChunkSizeOptions): number;
integratedSize(otherChunk: Chunk, options: ChunkSizeOptions): number;
getChunkModuleMaps(filterFn: (m: Module) => boolean): ChunkModuleMaps;
hasModuleInGraph(
filterFn: (m: Module) => boolean,
filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
): boolean;
getChunkMaps(realHash: boolean): ChunkMaps;
hasRuntime(): boolean;
canBeInitial(): boolean;
isOnlyInitial(): boolean;
getEntryOptions(): undefined | EntryOptions;
addGroup(chunkGroup: ChunkGroup): void;
removeGroup(chunkGroup: ChunkGroup): void;
isInGroup(chunkGroup: ChunkGroup): boolean;
getNumberOfGroups(): number;
get groupsIterable(): SortableSet;
disconnectFromGroups(): void;
split(newChunk: Chunk): void;
updateHash(hash: Hash, chunkGraph: ChunkGraph): void;
getAllAsyncChunks(): Set;
getAllInitialChunks(): Set;
getAllReferencedChunks(): Set;
getAllReferencedAsyncEntrypoints(): Set;
hasAsyncChunks(): boolean;
getChildIdsByOrders(
chunkGraph: ChunkGraph,
filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
): Record;
getChildrenOfTypeInOrder(
chunkGraph: ChunkGraph,
type: string
): undefined | { onChunks: Chunk[]; chunks: Set }[];
getChildIdsByOrdersMap(
chunkGraph: ChunkGraph,
includeDirectChildren?: boolean,
filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
): Record>;
}
declare class ChunkGraph {
constructor(moduleGraph: ModuleGraph, hashFunction?: string | typeof Hash);
moduleGraph: ModuleGraph;
connectChunkAndModule(chunk: Chunk, module: Module): void;
disconnectChunkAndModule(chunk: Chunk, module: Module): void;
disconnectChunk(chunk: Chunk): void;
attachModules(chunk: Chunk, modules: Iterable): void;
attachRuntimeModules(chunk: Chunk, modules: Iterable): void;
attachFullHashModules(chunk: Chunk, modules: Iterable): void;
attachDependentHashModules(
chunk: Chunk,
modules: Iterable
): void;
replaceModule(oldModule: Module, newModule: Module): void;
isModuleInChunk(module: Module, chunk: Chunk): boolean;
isModuleInChunkGroup(module: Module, chunkGroup: ChunkGroup): boolean;
isEntryModule(module: Module): boolean;
getModuleChunksIterable(module: Module): Iterable;
getOrderedModuleChunksIterable(
module: Module,
sortFn: (arg0: Chunk, arg1: Chunk) => 0 | 1 | -1
): Iterable;
getModuleChunks(module: Module): Chunk[];
getNumberOfModuleChunks(module: Module): number;
getModuleRuntimes(module: Module): RuntimeSpecSet;
getNumberOfChunkModules(chunk: Chunk): number;
getNumberOfChunkFullHashModules(chunk: Chunk): number;
getChunkModulesIterable(chunk: Chunk): Iterable;
getChunkModulesIterableBySourceType(
chunk: Chunk,
sourceType: string
): undefined | Iterable;
setChunkModuleSourceTypes(
chunk: Chunk,
module: Module,
sourceTypes: Set
): void;
getChunkModuleSourceTypes(chunk: Chunk, module: Module): Set;
getModuleSourceTypes(module: Module): Set;
getOrderedChunkModulesIterable(
chunk: Chunk,
comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
): Iterable;
getOrderedChunkModulesIterableBySourceType(
chunk: Chunk,
sourceType: string,
comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
): undefined | Iterable;
getChunkModules(chunk: Chunk): Module[];
getOrderedChunkModules(
chunk: Chunk,
comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
): Module[];
getChunkModuleIdMap(
chunk: Chunk,
filterFn: (m: Module) => boolean,
includeAllChunks?: boolean
): Record;
getChunkModuleRenderedHashMap(
chunk: Chunk,
filterFn: (m: Module) => boolean,
hashLength?: number,
includeAllChunks?: boolean
): Record>;
getChunkConditionMap(
chunk: Chunk,
filterFn: (c: Chunk, chunkGraph: ChunkGraph) => boolean
): Record;
hasModuleInGraph(
chunk: Chunk,
filterFn: (m: Module) => boolean,
filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
): boolean;
compareChunks(chunkA: Chunk, chunkB: Chunk): 0 | 1 | -1;
getChunkModulesSize(chunk: Chunk): number;
getChunkModulesSizes(chunk: Chunk): Record;
getChunkRootModules(chunk: Chunk): Module[];
getChunkSize(chunk: Chunk, options?: ChunkSizeOptions): number;
getIntegratedChunksSize(
chunkA: Chunk,
chunkB: Chunk,
options?: ChunkSizeOptions
): number;
canChunksBeIntegrated(chunkA: Chunk, chunkB: Chunk): boolean;
integrateChunks(chunkA: Chunk, chunkB: Chunk): void;
upgradeDependentToFullHashModules(chunk: Chunk): void;
isEntryModuleInChunk(module: Module, chunk: Chunk): boolean;
connectChunkAndEntryModule(
chunk: Chunk,
module: Module,
entrypoint?: Entrypoint
): void;
connectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
addFullHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
addDependentHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
disconnectChunkAndEntryModule(chunk: Chunk, module: Module): void;
disconnectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
disconnectEntryModule(module: Module): void;
disconnectEntries(chunk: Chunk): void;
getNumberOfEntryModules(chunk: Chunk): number;
getNumberOfRuntimeModules(chunk: Chunk): number;
getChunkEntryModulesIterable(chunk: Chunk): Iterable;
getChunkEntryDependentChunksIterable(chunk: Chunk): Iterable;
hasChunkEntryDependentChunks(chunk: Chunk): boolean;
getChunkRuntimeModulesIterable(chunk: Chunk): Iterable;
getChunkRuntimeModulesInOrder(chunk: Chunk): RuntimeModule[];
getChunkFullHashModulesIterable(
chunk: Chunk
): undefined | Iterable;
getChunkFullHashModulesSet(
chunk: Chunk
): undefined | ReadonlySet;
getChunkDependentHashModulesIterable(
chunk: Chunk
): undefined | Iterable;
getChunkEntryModulesWithChunkGroupIterable(
chunk: Chunk
): Iterable<[Module, undefined | Entrypoint]>;
getBlockChunkGroup(depBlock: AsyncDependenciesBlock): undefined | ChunkGroup;
connectBlockAndChunkGroup(
depBlock: AsyncDependenciesBlock,
chunkGroup: ChunkGroup
): void;
disconnectChunkGroup(chunkGroup: ChunkGroup): void;
getModuleId(module: Module): ModuleId;
setModuleId(module: Module, id: ModuleId): void;
getRuntimeId(runtime: string): string | number;
setRuntimeId(runtime: string, id: string | number): void;
hasModuleHashes(module: Module, runtime: RuntimeSpec): boolean;
getModuleHash(module: Module, runtime: RuntimeSpec): string;
getRenderedModuleHash(module: Module, runtime: RuntimeSpec): string;
setModuleHashes(
module: Module,
runtime: RuntimeSpec,
hash: string,
renderedHash: string
): void;
addModuleRuntimeRequirements(
module: Module,
runtime: RuntimeSpec,
items: Set,
transferOwnership?: boolean
): void;
addChunkRuntimeRequirements(chunk: Chunk, items: Set): void;
addTreeRuntimeRequirements(chunk: Chunk, items: Iterable): void;
getModuleRuntimeRequirements(
module: Module,
runtime: RuntimeSpec
): ReadonlySet;
getChunkRuntimeRequirements(chunk: Chunk): ReadonlySet;
getModuleGraphHash(
module: Module,
runtime: RuntimeSpec,
withConnections?: boolean
): string;
getModuleGraphHashBigInt(
module: Module,
runtime: RuntimeSpec,
withConnections?: boolean
): bigint;
getTreeRuntimeRequirements(chunk: Chunk): ReadonlySet;
static getChunkGraphForModule(
module: Module,
deprecateMessage: string,
deprecationCode: string
): ChunkGraph;
static setChunkGraphForModule(module: Module, chunkGraph: ChunkGraph): void;
static clearChunkGraphForModule(module: Module): void;
static getChunkGraphForChunk(
chunk: Chunk,
deprecateMessage: string,
deprecationCode: string
): ChunkGraph;
static setChunkGraphForChunk(chunk: Chunk, chunkGraph: ChunkGraph): void;
static clearChunkGraphForChunk(chunk: Chunk): void;
}
declare abstract class ChunkGroup {
groupDebugId: number;
options: ChunkGroupOptions;
chunks: Chunk[];
origins: OriginRecord[];
index?: number;
/**
* when a new chunk is added to a chunkGroup, addingOptions will occur.
*/
addOptions(options: ChunkGroupOptions): void;
/**
* returns the name of current ChunkGroup
* sets a new name for current ChunkGroup
*/
name?: string;
/**
* get a uniqueId for ChunkGroup, made up of its member Chunk debugId's
*/
get debugId(): string;
/**
* get a unique id for ChunkGroup, made up of its member Chunk id's
*/
get id(): string;
/**
* Performs an unshift of a specific chunk
*/
unshiftChunk(chunk: Chunk): boolean;
/**
* inserts a chunk before another existing chunk in group
*/
insertChunk(chunk: Chunk, before: Chunk): boolean;
/**
* add a chunk into ChunkGroup. Is pushed on or prepended
*/
pushChunk(chunk: Chunk): boolean;
replaceChunk(oldChunk: Chunk, newChunk: Chunk): undefined | boolean;
removeChunk(chunk: Chunk): boolean;
isInitial(): boolean;
addChild(group: ChunkGroup): boolean;
getChildren(): ChunkGroup[];
getNumberOfChildren(): number;
get childrenIterable(): SortableSet;
removeChild(group: ChunkGroup): boolean;
addParent(parentChunk: ChunkGroup): boolean;
getParents(): ChunkGroup[];
getNumberOfParents(): number;
hasParent(parent: ChunkGroup): boolean;
get parentsIterable(): SortableSet;
removeParent(chunkGroup: ChunkGroup): boolean;
addAsyncEntrypoint(entrypoint: Entrypoint): boolean;
get asyncEntrypointsIterable(): SortableSet;
getBlocks(): AsyncDependenciesBlock[];
getNumberOfBlocks(): number;
hasBlock(block: AsyncDependenciesBlock): boolean;
get blocksIterable(): Iterable;
addBlock(block: AsyncDependenciesBlock): boolean;
addOrigin(module: Module, loc: DependencyLocation, request: string): void;
getFiles(): string[];
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;
getChildrenByOrders(
moduleGraph: ModuleGraph,
chunkGraph: ChunkGraph
): Record;
/**
* Sets the top-down index of a module in this ChunkGroup
*/
setModulePreOrderIndex(module: Module, index: number): void;
/**
* Gets the top-down index of a module in this ChunkGroup
*/
getModulePreOrderIndex(module: Module): undefined | number;
/**
* Sets the bottom-up index of a module in this ChunkGroup
*/
setModulePostOrderIndex(module: Module, index: number): void;
/**
* Gets the bottom-up index of a module in this ChunkGroup
*/
getModulePostOrderIndex(module: Module): undefined | number;
checkConstraints(): void;
getModuleIndex: (module: Module) => undefined | number;
getModuleIndex2: (module: Module) => undefined | number;
}
type ChunkGroupOptions = RawChunkGroupOptions & { name?: 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;
}
type ChunkId = string | number;
declare interface ChunkMaps {
hash: Record;
contentHash: Record>;
name: Record;
}
declare class ChunkModuleIdRangePlugin {
constructor(options: ChunkModuleIdRangePluginOptions);
options: ChunkModuleIdRangePluginOptions;
/**
* Apply the plugin
*/
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 ChunkModuleMaps {
id: Record;
hash: Record;
}
declare interface ChunkPathData {
id: string | number;
name?: string;
hash: string;
hashWithLength?: (arg0: number) => string;
contentHash?: Record;
contentHashWithLength?: Record string>;
}
declare class ChunkPrefetchPreloadPlugin {
constructor();
apply(compiler: Compiler): void;
}
declare interface ChunkRenderContext {
/**
* 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;
}
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?: any, fn?: any) => void };
modules: { tap: (options?: any, fn?: any) => void };
render: { tap: (options?: any, fn?: any) => void };
renderWithEntry: { tap: (options?: any, fn?: any) => void };
hash: { tap: (options?: any, fn?: any) => void };
hashForChunk: { tap: (options?: any, fn?: any) => void };
}>;
get outputOptions(): Output;
}
/**
* 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 | ((filename: string) => boolean);
}
declare class CleanPlugin {
constructor(options?: CleanOptions);
options: {
/**
* Log the assets that should be removed instead of deleting them.
*/
dry: boolean;
/**
* Keep these assets.
*/
keep?: string | RegExp | ((filename: string) => boolean);
};
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
static getCompilationHooks(
compilation: Compilation
): CleanPluginCompilationHooks;
}
declare interface CleanPluginCompilationHooks {
/**
* when returning true the file/directory will be kept during cleaning, returning false will clean it and ignore the following plugins and config
*/
keep: SyncBailHook<[string], boolean>;
}
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;
/**
* 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 CodeGenerationResult {
/**
* the resulting sources for all source types
*/
sources: Map;
/**
* the resulting data for all source types
*/
data?: Map;
/**
* the runtime requirements
*/
runtimeRequirements: ReadonlySet;
/**
* a hash of the code generation result (will be automatically calculated from sources and runtimeRequirements if not provided)
*/
hash?: string;
}
declare abstract class CodeGenerationResults {
map: Map>;
get(module: Module, runtime: RuntimeSpec): CodeGenerationResult;
has(module: Module, runtime: RuntimeSpec): boolean;
getSource(module: Module, runtime: RuntimeSpec, sourceType: string): Source;
getRuntimeRequirements(
module: Module,
runtime: RuntimeSpec
): ReadonlySet;
getData(module: Module, runtime: RuntimeSpec, key: string): any;
getHash(module: Module, runtime: RuntimeSpec): any;
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 Comparator {
(arg0: T, arg1: T): 0 | 1 | -1;
}
declare class CompatSource extends Source {
constructor(sourceLike: SourceLike);
static from(sourceLike: SourceLike): Source;
}
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]
>;
executeModule: SyncHook<[ExecuteModuleArgument, ExecuteModuleContext]>;
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], any>;
afterOptimizeDependencies: SyncHook<[Iterable]>;
optimize: SyncHook<[]>;
optimizeModules: SyncBailHook<[Iterable], any>;
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<[], undefined | boolean>;
additionalChunkRuntimeRequirements: SyncHook<
[Chunk, Set, RuntimeRequirementsContext]
>;
runtimeRequirementInChunk: HookMap<
SyncBailHook<[Chunk, Set, RuntimeRequirementsContext], void>
>;
additionalModuleRuntimeRequirements: SyncHook<
[Module, Set, RuntimeRequirementsContext]
>;
runtimeRequirementInModule: HookMap<
SyncBailHook<[Module, Set, RuntimeRequirementsContext], any>
>;
additionalTreeRuntimeRequirements: SyncHook<
[Chunk, Set, RuntimeRequirementsContext]
>;
runtimeRequirementInTree: HookMap<
SyncBailHook<[Chunk, Set, RuntimeRequirementsContext], any>
>;
runtimeModule: SyncHook<[RuntimeModule, Chunk]>;
reviveModules: SyncHook<[Iterable, any]>;
beforeModuleIds: SyncHook<[Iterable]>;
moduleIds: SyncHook<[Iterable]>;
optimizeModuleIds: SyncHook<[Iterable]>;
afterOptimizeModuleIds: SyncHook<[Iterable]>;
reviveChunks: SyncHook<[Iterable, any]>;
beforeChunkIds: SyncHook<[Iterable]>;
chunkIds: SyncHook<[Iterable]>;
optimizeChunkIds: SyncHook<[Iterable]>;
afterOptimizeChunkIds: SyncHook<[Iterable]>;
recordModules: SyncHook<[Iterable, any]>;
recordChunks: SyncHook<[Iterable, any]>;
optimizeCodeGeneration: SyncHook<[Iterable]>;
beforeModuleHash: SyncHook<[]>;
afterModuleHash: SyncHook<[]>;
beforeCodeGeneration: SyncHook<[]>;
afterCodeGeneration: SyncHook<[]>;
beforeRuntimeRequirements: SyncHook<[]>;
afterRuntimeRequirements: SyncHook<[]>;
beforeHash: SyncHook<[]>;
contentHash: SyncHook<[Chunk]>;
afterHash: SyncHook<[]>;
recordHash: SyncHook<[any]>;
record: SyncHook<[Compilation, any]>;
beforeModuleAssets: SyncHook<[]>;
shouldGenerateChunkAssets: SyncBailHook<[], boolean>;
beforeChunkAssets: SyncHook<[]>;
additionalChunkAssets: FakeHook<
Pick<
AsyncSeriesHook<[Set]>,
"name" | "tap" | "tapAsync" | "tapPromise"
>
>;
additionalAssets: FakeHook<
Pick, "name" | "tap" | "tapAsync" | "tapPromise">
>;
optimizeChunkAssets: FakeHook<
Pick<
AsyncSeriesHook<[Set]>,
"name" | "tap" | "tapAsync" | "tapPromise"
>
>;
afterOptimizeChunkAssets: FakeHook<
Pick<
AsyncSeriesHook<[Set]>,
"name" | "tap" | "tapAsync" | "tapPromise"
>
>;
optimizeAssets: AsyncSeriesHook<
[CompilationAssets],
ProcessAssetsAdditionalOptions
>;
afterOptimizeAssets: SyncHook<[CompilationAssets]>;
processAssets: AsyncSeriesHook<
[CompilationAssets],
ProcessAssetsAdditionalOptions
>;
afterProcessAssets: SyncHook<[CompilationAssets]>;
processAdditionalAssets: AsyncSeriesHook<[CompilationAssets]>;
needAdditionalSeal: SyncBailHook<[], undefined | boolean>;
afterSeal: AsyncSeriesHook<[]>;
renderManifest: SyncWaterfallHook<
[RenderManifestEntry[], RenderManifestOptions]
>;
fullHash: SyncHook<[Hash]>;
chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
moduleAsset: SyncHook<[Module, string]>;
chunkAsset: SyncHook<[Chunk, string]>;
assetPath: SyncWaterfallHook<[string, object, undefined | AssetInfo]>;
needAdditionalPass: SyncBailHook<[], boolean>;
childCompiler: SyncHook<[Compiler, string, number]>;
log: SyncBailHook<[string, LogEntry], true>;
processWarnings: SyncWaterfallHook<[WebpackError[]]>;
processErrors: SyncWaterfallHook<[WebpackError[]]>;
statsPreset: HookMap<
SyncHook<[Partial, CreateStatsOptionsContext]>
>;
statsNormalize: SyncHook<
[Partial, CreateStatsOptionsContext]
>;
statsFactory: SyncHook<[StatsFactory, NormalizedStatsOptions]>;
statsPrinter: SyncHook<[StatsPrinter, NormalizedStatsOptions]>;
get normalModuleLoader(): SyncHook<[object, NormalModule]>;
}>;
name?: string;
startTime?: number;
endTime?: number;
compiler: Compiler;
resolverFactory: ResolverFactory;
inputFileSystem: InputFileSystem;
fileSystemInfo: FileSystemInfo;
valueCacheVersions: Map>;
requestShortener: RequestShortener;
compilerPath: string;
logger: WebpackLogger;
options: WebpackOptionsNormalized;
outputOptions: OutputNormalized;
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: any;
additionalChunkAssets: string[];
assets: CompilationAssets;
assetsInfo: Map;
errors: WebpackError[];
warnings: WebpackError[];
children: Compilation[];
logging: Map;
dependencyFactories: Map;
dependencyTemplates: DependencyTemplates;
childrenCounters: object;
usedChunkIds: Set;
usedModuleIds: Set;
needAdditionalPass: boolean;
builtModules: WeakSet;
codeGeneratedModules: WeakSet;
buildTimeExecutedModules: WeakSet;
emittedAssets: Set;
comparedForEmitAssets: Set;
fileDependencies: LazySet;
contextDependencies: LazySet;
missingDependencies: LazySet;
buildDependencies: LazySet;
compilationDependencies: { add: (item: string) => LazySet };
getStats(): Stats;
createStatsOptions(
optionsOrPreset?: string | boolean | StatsOptions,
context?: CreateStatsOptionsContext
): NormalizedStatsOptions;
createStatsFactory(options: NormalizedStatsOptions): StatsFactory;
createStatsPrinter(options: NormalizedStatsOptions): StatsPrinter;
getCache(name: string): CacheFacade;
getLogger(name: string | (() => string)): WebpackLogger;
addModule(
module: Module,
callback: (err?: null | WebpackError, result?: 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?: Module) => void
): void;
processModuleDependencies(
module: Module,
callback: (err?: null | WebpackError, result?: Module) => void
): void;
processModuleDependenciesNonRecursive(module: Module): void;
handleModuleCreation(
__0: HandleModuleCreationOptions,
callback: (err?: null | WebpackError, result?: Module) => void
): void;
addModuleChain(
context: string,
dependency: Dependency,
callback: (err?: null | WebpackError, result?: Module) => void
): void;
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?: Module) => void
): void;
addEntry(
context: string,
entry: Dependency,
optionsOrName: string | EntryOptions,
callback: (err?: null | WebpackError, result?: Module) => void
): void;
addInclude(
context: string,
dependency: Dependency,
options: EntryOptions,
callback: (err?: null | WebpackError, result?: Module) => void
): void;
rebuildModule(
module: Module,
callback: (err?: null | WebpackError, result?: Module) => void
): void;
finish(callback: (err?: null | WebpackError) => void): void;
unseal(): void;
seal(callback: (err?: null | WebpackError) => void): void;
reportDependencyErrorsAndWarnings(
module: Module,
blocks: DependenciesBlock[]
): boolean;
codeGeneration(callback: (err?: null | WebpackError) => void): void;
processRuntimeRequirements(__0?: {
/**
* the chunk graph
*/
chunkGraph?: ChunkGraph;
/**
* modules
*/
modules?: Iterable;
/**
* chunks
*/
chunks?: Iterable;
/**
* codeGenerationResults
*/
codeGenerationResults?: CodeGenerationResults;
/**
* chunkGraphEntries
*/
chunkGraphEntries?: Iterable;
}): void;
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;
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?: string): Chunk;
assignDepth(module: Module): void;
assignDepths(modules: Set): void;
getDependencyReferencedExports(
dependency: Dependency,
runtime: RuntimeSpec
): (string[] | ReferencedExport)[];
removeReasonsOfDependencyBlock(
module: Module,
block: DependenciesBlockLike
): void;
patchChunksAfterReasonRemoval(module: Module, chunk: Chunk): void;
removeChunkFromDependencies(block: DependenciesBlock, chunk: Chunk): void;
assignRuntimeIds(): void;
sortItemsWithChunkIds(): void;
summarizeDependencies(): void;
createModuleHashes(): void;
createHash(): {
module: Module;
hash: string;
runtime: RuntimeSpec;
runtimes: RuntimeSpec[];
}[];
fullHash?: string;
hash?: string;
emitAsset(file: string, source: Source, assetInfo?: AssetInfo): void;
updateAsset(
file: string,
newSourceOrFunction: Source | ((arg0: Source) => Source),
assetInfoUpdateOrFunction?: AssetInfo | ((arg0?: AssetInfo) => AssetInfo)
): void;
renameAsset(file: string, newFile: string): void;
deleteAsset(file: string): void;
getAssets(): Readonly[];
getAsset(name: string): undefined | Readonly;
clearAssets(): void;
createModuleAssets(): void;
getRenderManifest(options: RenderManifestOptions): RenderManifestEntry[];
createChunkAssets(callback: (err?: null | WebpackError) => void): void;
getPath(
filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
data?: PathData
): string;
getPathWithInfo(
filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
data?: PathData
): { path: string; info: AssetInfo };
getAssetPath(
filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
data: PathData
): string;
getAssetPathWithInfo(
filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
data: PathData
): { path: string; info: AssetInfo };
getWarnings(): WebpackError[];
getErrors(): WebpackError[];
/**
* 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?: OutputNormalized,
plugins?: (
| ((this: Compiler, compiler: Compiler) => void)
| WebpackPluginInstance
)[]
): Compiler;
executeModule(
module: Module,
options: ExecuteModuleOptions,
callback: (err?: null | WebpackError, result?: ExecuteModuleResult) => void
): void;
checkConstraints(): void;
factorizeModule: {
(
options: FactorizeModuleOptions & { factoryResult?: false },
callback: (err?: null | WebpackError, result?: Module) => void
): void;
(
options: FactorizeModuleOptions & { factoryResult: true },
callback: (
err?: null | WebpackError,
result?: ModuleFactoryResult
) => void
): 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 CompilationHooksAsyncWebAssemblyModulesPlugin {
renderModuleContent: SyncWaterfallHook<
[Source, Module, WebAssemblyRenderContext]
>;
}
declare interface CompilationHooksJavascriptModulesPlugin {
renderModuleContent: SyncWaterfallHook<[Source, Module, ChunkRenderContext]>;
renderModuleContainer: SyncWaterfallHook<
[Source, Module, ChunkRenderContext]
>;
renderModulePackage: SyncWaterfallHook<[Source, Module, ChunkRenderContext]>;
renderChunk: SyncWaterfallHook<[Source, RenderContext]>;
renderMain: SyncWaterfallHook<[Source, RenderContext]>;
renderContent: SyncWaterfallHook<[Source, RenderContext]>;
render: SyncWaterfallHook<[Source, RenderContext]>;
renderStartup: SyncWaterfallHook<[Source, Module, StartupRenderContext]>;
renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext]>;
inlineInRuntimeBailout: SyncBailHook<
[Module, RenderBootstrapContext],
string
>;
embedInRuntimeBailout: SyncBailHook<[Module, RenderContext], string | void>;
strictRuntimeBailout: SyncBailHook<[RenderContext], string | void>;
chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
useSourceMap: SyncBailHook<[Chunk, RenderContext], boolean>;
}
declare interface CompilationHooksRealContentHashPlugin {
updateHash: SyncBailHook<[Buffer[], string], string>;
}
declare interface CompilationParams {
normalModuleFactory: NormalModuleFactory;
contextModuleFactory: ContextModuleFactory;
}
declare class Compiler {
constructor(context: string, options?: WebpackOptionsNormalized);
hooks: Readonly<{
initialize: SyncHook<[]>;
shouldEmit: SyncBailHook<[Compilation], undefined | boolean>;
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]>;
readRecords: AsyncSeriesHook<[]>;
emitRecords: AsyncSeriesHook<[]>;
watchRun: AsyncSeriesHook<[Compiler]>;
failed: SyncHook<[Error]>;
invalid: SyncHook<[null | string, number]>;
watchClose: SyncHook<[]>;
shutdown: AsyncSeriesHook<[]>;
infrastructureLog: SyncBailHook<[string, string, any[]], true>;
environment: SyncHook<[]>;
afterEnvironment: SyncHook<[]>;
afterPlugins: SyncHook<[Compiler]>;
afterResolvers: SyncHook<[Compiler]>;
entryOption: SyncBailHook<[string, EntryNormalized], boolean>;
}>;
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: Record;
managedPaths: Set;
unmanagedPaths: Set;
immutablePaths: Set;
modifiedFiles?: ReadonlySet;
removedFiles?: ReadonlySet;
fileTimestamps?: ReadonlyMap;
contextTimestamps?: ReadonlyMap<
string,
null | FileSystemInfoEntry | "ignore"
>;
fsStartTime?: number;
resolverFactory: ResolverFactory;
infrastructureLogger?: (arg0: string, arg1: LogTypeEnum, arg2: any[]) => void;
platform: Readonly;
options: WebpackOptionsNormalized;
context: string;
requestShortener: RequestShortener;
cache: Cache;
moduleMemCaches?: Map<
Module,
{
buildInfo: BuildInfo;
references?: WeakMap;
memCache: WeakTupleMap;
}
>;
compilerPath: string;
running: boolean;
idle: boolean;
watchMode: boolean;
getCache(name: string): CacheFacade;
getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
watch(watchOptions: WatchOptions, handler: RunCallback): Watching;
run(callback: RunCallback): void;
runAsChild(
callback: (
err: null | Error,
entries?: Chunk[],
compilation?: Compilation
) => any
): void;
purgeInputFileSystem(): void;
emitAssets(
compilation: Compilation,
callback: CallbackFunction_2
): void;
emitRecords(callback: CallbackFunction_2): void;
readRecords(callback: CallbackFunction_2): void;
createChildCompiler(
compilation: Compilation,
compilerName: string,
compilerIndex: number,
outputOptions?: OutputNormalized,
plugins?: WebpackPluginInstance[]
): Compiler;
isChild(): boolean;
createCompilation(params: CompilationParams): Compilation;
newCompilation(params: CompilationParams): Compilation;
createNormalModuleFactory(): NormalModuleFactory;
createContextModuleFactory(): ContextModuleFactory;
newCompilationParams(): {
normalModuleFactory: NormalModuleFactory;
contextModuleFactory: ContextModuleFactory;
};
compile(callback: RunCallback): void;
close(callback: RunCallback): void;
}
declare class ConcatSource extends Source {
constructor(...args: (string | Source)[]);
getChildren(): Source[];
add(item: string | Source): void;
addAllSkipOptimizing(items: Source[]): void;
}
declare interface ConcatenatedModuleInfo {
index: number;
module: Module;
/**
* mapping from export name to symbol
*/
exportMap: Map;
/**
* mapping from export name to symbol
*/
rawExportMap: Map;
namespaceExportSymbol?: string;
}
declare interface ConcatenationBailoutReasonContext {
/**
* the module graph
*/
moduleGraph: ModuleGraph;
/**
* the chunk graph
*/
chunkGraph: ChunkGraph;
}
declare class ConcatenationScope {
constructor(
modulesMap: ModuleInfo[] | Map,
currentModule: ConcatenatedModuleInfo
);
isModuleInScope(module: Module): boolean;
registerExport(exportName: string, symbol: string): void;
registerRawExport(exportName: string, expression: string): void;
registerNamespaceExport(symbol: string): void;
createModuleReference(
module: Module,
__1: Partial
): string;
static isModuleReference(name: string): boolean;
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;
/**
* 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
| ExternalItem[]
| (ExternalItemObjectKnown & ExternalItemObjectUnknown)
| ((
data: ExternalItemFunctionData,
callback: (
err?: null | Error,
result?: string | boolean | string[] | { [index: string]: any }
) => void
) => void)
| ((data: ExternalItemFunctionData) => Promise);
/**
* 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"
| "promise"
| "script"
| "node-commonjs";
/**
* 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: WebpackError, 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"
| "verbose"
| "summary"
| "errors-only"
| "errors-warnings"
| "minimal"
| "normal"
| "detailed";
/**
* Environment to build for. An array of environments to build for all of them when possible.
*/
target?: string | false | string[];
/**
* Enter watch mode, which rebuilds on file change.
*/
watch?: boolean;
/**
* Options for the watcher.
*/
watchOptions?: WatchOptions;
}
type ConnectionState =
| boolean
| typeof TRANSITIVE_ONLY
| typeof CIRCULAR_CONNECTION;
declare class ConstDependency extends NullDependency {
constructor(
expression: string,
range: number | [number, number],
runtimeRequirements?: null | string[]
);
expression: string;
range: number | [number, number];
runtimeRequirements: null | Set;
static Template: typeof ConstDependencyTemplate;
static NO_EXPORTS_REFERENCED: string[][];
static EXPORTS_OBJECT_REFERENCED: string[][];
static TRANSITIVE: typeof TRANSITIVE;
}
declare class ConstDependencyTemplate extends NullDependencyTemplate {
constructor();
}
declare interface Constructor {
new (...params: any[]): any;
}
declare class ConsumeSharedPlugin {
constructor(options: ConsumeSharedPluginOptions);
/**
* Apply the plugin
*/
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 =
| Record
| (string | Record)[];
declare class ContainerPlugin {
constructor(options: ContainerPluginOptions);
/**
* Apply the plugin
*/
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 {
constructor(options: ContainerReferencePluginOptions);
/**
* Apply the plugin
*/
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 abstract class ContextElementDependency extends ModuleDependency {
referencedExports?: string[][];
}
declare class ContextExclusionPlugin {
constructor(negativeMatcher: RegExp);
negativeMatcher: RegExp;
/**
* Apply the plugin
*/
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 =
| "weak"
| "eager"
| "lazy"
| "lazy-once"
| "sync"
| "async-weak";
declare abstract class ContextModuleFactory extends ModuleFactory {
hooks: Readonly<{
beforeResolve: AsyncSeriesWaterfallHook<[any]>;
afterResolve: AsyncSeriesWaterfallHook<[any]>;
contextModuleFiles: SyncWaterfallHook<[string[]]>;
alternatives: FakeHook<
Pick<
AsyncSeriesWaterfallHook<[any[]]>,
"name" | "tap" | "tapAsync" | "tapPromise"
>
>;
alternativeRequests: AsyncSeriesWaterfallHook<
[any[], ContextModuleOptions]
>;
}>;
resolverFactory: ResolverFactory;
resolveDependencies(
fs: InputFileSystem,
options: ContextModuleOptions,
callback: (
err?: null | Error,
dependencies?: ContextElementDependency[]
) => any
): void;
}
declare interface ContextModuleOptions {
mode: ContextMode;
recursive: boolean;
regExp: RegExp;
namespaceObject?: boolean | "strict";
addon?: string;
chunkName?: string;
include?: RegExp;
exclude?: RegExp;
groupOptions?: RawChunkGroupOptions;
typePrefix?: string;
category?: string;
/**
* exports referenced from modules (won't be mangled)
*/
referencedExports?: null | string[][];
layer?: string;
attributes?: ImportAttributes;
resource: string | false | string[];
resourceQuery?: string;
resourceFragment?: string;
resolveOptions: any;
}
declare class ContextReplacementPlugin {
constructor(
resourceRegExp: RegExp,
newContentResource?: any,
newContentRecursive?: any,
newContentRegExp?: any
);
resourceRegExp: RegExp;
newContentCallback: any;
newContentResource: any;
newContentCreateContextMap: any;
newContentRecursive: any;
newContentRegExp: any;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
}
declare interface ContextTimestampAndHash {
safeTime: number;
timestampHash?: string;
hash: string;
resolved?: ResolvedContextTimestampAndHash;
symlinks?: Set;
}
type CreateStatsOptionsContext = KnownCreateStatsOptionsContext &
Record;
type CreateWriteStreamFSImplementation = FSImplementation & {
write: (...args: any[]) => any;
close?: (...args: any[]) => any;
};
/**
* Generator options for css/auto modules.
*/
declare interface CssAutoGeneratorOptions {
/**
* Configure the generated JS modules that use the ES modules syntax.
*/
esModule?: boolean;
/**
* Specifies the convention of exported names.
*/
exportsConvention?:
| "as-is"
| "camel-case"
| "camel-case-only"
| "dashes"
| "dashes-only"
| ((name: string) => string);
/**
* Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
*/
exportsOnly?: boolean;
/**
* Configure the generated local ident name.
*/
localIdentName?: string;
}
/**
* Parser options for css/auto modules.
*/
declare interface CssAutoParserOptions {
/**
* Use ES modules named export for css exports.
*/
namedExports?: boolean;
}
/**
* Generator options for css modules.
*/
declare interface CssGeneratorOptions {
/**
* Configure the generated JS modules that use the ES modules syntax.
*/
esModule?: boolean;
/**
* Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
*/
exportsOnly?: boolean;
}
/**
* Generator options for css/global modules.
*/
declare interface CssGlobalGeneratorOptions {
/**
* Configure the generated JS modules that use the ES modules syntax.
*/
esModule?: boolean;
/**
* Specifies the convention of exported names.
*/
exportsConvention?:
| "as-is"
| "camel-case"
| "camel-case-only"
| "dashes"
| "dashes-only"
| ((name: string) => string);
/**
* Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
*/
exportsOnly?: boolean;
/**
* Configure the generated local ident name.
*/
localIdentName?: string;
}
/**
* Parser options for css/global modules.
*/
declare interface CssGlobalParserOptions {
/**
* Use ES modules named export for css exports.
*/
namedExports?: boolean;
}
declare interface CssImportDependencyMeta {
layer?: string;
supports?: string;
media?: string;
}
/**
* Generator options for css/module modules.
*/
declare interface CssModuleGeneratorOptions {
/**
* Configure the generated JS modules that use the ES modules syntax.
*/
esModule?: boolean;
/**
* Specifies the convention of exported names.
*/
exportsConvention?:
| "as-is"
| "camel-case"
| "camel-case-only"
| "dashes"
| "dashes-only"
| ((name: string) => string);
/**
* Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
*/
exportsOnly?: boolean;
/**
* Configure the generated local ident name.
*/
localIdentName?: string;
}
/**
* Parser options for css/module modules.
*/
declare interface CssModuleParserOptions {
/**
* Use ES modules named export for css exports.
*/
namedExports?: boolean;
}
/**
* Parser options for css modules.
*/
declare interface CssParserOptions {
/**
* Use ES modules named export for css exports.
*/
namedExports?: boolean;
}
type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
declare class DefinePlugin {
/**
* Create a new define plugin
*/
constructor(definitions: Record);
definitions: Record;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
static runtimeValue(
fn: (arg0: {
module: NormalModule;
key: string;
readonly version?: string;
}) => CodeValuePrimitive,
options?: true | string[] | RuntimeValueOptions
): RuntimeValue;
}
declare class DelegatedPlugin {
constructor(options?: any);
options: any;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
}
declare interface DepConstructor {
new (...args: any[]): Dependency;
}
declare abstract class DependenciesBlock {
dependencies: Dependency[];
blocks: AsyncDependenciesBlock[];
parent?: DependenciesBlock;
getRootBlock(): DependenciesBlock;
/**
* Adds a DependencyBlock to DependencyBlock relationship.
* This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting)
*/
addBlock(block: AsyncDependenciesBlock): void;
addDependency(dependency: Dependency): void;
removeDependency(dependency: Dependency): void;
/**
* Removes all dependencies and blocks
*/
clearDependenciesAndBlocks(): void;
updateHash(hash: Hash, context: UpdateHashContextDependency): void;
serialize(__0: ObjectSerializerContext): void;
deserialize(__0: ObjectDeserializerContext): void;
}
declare interface DependenciesBlockLike {
dependencies: Dependency[];
blocks: AsyncDependenciesBlock[];
}
declare class Dependency {
constructor();
weak: boolean;
optional: boolean;
get type(): string;
get category(): string;
loc: DependencyLocation;
setLoc(
startLine: number,
startColumn: number,
endLine: number,
endColumn: number
): void;
getContext(): undefined | string;
getResourceIdentifier(): null | string;
couldAffectReferencingModule(): boolean | typeof TRANSITIVE;
/**
* Returns the referenced module and export
*/
getReference(moduleGraph: ModuleGraph): never;
/**
* Returns list of exports referenced by this dependency
*/
getReferencedExports(
moduleGraph: ModuleGraph,
runtime: RuntimeSpec
): (string[] | ReferencedExport)[];
getCondition(
moduleGraph: ModuleGraph
):
| null
| false
| ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState);
/**
* Returns the exported names
*/
getExports(moduleGraph: ModuleGraph): undefined | ExportsSpec;
/**
* Returns warnings
*/
getWarnings(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
/**
* Returns errors
*/
getErrors(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
/**
* Update the hash
*/
updateHash(hash: Hash, context: UpdateHashContextDependency): void;
/**
* implement this method to allow the occurrence order plugin to count correctly
*/
getNumberOfIdOccurrences(): number;
getModuleEvaluationSideEffectsState(
moduleGraph: ModuleGraph
): ConnectionState;
createIgnoredModule(context: string): null | Module;
serialize(__0: ObjectSerializerContext): void;
deserialize(__0: ObjectDeserializerContext): void;
module: any;
get disconnect(): any;
static NO_EXPORTS_REFERENCED: string[][];
static EXPORTS_OBJECT_REFERENCED: string[][];
static TRANSITIVE: typeof TRANSITIVE;
}
declare interface DependencyConstructor {
new (...args: any[]): Dependency;
}
type DependencyLocation = SyntheticDependencyLocation | RealDependencyLocation;
declare class DependencyTemplate {
constructor();
apply(
dependency: Dependency,
source: ReplaceSource,
templateContext: DependencyTemplateContext
): void;
}
declare interface DependencyTemplateContext {
/**
* the runtime template
*/
runtimeTemplate: RuntimeTemplate;
/**
* the dependency templates
*/
dependencyTemplates: DependencyTemplates;
/**
* the module graph
*/
moduleGraph: ModuleGraph;
/**
* the chunk graph
*/
chunkGraph: ChunkGraph;
/**
* the requirements for runtime
*/
runtimeRequirements: Set;
/**
* current module
*/
module: Module;
/**
* current runtimes, for which code is generated
*/
runtime: RuntimeSpec;
/**
* mutable array of init fragments for the current module
*/
initFragments: InitFragment[];
/**
* when in a concatenated module, information about other concatenated modules
*/
concatenationScope?: ConcatenationScope;
/**
* the code generation results
*/
codeGenerationResults: CodeGenerationResults;
/**
* chunkInitFragments
*/
chunkInitFragments: InitFragment[];
}
declare abstract class DependencyTemplates {
get(dependency: DependencyConstructor): undefined | DependencyTemplate;
set(
dependency: DependencyConstructor,
dependencyTemplate: DependencyTemplate
): void;
updateHash(part: string): void;
getHash(): string;
clone(): DependencyTemplates;
}
/**
* Helper function for joining two ranges into a single range. This is useful
* when working with AST nodes, as it allows you to combine the ranges of child nodes
* to create the range of the _parent node_.
*/
declare interface DestructuringAssignmentProperty {
id: string;
range?: [number, number];
shorthand: string | boolean;
}
declare class DeterministicChunkIdsPlugin {
constructor(options?: DeterministicChunkIdsPluginOptions);
options: DeterministicChunkIdsPluginOptions;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
}
declare interface DeterministicChunkIdsPluginOptions {
/**
* context for ids
*/
context?: string;
/**
* maximum length of ids
*/
maxLength?: number;
}
declare class DeterministicModuleIdsPlugin {
constructor(options?: DeterministicModuleIdsPluginOptions);
options: DeterministicModuleIdsPluginOptions;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
}
declare interface DeterministicModuleIdsPluginOptions {
/**
* context relative to which module identifiers are computed
*/
context?: string;
/**
* selector function for modules
*/
test?: (arg0: Module) => boolean;
/**
* maximum id length in digits (used as starting point)
*/
maxLength?: number;
/**
* hash salt for ids
*/
salt?: number;
/**
* do not increase the maxLength to find an optimal id space size
*/
fixedLength?: boolean;
/**
* throw an error when id conflicts occur (instead of rehashing)
*/
failOnConflict?: boolean;
}
type DevtoolModuleFilenameTemplate = string | Function;
declare interface Dirent {
isFile: () => boolean;
isDirectory: () => boolean;
isBlockDevice: () => boolean;
isCharacterDevice: () => boolean;
isSymbolicLink: () => boolean;
isFIFO: () => boolean;
isSocket: () => boolean;
name: string;
path: string;
}
declare class DllPlugin {
constructor(options: DllPluginOptions);
options: {
entryOnly: boolean;
/**
* Context of requests in the manifest file (defaults to the webpack context).
*/
context?: string;
/**
* If true, manifest json file (output) will be formatted.
*/
format?: boolean;
/**
* Name of the exposed dll function (external name, use value of 'output.library').
*/
name?: string;
/**
* Absolute path to the manifest json file (output).
*/
path: string;
/**
* Type of the dll bundle (external type, use value of 'output.libraryTarget').
*/
type?: string;
};
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
}
declare interface DllPluginOptions {
/**
* Context of requests in the manifest file (defaults to the webpack context).
*/
context?: string;
/**
* If true, only entry points will be exposed (default: true).
*/
entryOnly?: boolean;
/**
* If true, manifest json file (output) will be formatted.
*/
format?: boolean;
/**
* Name of the exposed dll function (external name, use value of 'output.library').
*/
name?: string;
/**
* Absolute path to the manifest json file (output).
*/
path: string;
/**
* Type of the dll bundle (external type, use value of 'output.libraryTarget').
*/
type?: string;
}
declare class DllReferencePlugin {
constructor(options: DllReferencePluginOptions);
options: DllReferencePluginOptions;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
}
type DllReferencePluginOptions =
| {
/**
* Context of requests in the manifest (or content property) as absolute path.
*/
context?: string;
/**
* Extensions used to resolve modules in the dll bundle (only used when using 'scope').
*/
extensions?: string[];
/**
* An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation.
*/
manifest: string | DllReferencePluginOptionsManifest;
/**
* The name where the dll is exposed (external name, defaults to manifest.name).
*/
name?: string;
/**
* Prefix which is used for accessing the content of the dll.
*/
scope?: string;
/**
* How the dll is exposed (libraryTarget, defaults to manifest.type).
*/
sourceType?:
| "var"
| "assign"
| "this"
| "window"
| "global"
| "commonjs"
| "commonjs2"
| "commonjs-module"
| "amd"
| "amd-require"
| "umd"
| "umd2"
| "jsonp"
| "system";
/**
* The way how the export of the dll bundle is used.
*/
type?: "object" | "require";
}
| {
/**
* The mappings from request to module info.
*/
content: DllReferencePluginOptionsContent;
/**
* Context of requests in the manifest (or content property) as absolute path.
*/
context?: string;
/**
* Extensions used to resolve modules in the dll bundle (only used when using 'scope').
*/
extensions?: string[];
/**
* The name where the dll is exposed (external name).
*/
name: string;
/**
* Prefix which is used for accessing the content of the dll.
*/
scope?: string;
/**
* How the dll is exposed (libraryTarget).
*/
sourceType?:
| "var"
| "assign"
| "this"
| "window"
| "global"
| "commonjs"
| "commonjs2"
| "commonjs-module"
| "amd"
| "amd-require"
| "umd"
| "umd2"
| "jsonp"
| "system";
/**
* The way how the export of the dll bundle is used.
*/
type?: "object" | "require";
};
/**
* The mappings from request to module info.
*/
declare interface DllReferencePluginOptionsContent {
[index: string]: {
/**
* Meta information about the module.
*/
buildMeta?: { [index: string]: any };
/**
* Information about the provided exports of the module.
*/
exports?: true | string[];
/**
* Module ID.
*/
id: string | number;
};
}
/**
* An object containing content, name and type.
*/
declare interface DllReferencePluginOptionsManifest {
/**
* The mappings from request to module info.
*/
content: DllReferencePluginOptionsContent;
/**
* The name where the dll is exposed (external name).
*/
name?: string;
/**
* The type how the dll is exposed (external type).
*/
type?:
| "var"
| "assign"
| "this"
| "window"
| "global"
| "commonjs"
| "commonjs2"
| "commonjs-module"
| "amd"
| "amd-require"
| "umd"
| "umd2"
| "jsonp"
| "system";
}
declare class DynamicEntryPlugin {
constructor(context: string, entry: () => Promise);
context: string;
entry: () => Promise;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
}
declare interface Effect {
type: string;
value: any;
}
declare class ElectronTargetPlugin {
constructor(context?: "main" | "preload" | "renderer");
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
}
/**
* No generator options are supported for this module type.
*/
declare interface EmptyGeneratorOptions {}
/**
* No parser options are supported for this module type.
*/
declare interface EmptyParserOptions {}
declare class EnableChunkLoadingPlugin {
constructor(type: string);
type: string;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
static setEnabled(compiler: Compiler, type: string): void;
static checkEnabled(compiler: Compiler, type: string): void;
}
declare class EnableLibraryPlugin {
constructor(type: string);
type: string;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
static setEnabled(compiler: Compiler, type: string): void;
static checkEnabled(compiler: Compiler, type: string): void;
}
declare class EnableWasmLoadingPlugin {
constructor(type: string);
type: string;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
static setEnabled(compiler: Compiler, type: string): void;
static checkEnabled(compiler: Compiler, type: string): void;
}
type EncodingOption =
| undefined
| null
| "ascii"
| "utf8"
| "utf-8"
| "utf16le"
| "utf-16le"
| "ucs2"
| "ucs-2"
| "latin1"
| "binary"
| "base64"
| "base64url"
| "hex"
| ObjectEncodingOptions;
type Entry =
| string
| (() => string | EntryObject | string[] | Promise)
| EntryObject
| string[];
declare interface EntryData {
/**
* dependencies of the entrypoint that should be evaluated at startup
*/
dependencies: Dependency[];
/**
* dependencies of the entrypoint that should be included but not evaluated
*/
includeDependencies: Dependency[];
/**
* options of the entrypoint
*/
options: EntryOptions;
}
declare abstract class EntryDependency extends ModuleDependency {}
/**
* An object with entry point description.
*/
declare interface EntryDescription {
/**
* Enable/disable creating async chunks that are loaded on demand.
*/
asyncChunks?: boolean;
/**
* Base uri for this entry.
*/
baseUri?: string;
/**
* The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
*/
chunkLoading?: string | false;
/**
* The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
*/
dependOn?: string | string[];
/**
* Specifies the filename of the output file on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
*/
filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
/**
* Module(s) that are loaded upon startup.
*/
import: EntryItem;
/**
* Specifies the layer in which modules of this entrypoint are placed.
*/
layer?: null | string;
/**
* Options for library.
*/
library?: LibraryOptions;
/**
* The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
*/
publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => 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 method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
*/
wasmLoading?: string | false;
}
/**
* An object with entry point description.
*/
declare interface EntryDescriptionNormalized {
/**
* Enable/disable creating async chunks that are loaded on demand.
*/
asyncChunks?: boolean;
/**
* Base uri for this entry.
*/
baseUri?: string;
/**
* The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
*/
chunkLoading?: string | false;
/**
* The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
*/
dependOn?: string[];
/**
* Specifies the filename of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
*/
filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
/**
* Module(s) that are loaded upon startup. The last one is exported.
*/
import?: string[];
/**
* Specifies the layer in which modules of this entrypoint are placed.
*/
layer?: null | string;
/**
* Options for library.
*/
library?: LibraryOptions;
/**
* The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
*/
publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => 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 method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
*/
wasmLoading?: string | false;
}
type EntryItem = string | string[];
type EntryNormalized =
| (() => Promise)
| EntryStaticNormalized;
/**
* Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object.
*/
declare interface EntryObject {
[index: string]: string | string[] | EntryDescription;
}
declare class EntryOptionPlugin {
constructor();
apply(compiler: Compiler): void;
static applyEntryOption(
compiler: Compiler,
context: string,
entry: EntryNormalized
): void;
static entryDescriptionToOptions(
compiler: Compiler,
name: string,
desc: EntryDescriptionNormalized
): EntryOptions;
}
type EntryOptions = { name?: string } & Omit<
EntryDescriptionNormalized,
"import"
>;
declare class EntryPlugin {
/**
* An entry plugin which will handle
* creation of the EntryDependency
*/
constructor(context: string, entry: string, options?: string | EntryOptions);
context: string;
entry: string;
options: string | EntryOptions;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
static createDependency(
entry: string,
options: string | EntryOptions
): EntryDependency;
}
type EntryStatic = string | EntryObject | string[];
/**
* Multiple entry bundles are created. The key is the entry name. The value is an entry description object.
*/
declare interface EntryStaticNormalized {
[index: string]: EntryDescriptionNormalized;
}
declare abstract class Entrypoint extends ChunkGroup {
/**
* Sets the runtimeChunk for an entrypoint.
*/
setRuntimeChunk(chunk: Chunk): void;
/**
* Fetches the chunk reference containing the webpack bootstrap code
*/
getRuntimeChunk(): null | Chunk;
/**
* Sets the chunk with the entrypoint modules for an entrypoint.
*/
setEntrypointChunk(chunk: Chunk): void;
/**
* Returns the chunk which contains the entrypoint modules
* (or at least the execution of them)
*/
getEntrypointChunk(): Chunk;
}
/**
* The abilities of the environment where the webpack generated code should run.
*/
declare interface Environment {
/**
* The environment supports arrow functions ('() => { ... }').
*/
arrowFunction?: boolean;
/**
* The environment supports async function and await ('async function () { await ... }').
*/
asyncFunction?: boolean;
/**
* The environment supports BigInt as literal (123n).
*/
bigIntLiteral?: boolean;
/**
* The environment supports const and let for variable declarations.
*/
const?: boolean;
/**
* The environment supports destructuring ('{ a, b } = obj').
*/
destructuring?: boolean;
/**
* The environment supports 'document'.
*/
document?: boolean;
/**
* The environment supports an async import() function to import EcmaScript modules.
*/
dynamicImport?: boolean;
/**
* The environment supports an async import() is available when creating a worker.
*/
dynamicImportInWorker?: boolean;
/**
* The environment supports 'for of' iteration ('for (const x of array) { ... }').
*/
forOf?: boolean;
/**
* The environment supports 'globalThis'.
*/
globalThis?: boolean;
/**
* The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').
*/
module?: boolean;
/**
* The environment supports `node:` prefix for Node.js core modules.
*/
nodePrefixForCoreModules?: boolean;
/**
* The environment supports optional chaining ('obj?.a' or 'obj?.()').
*/
optionalChaining?: boolean;
/**
* The environment supports template literals.
*/
templateLiteral?: boolean;
}
declare class EnvironmentPlugin {
constructor(...keys: any[]);
keys: any[];
defaultValues: any;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
}
type ErrorWithDetail = Error & { details?: string };
declare interface Etag {
toString: () => string;
}
declare class EvalDevToolModulePlugin {
constructor(options?: EvalDevToolModulePluginOptions);
namespace: string;
sourceUrlComment: string;
moduleFilenameTemplate: DevtoolModuleFilenameTemplate;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
}
declare interface EvalDevToolModulePluginOptions {
/**
* namespace
*/
namespace?: string;
/**
* source url comment
*/
sourceUrlComment?: string;
/**
* module filename template
*/
moduleFilenameTemplate?: string | Function;
}
declare class EvalSourceMapDevToolPlugin {
constructor(inputOptions: string | SourceMapDevToolPluginOptions);
sourceMapComment: string;
moduleFilenameTemplate: string | Function;
namespace: string;
options: SourceMapDevToolPluginOptions;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
}
declare interface ExecuteModuleArgument {
module: Module;
moduleObject?: { id: string; exports: any; loaded: boolean };
preparedInfo: any;
codeGenerationResult: CodeGenerationResult;
}
declare interface ExecuteModuleContext {
assets: Map;
chunk: Chunk;
chunkGraph: ChunkGraph;
__webpack_require__?: (arg0: string) => any;
}
declare interface ExecuteModuleOptions {
entryOptions?: EntryOptions;
}
declare interface ExecuteModuleResult {
exports: any;
cacheable: boolean;
assets: Map;
fileDependencies: LazySet;
contextDependencies: LazySet;
missingDependencies: LazySet;
buildDependencies: LazySet;
}
type Experiments = ExperimentsCommon & ExperimentsExtra;
/**
* Enables/Disables experiments (experimental features with relax SemVer compatibility).
*/
declare interface ExperimentsCommon {
/**
* Support WebAssembly as asynchronous EcmaScript Module.
*/
asyncWebAssembly?: boolean;
/**
* Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.
*/
backCompat?: boolean;
/**
* Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.
*/
cacheUnaffected?: boolean;
/**
* Apply defaults of next major version.
*/
futureDefaults?: boolean;
/**
* Enable module layers.
*/
layers?: boolean;
/**
* Allow output javascript files as module source type.
*/
outputModule?: boolean;
/**
* Support WebAssembly as synchronous EcmaScript Module (outdated).
*/
syncWebAssembly?: boolean;
/**
* Allow using top-level-await in EcmaScript Modules.
*/
topLevelAwait?: boolean;
}
/**
* Enables/Disables experiments (experimental features with relax SemVer compatibility).
*/
declare interface ExperimentsExtra {
/**
* Build http(s): urls using a lockfile and resource content cache.
*/
buildHttp?: HttpUriOptions | (string | RegExp | ((uri: string) => boolean))[];
/**
* Enable css support.
*/
css?: boolean;
/**
* Compile entrypoints and import()s only when they are accessed.
*/
lazyCompilation?: boolean | LazyCompilationOptions;
}
type ExperimentsNormalized = ExperimentsCommon & ExperimentsNormalizedExtra;
/**
* Enables/Disables experiments (experimental features with relax SemVer compatibility).
*/
declare interface ExperimentsNormalizedExtra {
/**
* Build http(s): urls using a lockfile and resource content cache.
*/
buildHttp?: HttpUriOptions;
/**
* Enable css support.
*/
css?: boolean;
/**
* Compile entrypoints and import()s only when they are accessed.
*/
lazyCompilation?: false | LazyCompilationOptions;
}
declare abstract class ExportInfo {
name: string;
/**
* true: it is provided
* false: it is not provided
* null: only the runtime knows if it is provided
* undefined: it was not determined if it is provided
*/
provided?: null | boolean;
/**
* is the export a terminal binding that should be checked for export star conflicts
*/
terminalBinding: boolean;
/**
* true: it can be mangled
* false: is can not be mangled
* undefined: it was not determined if it can be mangled
*/
canMangleProvide?: boolean;
/**
* true: it can be mangled
* false: is can not be mangled
* undefined: it was not determined if it can be mangled
*/
canMangleUse?: boolean;
exportsInfoOwned: boolean;
exportsInfo?: ExportsInfo;
get canMangle(): boolean;
setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
setHasUseInfo(): void;
setUsedConditionally(
condition: (arg0: UsageStateType) => boolean,
newValue: UsageStateType,
runtime: RuntimeSpec
): boolean;
setUsed(newValue: UsageStateType, runtime: RuntimeSpec): boolean;
unsetTarget(key?: any): boolean;
setTarget(
key: any,
connection: ModuleGraphConnection,
exportName?: string[],
priority?: number
): boolean;
getUsed(runtime: RuntimeSpec): UsageStateType;
/**
* get used name
*/
getUsedName(
fallbackName: undefined | string,
runtime: RuntimeSpec
): string | false;
hasUsedName(): boolean;
/**
* Sets the mangled name of this export
*/
setUsedName(name: string): void;
getTerminalBinding(
moduleGraph: ModuleGraph,
resolveTargetFilter?: (arg0: {
module: Module;
export?: string[];
}) => boolean
): undefined | ExportsInfo | ExportInfo;
isReexport(): undefined | boolean;
findTarget(
moduleGraph: ModuleGraph,
validTargetModuleFilter: (arg0: Module) => boolean
): undefined | false | { module: Module; export?: string[] };
getTarget(
moduleGraph: ModuleGraph,
resolveTargetFilter?: (arg0: {
module: Module;
export?: string[];
}) => boolean
): undefined | { module: Module; export?: string[] };
/**
* Move the target forward as long resolveTargetFilter is fulfilled
*/
moveTarget(
moduleGraph: ModuleGraph,
resolveTargetFilter: (arg0: {
module: Module;
export?: string[];
}) => boolean,
updateOriginalConnection?: (arg0: {
module: Module;
export?: string[];
}) => ModuleGraphConnection
): undefined | { module: Module; export?: string[] };
createNestedExportsInfo(): undefined | ExportsInfo;
getNestedExportsInfo(): undefined | ExportsInfo;
hasInfo(baseInfo?: any, runtime?: any): boolean;
updateHash(hash?: any, runtime?: any): void;
getUsedInfo(): string;
getProvidedInfo():
| "no provided info"
| "maybe provided (runtime-defined)"
| "provided"
| "not provided";
getRenameInfo(): string;
}
declare interface ExportSpec {
/**
* the name of the export
*/
name: string;
/**
* can the export be renamed (defaults to true)
*/
canMangle?: boolean;
/**
* is the export a terminal binding that should be checked for export star conflicts
*/
terminalBinding?: boolean;
/**
* nested exports
*/
exports?: (string | ExportSpec)[];
/**
* when reexported: from which module
*/
from?: ModuleGraphConnection;
/**
* when reexported: from which export
*/
export?: null | string[];
/**
* when reexported: with which priority
*/
priority?: number;
/**
* export is not visible, because another export blends over it
*/
hidden?: boolean;
}
type ExportedVariableInfo = string | ScopeInfo | VariableInfo;
declare abstract class ExportsInfo {
get ownedExports(): Iterable;
get orderedOwnedExports(): Iterable;
get exports(): Iterable;
get orderedExports(): Iterable;
get otherExportsInfo(): ExportInfo;
setRedirectNamedTo(exportsInfo?: ExportsInfo): boolean;
setHasProvideInfo(): void;
setHasUseInfo(): void;
getOwnExportInfo(name: string): ExportInfo;
getExportInfo(name: string): ExportInfo;
getReadOnlyExportInfo(name: string): ExportInfo;
getReadOnlyExportInfoRecursive(name: string[]): undefined | ExportInfo;
getNestedExportsInfo(name?: string[]): undefined | ExportsInfo;
setUnknownExportsProvided(
canMangle?: boolean,
excludeExports?: Set,
targetKey?: any,
targetModule?: ModuleGraphConnection,
priority?: number
): boolean;
setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
setAllKnownExportsUsed(runtime: RuntimeSpec): boolean;
setUsedForSideEffectsOnly(runtime: RuntimeSpec): boolean;
isUsed(runtime: RuntimeSpec): boolean;
isModuleUsed(runtime: RuntimeSpec): boolean;
getUsedExports(runtime: RuntimeSpec): null | boolean | SortableSet;
getProvidedExports(): null | true | string[];
getRelevantExports(runtime: RuntimeSpec): ExportInfo[];
isExportProvided(name: string | string[]): undefined | null | boolean;
getUsageKey(runtime: RuntimeSpec): string;
isEquallyUsed(runtimeA: RuntimeSpec, runtimeB: RuntimeSpec): boolean;
getUsed(name: string | string[], runtime: RuntimeSpec): UsageStateType;
getUsedName(
name: undefined | string | string[],
runtime: RuntimeSpec
): string | false | string[];
updateHash(hash: Hash, runtime: RuntimeSpec): void;
getRestoreProvidedData(): any;
restoreProvided(__0: {
otherProvided: any;
otherCanMangleProvide: any;
otherTerminalBinding: any;
exports: any;
}): void;
}
declare interface ExportsSpec {
/**
* exported names, true for unknown exports or null for no exports
*/
exports: null | true | (string | ExportSpec)[];
/**
* when exports = true, list of unaffected exports
*/
excludeExports?: Set;
/**
* list of maybe prior exposed, but now hidden exports
*/
hideExports?: Set;
/**
* when reexported: from which module
*/
from?: ModuleGraphConnection;
/**
* when reexported: with which priority
*/
priority?: number;
/**
* can the export be renamed (defaults to true)
*/
canMangle?: boolean;
/**
* are the exports terminal bindings that should be checked for export star conflicts
*/
terminalBinding?: boolean;
/**
* module on which the result depends on
*/
dependencies?: Module[];
}
type Exposes = (string | ExposesObject)[] | ExposesObject;
/**
* Advanced configuration for modules that should be exposed by this container.
*/
declare interface ExposesConfig {
/**
* Request to a module that should be exposed by this container.
*/
import: string | string[];
/**
* Custom chunk name for the exposed module.
*/
name?: string;
}
/**
* Modules that should be exposed by this container. Property names are used as public paths.
*/
declare interface ExposesObject {
[index: string]: string | ExposesConfig | string[];
}
type Expression =
| UnaryExpression
| ArrayExpression
| ArrowFunctionExpression
| AssignmentExpression
| AwaitExpression
| BinaryExpression
| SimpleCallExpression
| NewExpression
| ChainExpression
| ClassExpression
| ConditionalExpression
| FunctionExpression
| Identifier
| ImportExpression
| SimpleLiteral
| RegExpLiteral
| BigIntLiteral
| LogicalExpression
| MemberExpression
| MetaProperty
| ObjectExpression
| SequenceExpression
| TaggedTemplateExpression
| TemplateLiteral
| ThisExpression
| UpdateExpression
| YieldExpression;
declare interface ExpressionExpressionInfo {
type: "expression";
rootInfo: string | VariableInfo;
name: string;
getMembers: () => string[];
getMembersOptionals: () => boolean[];
getMemberRanges: () => [number, number][];
}
declare interface ExtensionAliasOption {
alias: string | string[];
extension: string;
}
declare interface ExtensionAliasOptions {
[index: string]: string | string[];
}
type ExternalItem =
| string
| RegExp
| (ExternalItemObjectKnown & ExternalItemObjectUnknown)
| ((
data: ExternalItemFunctionData,
callback: (
err?: null | Error,
result?: string | boolean | string[] | { [index: string]: any }
) => void
) => void)
| ((data: ExternalItemFunctionData) => Promise);
/**
* Data object passed as argument when a function is set for 'externals'.
*/
declare interface ExternalItemFunctionData {
/**
* The directory in which the request is placed.
*/
context?: string;
/**
* Contextual information.
*/
contextInfo?: ModuleFactoryCreateDataContextInfo;
/**
* The category of the referencing dependencies.
*/
dependencyType?: string;
/**
* Get a resolve function with the current resolver options.
*/
getResolve?: (
options?: ResolveOptions
) =>
| ((
context: string,
request: string,
callback: (err?: Error, result?: string) => void
) => void)
| ((context: string, request: string) => Promise);
/**
* The request as written by the user in the require/import expression/statement.
*/
request?: string;
}
/**
* If an dependency matches exactly a property of the object, the property value is used as dependency.
*/
declare interface ExternalItemObjectKnown {
/**
* Specify externals depending on the layer.
*/
byLayer?:
| { [index: string]: ExternalItem }
| ((layer: null | string) => ExternalItem);
}
/**
* If an dependency matches exactly a property of the object, the property value is used as dependency.
*/
declare interface ExternalItemObjectUnknown {
[index: string]: ExternalItemValue;
}
type ExternalItemValue = string | boolean | string[] | { [index: string]: any };
declare class ExternalModule extends Module {
constructor(
request: string | string[] | RequestRecord,
type: string,
userRequest: string,
dependencyMeta?: ImportDependencyMeta | CssImportDependencyMeta
);
request: string | string[] | Record;
externalType: string;
userRequest: string;
dependencyMeta?: ImportDependencyMeta | CssImportDependencyMeta;
/**
* restore unsafe cache data
*/
restoreFromUnsafeCache(
unsafeCacheData: object,
normalModuleFactory: NormalModuleFactory
): void;
}
declare interface ExternalModuleInfo {
index: number;
module: Module;
}
type Externals =
| string
| RegExp
| ExternalItem[]
| (ExternalItemObjectKnown & ExternalItemObjectUnknown)
| ((
data: ExternalItemFunctionData,
callback: (
err?: null | Error,
result?: string | boolean | string[] | { [index: string]: any }
) => void
) => void)
| ((data: ExternalItemFunctionData) => Promise);
declare class ExternalsPlugin {
constructor(type: undefined | string, externals: Externals);
type?: string;
externals: Externals;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
}
/**
* Enable presets of externals for specific targets.
*/
declare interface ExternalsPresets {
/**
* Treat common electron built-in modules in main and preload context like 'electron', 'ipc' or 'shell' as external and load them via require() when used.
*/
electron?: boolean;
/**
* Treat electron built-in modules in the main context like 'app', 'ipc-main' or 'shell' as external and load them via require() when used.
*/
electronMain?: boolean;
/**
* Treat electron built-in modules in the preload context like 'web-frame', 'ipc-renderer' or 'shell' as external and load them via require() when used.
*/
electronPreload?: boolean;
/**
* Treat electron built-in modules in the renderer context like 'web-frame', 'ipc-renderer' or 'shell' as external and load them via require() when used.
*/
electronRenderer?: boolean;
/**
* Treat node.js built-in modules like fs, path or vm as external and load them via require() when used.
*/
node?: boolean;
/**
* Treat NW.js legacy nw.gui module as external and load it via require() when used.
*/
nwjs?: boolean;
/**
* Treat references to 'http(s)://...' and 'std:...' as external and load them via import when used (Note that this changes execution order as externals are executed before any other code in the chunk).
*/
web?: boolean;
/**
* Treat references to 'http(s)://...' and 'std:...' as external and load them via async import() when used (Note that this external type is an async module, which has various effects on the execution).
*/
webAsync?: boolean;
}
type ExternalsType =
| "import"
| "var"
| "module"
| "assign"
| "this"
| "window"
| "self"
| "global"
| "commonjs"
| "commonjs2"
| "commonjs-module"
| "commonjs-static"
| "amd"
| "amd-require"
| "umd"
| "umd2"
| "jsonp"
| "system"
| "promise"
| "script"
| "node-commonjs";
declare interface FSImplementation {
open?: (...args: any[]) => any;
close?: (...args: any[]) => any;
}
declare interface FactorizeModuleOptions {
currentProfile: ModuleProfile;
factory: ModuleFactory;
dependencies: Dependency[];
/**
* return full ModuleFactoryResult instead of only module
*/
factoryResult?: boolean;
originModule: null | Module;
contextInfo?: Partial;
context?: string;
}
declare interface FactoryMeta {
sideEffectFree?: boolean;
}
type FakeHook = T & FakeHookMarker;
declare interface FakeHookMarker {}
declare interface FallbackCacheGroup {
chunksFilter: (chunk: Chunk) => undefined | boolean;
minSize: SplitChunksSizes;
maxAsyncSize: SplitChunksSizes;
maxInitialSize: SplitChunksSizes;
automaticNameDelimiter: string;
}
declare class FetchCompileAsyncWasmPlugin {
constructor();
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
}
declare class FetchCompileWasmPlugin {
constructor(options?: FetchCompileWasmPluginOptions);
options: FetchCompileWasmPluginOptions;
/**
* Apply the plugin
*/
apply(compiler: Compiler): void;
}
declare interface FetchCompileWasmPluginOptions {
/**
* mangle imports
*/
mangleImports?: boolean;
}
/**
* Options object for persistent file-based caching.
*/
declare interface FileCacheOptions {
/**
* Allows to collect unused memory allocated during deserialization. This requires copying data into smaller buffers and has a performance cost.
*/
allowCollectingMemory?: boolean;
/**
* Dependencies the build depends on (in multiple categories, default categories: 'defaultWebpack').
*/
buildDependencies?: { [index: string]: string[] };
/**
* Base directory for the cache (defaults to node_modules/.cache/webpack).
*/
cacheDirectory?: string;
/**
* Locations for the cache (defaults to cacheDirectory / name).
*/
cacheLocation?: string;
/**
* Compression type used for the cache files.
*/
compression?: false | "gzip" | "brotli";
/**
* Algorithm used for generation the hash (see node.js crypto package).
*/
hashAlgorithm?: string;
/**
* Time in ms after which idle period the cache storing should happen.
*/
idleTimeout?: number;
/**
* Time in ms after which idle period the cache storing should happen when larger changes has been detected (cumulative build time > 2 x avg cache store time).
*/
idleTimeoutAfterLargeChanges?: number;
/**
* Time in ms after which idle period the initial cache storing should happen.
*/
idleTimeoutForInitialStore?: number;
/**
* List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
*/
immutablePaths?: (string | RegExp)[];
/**
* List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
*/
managedPaths?: (string | RegExp)[];
/**
* Time for which unused cache entries stay in the filesystem cache at minimum (in milliseconds).
*/
maxAge?: number;
/**
* Number of generations unused cache entries stay in memory cache at minimum (0 = no memory cache used, 1 = may be removed after unused for a single compilation, ..., Infinity: kept forever). Cache entries will be deserialized from disk when removed from memory cache.
*/
maxMemoryGenerations?: number;
/**
* Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.
*/
memoryCacheUnaffected?: boolean;
/**
* Name for the cache. Different names will lead to different coexisting caches.
*/
name?: string;
/**
* Track and log detailed timing information for individual cache items.
*/
profile?: boolean;
/**
* Enable/disable readonly mode.
*/
readonly?: boolean;
/**
* When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).
*/
store?: "pack";
/**
* Filesystem caching.
*/
type: "filesystem";
/**
* Version of the cache data. Different versions won't allow to reuse the cache and override existing content. Update the version when config changed in a way which doesn't allow to reuse cache. This will invalidate the cache.
*/
version?: string;
}
declare interface FileSystem {
readFile: ReadFileTypes;
readdir: ReaddirTypes;
readJson?: (
arg0: PathOrFileDescriptorTypes,
arg1: (
arg0: null | Error | NodeJS.ErrnoException,
arg1?: JsonObjectTypes
) => void
) => void;
readlink: ReadlinkTypes;
lstat?: LStatTypes;
stat: StatTypes;
realpath?: RealPathTypes;
}
declare abstract class FileSystemInfo {
fs: InputFileSystem;
logger?: WebpackLogger;
fileTimestampQueue: AsyncQueue;
fileHashQueue: AsyncQueue;
contextTimestampQueue: AsyncQueue<
string,
string,
null | ContextFileSystemInfoEntry
>;
contextHashQueue: AsyncQueue;
contextTshQueue: AsyncQueue;
managedItemQueue: AsyncQueue