2020-05-12 21:58:14 +08:00
/ *
2020-03-21 21:01:38 +08:00
* This file was automatically generated .
* DO NOT MODIFY BY HAND .
* Run ` yarn special-lint-fix ` to update
* /
import {
ArrayExpression ,
2020-07-23 04:05:26 +08:00
ArrayPattern ,
2020-03-21 21:01:38 +08:00
ArrowFunctionExpression ,
AssignmentExpression ,
2020-07-23 04:05:26 +08:00
AssignmentPattern ,
AssignmentProperty ,
2020-03-21 21:01:38 +08:00
AwaitExpression ,
BinaryExpression ,
BlockStatement ,
BreakStatement ,
2020-07-23 04:05:26 +08:00
CatchClause ,
2020-07-03 17:34:54 +08:00
ChainExpression ,
2020-07-23 04:05:26 +08:00
ClassBody ,
2020-03-21 21:01:38 +08:00
ClassDeclaration ,
ClassExpression ,
Comment ,
ConditionalExpression ,
ContinueStatement ,
DebuggerStatement ,
DoWhileStatement ,
EmptyStatement ,
ExportAllDeclaration ,
ExportDefaultDeclaration ,
ExportNamedDeclaration ,
2020-07-23 04:05:26 +08:00
ExportSpecifier ,
2020-03-21 21:01:38 +08:00
ExpressionStatement ,
ForInStatement ,
ForOfStatement ,
ForStatement ,
FunctionDeclaration ,
FunctionExpression ,
Identifier ,
IfStatement ,
ImportDeclaration ,
2020-07-23 04:05:26 +08:00
ImportDefaultSpecifier ,
2020-07-03 17:34:54 +08:00
ImportExpression ,
2020-07-23 04:05:26 +08:00
ImportNamespaceSpecifier ,
ImportSpecifier ,
2020-03-21 21:01:38 +08:00
LabeledStatement ,
LogicalExpression ,
MemberExpression ,
MetaProperty ,
MethodDefinition ,
NewExpression ,
ObjectExpression ,
2020-07-23 04:05:26 +08:00
ObjectPattern ,
2020-03-21 21:01:38 +08:00
Program ,
2020-07-23 04:05:26 +08:00
Property ,
2020-03-21 21:01:38 +08:00
RegExpLiteral ,
2020-07-23 04:05:26 +08:00
RestElement ,
2020-03-21 21:01:38 +08:00
ReturnStatement ,
SequenceExpression ,
SimpleCallExpression ,
SimpleLiteral ,
2020-07-23 04:05:26 +08:00
SpreadElement ,
2020-03-21 21:01:38 +08:00
Super ,
2020-07-23 04:05:26 +08:00
SwitchCase ,
2020-03-21 21:01:38 +08:00
SwitchStatement ,
TaggedTemplateExpression ,
2020-07-23 04:05:26 +08:00
TemplateElement ,
2020-03-21 21:01:38 +08:00
TemplateLiteral ,
ThisExpression ,
ThrowStatement ,
TryStatement ,
UnaryExpression ,
UpdateExpression ,
VariableDeclaration ,
VariableDeclarator ,
WhileStatement ,
WithStatement ,
YieldExpression
} from "estree" ;
2020-12-14 20:16:20 +08:00
import { Stats as FsStats , WriteStream } from "fs" ;
2020-12-17 17:41:28 +08:00
import { JSONSchema4 , JSONSchema6 , JSONSchema7 } from "json-schema" ;
2020-03-21 21:01:38 +08:00
import { default as ValidationError } from "schema-utils/declarations/ValidationError" ;
2020-12-17 17:41:28 +08:00
import {
Extend ,
ValidationErrorConfiguration
} from "schema-utils/declarations/validate" ;
2020-03-21 21:01:38 +08:00
import {
AsArray ,
AsyncParallelHook ,
2020-06-17 21:53:14 +08:00
AsyncSeriesBailHook ,
AsyncSeriesHook ,
2020-03-21 21:01:38 +08:00
AsyncSeriesWaterfallHook ,
HookMap ,
MultiHook ,
SyncBailHook ,
2020-06-17 21:53:14 +08:00
SyncHook ,
2020-03-21 21:01:38 +08:00
SyncWaterfallHook
} from "tapable" ;
2020-04-21 14:45:35 +08:00
declare class AbstractLibraryPlugin < T > {
constructor ( __0 : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* name of the plugin
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
pluginName : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* used library type
2020-03-21 21:01:38 +08:00
* /
2020-08-26 03:45:56 +08:00
type : string ;
2020-04-21 14:45:35 +08:00
} ) ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
parseOptions ( library : LibraryOptions ) : false | T ;
2020-07-28 00:09:48 +08:00
finishEntryModule (
module : Module ,
entryName : string ,
libraryContext : LibraryContext < T >
) : void ;
2020-04-21 14:45:35 +08:00
runtimeRequirements (
chunk : Chunk ,
set : Set < string > ,
libraryContext : LibraryContext < T >
) : void ;
render (
source : Source ,
2020-05-08 05:29:42 +08:00
renderContext : RenderContextObject ,
2020-04-21 14:45:35 +08:00
libraryContext : LibraryContext < T >
) : Source ;
chunkHash (
chunk : Chunk ,
hash : Hash ,
chunkHashContext : ChunkHashContext ,
libraryContext : LibraryContext < T >
) : void ;
}
declare class AggressiveMergingPlugin {
constructor ( options? : any ) ;
options : any ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Apply the plugin
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
apply ( compiler : Compiler ) : void ;
}
declare class AggressiveSplittingPlugin {
constructor ( options? : AggressiveSplittingPluginOptions ) ;
options : AggressiveSplittingPluginOptions ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* 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 ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Extra cost multiplicator for entry chunks ( Default : 10 ) .
* /
entryChunkMultiplicator? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Byte , max size of per file ( Default : 50kiB ) .
* /
maxSize? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Byte , split point . ( Default : 30kiB ) .
* /
minSize? : number ;
}
declare interface Argument {
description : string ;
simpleType : "string" | "number" | "boolean" ;
multiple : boolean ;
2020-04-23 17:43:38 +08:00
configs : ArgumentConfig [ ] ;
2020-04-21 14:45:35 +08:00
}
declare interface ArgumentConfig {
description : string ;
path : string ;
multiple : boolean ;
type : "string" | "number" | "boolean" | "path" | "enum" | "RegExp" | "reset" ;
2020-04-23 17:43:38 +08:00
values? : any [ ] ;
2020-04-21 14:45:35 +08:00
}
declare interface Asset {
/ * *
* the filename of the asset
* /
name : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* source of the asset
* /
source : Source ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* info about the asset
* /
info : AssetInfo ;
}
declare interface AssetEmittedInfo {
content : Buffer ;
source : Source ;
compilation : Compilation ;
outputPath : string ;
targetPath : string ;
}
2020-12-17 17:07:29 +08:00
type AssetInfo = KnownAssetInfo & Record < string , any > ;
2020-04-21 14:45:35 +08:00
declare abstract class AsyncDependenciesBlock extends DependenciesBlock {
2020-04-22 12:40:18 +08:00
groupOptions : {
preloadOrder? : number ;
prefetchOrder? : number ;
name? : string ;
2020-11-26 17:49:59 +08:00
entryOptions? : EntryOptions ;
2020-04-22 12:40:18 +08:00
} ;
2020-12-17 01:26:46 +08:00
loc? : SyntheticDependencyLocation | RealDependencyLocation ;
request? : string ;
2020-04-21 14:45:35 +08:00
parent : DependenciesBlock ;
chunkName : string ;
module : any ;
}
declare abstract class AsyncQueue < T , K , R > {
hooks : {
2020-06-17 21:53:14 +08:00
beforeAdd : AsyncSeriesHook < [ T ] > ;
2020-11-26 17:48:16 +08:00
added : SyncHook < [ T ] > ;
2020-06-17 21:53:14 +08:00
beforeStart : AsyncSeriesHook < [ T ] > ;
2020-11-26 17:48:16 +08:00
started : SyncHook < [ T ] > ;
result : SyncHook < [ T , Error , R ] > ;
2020-04-21 14:45:35 +08:00
} ;
add ( item : T , callback : CallbackFunction < R > ) : void ;
invalidate ( item : T ) : void ;
stop ( ) : void ;
increaseParallelism ( ) : void ;
decreaseParallelism ( ) : void ;
isProcessing ( item : T ) : boolean ;
isQueued ( item : T ) : boolean ;
isDone ( item : T ) : boolean ;
}
declare class AsyncWebAssemblyModulesPlugin {
constructor ( options? : any ) ;
options : any ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
renderModule ( module ? : any , renderContext? : any , hooks? : any ) : any ;
static getCompilationHooks (
compilation : Compilation
) : CompilationHooksAsyncWebAssemblyModulesPlugin ;
}
declare class AutomaticPrefetchPlugin {
constructor ( ) ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
type AuxiliaryComment = string | LibraryCustomUmdCommentObject ;
declare class BannerPlugin {
constructor ( options : BannerPluginArgument ) ;
options : BannerPluginOptions ;
banner : ( data : { hash : string ; chunk : Chunk ; filename : string } ) = > string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* 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 ) ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* If true , the banner will only be added to the entry chunks .
* /
entryOnly? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Exclude all module s matching any of these conditions .
* /
2020-12-17 01:26:46 +08:00
exclude? : string | RegExp | ( string | RegExp ) [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Include all module s matching any of these conditions .
* /
2020-12-17 01:26:46 +08:00
include? : string | RegExp | ( string | RegExp ) [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* If true , banner will not be wrapped in a comment .
* /
raw? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Include all module s that pass test assertion .
* /
2020-12-17 01:26:46 +08:00
test? : string | RegExp | ( string | RegExp ) [ ] ;
2020-04-21 14:45:35 +08:00
}
2020-09-16 12:58:59 +08:00
declare interface BaseResolveRequest {
path : DevTool ;
descriptionFilePath? : string ;
descriptionFileRoot? : string ;
descriptionFileData? : any ;
relativePath? : string ;
ignoreSymlinks? : boolean ;
fullySpecified? : boolean ;
}
2020-04-21 14:45:35 +08:00
declare abstract class BasicEvaluatedExpression {
type : number ;
2020-07-23 00:58:08 +08:00
range : [ number , number ] ;
2020-04-21 14:45:35 +08:00
falsy : boolean ;
truthy : boolean ;
2020-12-17 01:26:46 +08:00
nullish? : boolean ;
2020-07-21 18:57:32 +08:00
sideEffects : boolean ;
2020-12-17 01:26:46 +08:00
bool ? : boolean ;
number ? : number ;
bigint ? : bigint ;
regExp? : RegExp ;
string ? : string ;
quasis? : BasicEvaluatedExpression [ ] ;
parts? : BasicEvaluatedExpression [ ] ;
array? : any [ ] ;
items? : BasicEvaluatedExpression [ ] ;
options? : BasicEvaluatedExpression [ ] ;
prefix? : BasicEvaluatedExpression ;
postfix? : BasicEvaluatedExpression ;
2020-04-21 14:45:35 +08:00
wrappedInnerExpressions : any ;
2020-12-17 01:26:46 +08:00
identifier? : string ;
2020-11-26 17:49:59 +08:00
rootInfo : VariableInfoInterface ;
2020-07-23 00:58:08 +08:00
getMembers : ( ) = > string [ ] ;
2020-07-23 04:05:26 +08:00
expression : NodeEstreeIndex ;
2020-07-21 18:57:32 +08:00
isUnknown ( ) : boolean ;
2020-04-21 14:45:35 +08:00
isNull ( ) : boolean ;
2020-07-06 23:13:09 +08:00
isUndefined ( ) : boolean ;
2020-04-21 14:45:35 +08:00
isString ( ) : boolean ;
isNumber ( ) : boolean ;
isBigInt ( ) : boolean ;
isBoolean ( ) : boolean ;
isRegExp ( ) : boolean ;
isConditional ( ) : boolean ;
isArray ( ) : boolean ;
isConstArray ( ) : boolean ;
isIdentifier ( ) : boolean ;
isWrapped ( ) : boolean ;
isTemplateString ( ) : boolean ;
2020-07-18 20:06:17 +08:00
/ * *
2020-07-20 18:07:08 +08:00
* Is expression a primitive or an object type value ?
* /
2020-12-17 01:26:46 +08:00
isPrimitiveType ( ) : undefined | boolean ;
2020-07-20 18:07:08 +08:00
/ * *
* Is expression a runtime or compile - time value ?
* /
isCompileTimeValue ( ) : boolean ;
/ * *
* Gets the compile - time value of the expression
2020-07-18 20:06:17 +08:00
* /
2020-07-20 18:07:08 +08:00
asCompileTimeValue ( ) : any ;
2020-04-21 14:45:35 +08:00
isTruthy ( ) : boolean ;
isFalsy ( ) : boolean ;
2020-12-17 01:26:46 +08:00
isNullish ( ) : undefined | boolean ;
2020-07-21 18:57:32 +08:00
/ * *
* Can this expression have side effects ?
* /
couldHaveSideEffects ( ) : boolean ;
2020-04-21 14:45:35 +08:00
asBool ( ) : any ;
2020-12-17 01:26:46 +08:00
asNullish ( ) : undefined | boolean ;
2020-04-21 14:45:35 +08:00
asString ( ) : any ;
setString ( string ? : any ) : BasicEvaluatedExpression ;
2020-07-06 23:13:09 +08:00
setUndefined ( ) : BasicEvaluatedExpression ;
2020-04-21 14:45:35 +08:00
setNull ( ) : BasicEvaluatedExpression ;
setNumber ( number ? : any ) : BasicEvaluatedExpression ;
setBigInt ( bigint ? : any ) : BasicEvaluatedExpression ;
setBoolean ( bool ? : any ) : BasicEvaluatedExpression ;
setRegExp ( regExp? : any ) : BasicEvaluatedExpression ;
setIdentifier (
identifier? : any ,
rootInfo? : any ,
getMembers? : any
) : BasicEvaluatedExpression ;
setWrapped (
prefix? : any ,
postfix? : any ,
innerExpressions? : any
) : BasicEvaluatedExpression ;
setOptions ( options? : any ) : BasicEvaluatedExpression ;
addOptions ( options? : any ) : BasicEvaluatedExpression ;
setItems ( items? : any ) : BasicEvaluatedExpression ;
setArray ( array? : any ) : BasicEvaluatedExpression ;
setTemplateString (
quasis? : any ,
parts? : any ,
kind? : any
) : BasicEvaluatedExpression ;
templateStringKind : any ;
setTruthy ( ) : BasicEvaluatedExpression ;
setFalsy ( ) : BasicEvaluatedExpression ;
2020-07-20 15:19:18 +08:00
setNullish ( value? : any ) : BasicEvaluatedExpression ;
2020-04-21 14:45:35 +08:00
setRange ( range? : any ) : BasicEvaluatedExpression ;
2020-07-21 18:57:32 +08:00
setSideEffects ( sideEffects? : boolean ) : BasicEvaluatedExpression ;
2020-04-21 14:45:35 +08:00
setExpression ( expression? : any ) : BasicEvaluatedExpression ;
}
2020-11-26 17:49:59 +08:00
type BuildMeta = KnownBuildMeta & Record < string , any > ;
2020-04-21 14:45:35 +08:00
declare abstract class ByTypeGenerator extends Generator {
map : any ;
}
2020-10-05 22:57:31 +08:00
declare const CIRCULAR_CONNECTION : unique symbol ;
2020-04-21 14:45:35 +08:00
declare class Cache {
constructor ( ) ;
hooks : {
2020-06-17 21:53:14 +08:00
get : AsyncSeriesBailHook <
2020-07-15 17:14:28 +08:00
[
string ,
2020-12-17 01:26:46 +08:00
null | Etag ,
( ( result : any , callback : ( arg0? : Error ) = > void ) = > void ) [ ]
2020-07-15 17:14:28 +08:00
] ,
2020-04-21 14:45:35 +08:00
any
> ;
2020-12-17 01:26:46 +08:00
store : AsyncParallelHook < [ string , null | Etag , any ] > ;
2020-04-21 14:45:35 +08:00
storeBuildDependencies : AsyncParallelHook < [ Iterable < string > ] > ;
2020-11-26 17:48:16 +08:00
beginIdle : SyncHook < [ ] > ;
2020-04-21 14:45:35 +08:00
endIdle : AsyncParallelHook < [ ] > ;
shutdown : AsyncParallelHook < [ ] > ;
} ;
2020-12-17 01:26:46 +08:00
get < T > (
identifier : string ,
etag : null | Etag ,
callback : CallbackCache < T >
) : void ;
2020-04-21 14:45:35 +08:00
store < T > (
identifier : string ,
2020-12-17 01:26:46 +08:00
etag : null | Etag ,
2020-04-21 14:45:35 +08:00
data : T ,
callback : CallbackCache < void >
) : void ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* After this method has succeeded the cache can only be restored when build dependencies are
* /
storeBuildDependencies (
dependencies : Iterable < string > ,
callback : CallbackCache < void >
) : void ;
beginIdle ( ) : void ;
endIdle ( callback : CallbackCache < void > ) : void ;
shutdown ( callback : CallbackCache < void > ) : void ;
static STAGE_MEMORY : number ;
static STAGE_DEFAULT : number ;
static STAGE_DISK : number ;
static STAGE_NETWORK : number ;
}
2020-07-15 17:14:28 +08:00
declare abstract class CacheFacade {
getChildCache ( name : string ) : CacheFacade ;
2020-12-17 01:26:46 +08:00
getItemCache ( identifier : string , etag : null | Etag ) : ItemCacheFacade ;
2020-07-15 17:14:28 +08:00
getLazyHashedEtag ( obj : HashableObject ) : Etag ;
2020-08-19 17:25:24 +08:00
mergeEtags ( a : Etag , b : Etag ) : Etag ;
2020-12-17 01:26:46 +08:00
get < T > (
identifier : string ,
etag : null | Etag ,
callback : CallbackCache < T >
) : void ;
getPromise < T > ( identifier : string , etag : null | Etag ) : Promise < T > ;
2020-07-15 17:14:28 +08:00
store < T > (
identifier : string ,
2020-12-17 01:26:46 +08:00
etag : null | Etag ,
2020-07-15 17:14:28 +08:00
data : T ,
callback : CallbackCache < void >
) : void ;
2020-12-17 01:26:46 +08:00
storePromise < T > (
identifier : string ,
etag : null | Etag ,
data : T
) : Promise < void > ;
2020-08-19 17:25:24 +08:00
provide < T > (
identifier : string ,
2020-12-17 01:26:46 +08:00
etag : null | Etag ,
2020-08-19 17:25:24 +08:00
computer : ( arg0 : CallbackNormalErrorCache < T > ) = > void ,
callback : CallbackNormalErrorCache < T >
) : void ;
providePromise < T > (
identifier : string ,
2020-12-17 01:26:46 +08:00
etag : null | Etag ,
2020-08-19 17:25:24 +08:00
computer : ( ) = > T | Promise < T >
) : Promise < T > ;
2020-07-15 17:14:28 +08:00
}
2020-04-21 14:45:35 +08:00
declare interface CacheGroupSource {
key? : string ;
priority? : number ;
2020-12-17 01:26:46 +08:00
getName ? : (
module ? : Module ,
chunks? : Chunk [ ] ,
key? : string
) = > undefined | string ;
2020-04-21 14:45:35 +08:00
chunksFilter ? : ( chunk : Chunk ) = > boolean ;
enforce? : boolean ;
minSize : Record < string , number > ;
minRemainingSize : Record < string , number > ;
2020-07-13 16:12:17 +08:00
enforceSizeThreshold : Record < string , number > ;
2020-04-21 14:45:35 +08:00
maxAsyncSize : Record < string , number > ;
maxInitialSize : Record < string , number > ;
minChunks? : number ;
maxAsyncRequests? : number ;
maxInitialRequests? : number ;
2020-12-17 01:26:46 +08:00
filename? : string | ( ( arg0 : PathData , arg1? : AssetInfo ) = > string ) ;
2020-04-21 14:45:35 +08:00
idHint? : string ;
automaticNameDelimiter : string ;
reuseExistingChunk? : boolean ;
2020-07-28 00:09:48 +08:00
usedExports? : boolean ;
2020-04-21 14:45:35 +08:00
}
declare interface CacheGroupsContext {
module Graph : ModuleGraph ;
chunkGraph : ChunkGraph ;
}
type CacheOptionsNormalized = false | MemoryCacheOptions | FileCacheOptions ;
2020-08-20 02:05:47 +08:00
declare class CachedSource extends Source {
2020-08-24 18:54:53 +08:00
constructor ( source : Source ) ;
constructor ( source : Source | ( ( ) = > Source ) , cachedData? : any ) ;
2020-08-20 02:05:47 +08:00
original ( ) : Source ;
2020-08-24 18:54:53 +08:00
originalLazy ( ) : Source | ( ( ) = > Source ) ;
2020-08-20 02:05:47 +08:00
getCachedData ( ) : any ;
}
2020-04-21 14:45:35 +08:00
type CallExpression = SimpleCallExpression | NewExpression ;
2020-11-26 17:49:59 +08:00
declare interface CallExpressionInfo {
type : "call" ;
call : CallExpression ;
calleeName : string ;
rootInfo : string | VariableInfo ;
getCalleeMembers : ( ) = > string [ ] ;
name : string ;
getMembers : ( ) = > string [ ] ;
}
2020-04-21 14:45:35 +08:00
declare interface CallbackCache < T > {
2020-07-15 17:14:28 +08:00
( err? : WebpackError , result? : T ) : void ;
2020-04-21 14:45:35 +08:00
}
declare interface CallbackFunction < T > {
( err? : Error , result? : T ) : any ;
}
2020-08-19 17:25:24 +08:00
declare interface CallbackNormalErrorCache < T > {
( err? : Error , result? : T ) : void ;
}
2020-04-21 14:45:35 +08:00
declare interface CallbackWebpack < T > {
( err? : Error , stats? : T ) : void ;
}
2020-12-17 01:26:46 +08:00
type Cell < T > = undefined | T ;
2020-04-21 14:45:35 +08:00
declare class Chunk {
constructor ( name? : string ) ;
2020-12-17 01:26:46 +08:00
id : null | string | number ;
ids : null | ( string | number ) [ ] ;
2020-04-21 14:45:35 +08:00
debugId : number ;
name : string ;
idNameHints : SortableSet < string > ;
preventIntegration : boolean ;
2020-12-17 01:26:46 +08:00
filenameTemplate :
| null
| string
| ( ( arg0 : PathData , arg1? : AssetInfo ) = > string ) ;
2020-11-26 17:49:59 +08:00
runtime : RuntimeSpec ;
2020-04-21 14:45:35 +08:00
files : Set < string > ;
auxiliaryFiles : Set < string > ;
rendered : boolean ;
2020-12-17 01:26:46 +08:00
hash? : string ;
2020-04-21 14:45:35 +08:00
contentHash : Record < string , string > ;
2020-12-17 01:26:46 +08:00
renderedHash? : string ;
chunkReason? : string ;
2020-04-21 14:45:35 +08:00
extraAsync : boolean ;
2020-12-17 01:26:46 +08:00
readonly entryModule? : Module ;
2020-04-21 14:45:35 +08:00
hasEntryModule ( ) : boolean ;
addModule ( module : Module ) : boolean ;
removeModule ( module : Module ) : void ;
getNumberOfModules ( ) : number ;
readonly module sIterable : Iterable < Module > ;
compareTo ( otherChunk : Chunk ) : 0 | 1 | - 1 ;
containsModule ( module : Module ) : boolean ;
2020-04-23 17:43:38 +08:00
getModules ( ) : Module [ ] ;
2020-04-21 14:45:35 +08:00
remove ( ) : void ;
moveModule ( module : Module , otherChunk : Chunk ) : void ;
integrate ( otherChunk : Chunk ) : boolean ;
canBeIntegrated ( otherChunk : Chunk ) : boolean ;
isEmpty ( ) : boolean ;
module sSize ( ) : 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 ;
2020-12-17 01:26:46 +08:00
getEntryOptions ( ) : undefined | EntryOptions ;
2020-04-21 14:45:35 +08:00
addGroup ( chunkGroup : ChunkGroup ) : void ;
removeGroup ( chunkGroup : ChunkGroup ) : void ;
isInGroup ( chunkGroup : ChunkGroup ) : boolean ;
getNumberOfGroups ( ) : number ;
readonly groupsIterable : Iterable < ChunkGroup > ;
disconnectFromGroups ( ) : void ;
split ( newChunk : Chunk ) : void ;
updateHash ( hash : Hash , chunkGraph : ChunkGraph ) : void ;
getAllAsyncChunks ( ) : Set < Chunk > ;
2020-05-26 05:14:19 +08:00
getAllInitialChunks ( ) : Set < Chunk > ;
2020-04-21 14:45:35 +08:00
getAllReferencedChunks ( ) : Set < Chunk > ;
2020-09-08 00:02:14 +08:00
getAllReferencedAsyncEntrypoints ( ) : Set < Entrypoint > ;
2020-04-21 14:45:35 +08:00
hasAsyncChunks ( ) : boolean ;
getChildIdsByOrders (
chunkGraph : ChunkGraph ,
filterFn ? : ( c : Chunk , chunkGraph : ChunkGraph ) = > boolean
2020-04-23 17:43:38 +08:00
) : Record < string , ( string | number ) [ ] > ;
2020-04-21 14:45:35 +08:00
getChildIdsByOrdersMap (
chunkGraph : ChunkGraph ,
includeDirectChildren? : boolean ,
filterFn ? : ( c : Chunk , chunkGraph : ChunkGraph ) = > boolean
2020-04-23 17:43:38 +08:00
) : Record < string | number , Record < string , ( string | number ) [ ] > > ;
2020-04-21 14:45:35 +08:00
}
declare class ChunkGraph {
constructor ( module Graph : ModuleGraph ) ;
module Graph : ModuleGraph ;
connectChunkAndModule ( chunk : Chunk , module : Module ) : void ;
disconnectChunkAndModule ( chunk : Chunk , module : Module ) : void ;
disconnectChunk ( chunk : Chunk ) : void ;
attachModules ( chunk : Chunk , module s : Iterable < Module > ) : void ;
attachRuntimeModules ( chunk : Chunk , module s : Iterable < RuntimeModule > ) : void ;
2020-05-01 05:43:53 +08:00
attachFullHashModules ( chunk : Chunk , module s : Iterable < RuntimeModule > ) : void ;
2020-04-21 14:45:35 +08:00
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 < Chunk > ;
getOrderedModuleChunksIterable (
module : Module ,
sortFn : ( arg0 : Chunk , arg1 : Chunk ) = > 0 | 1 | - 1
) : Iterable < Chunk > ;
2020-04-23 17:43:38 +08:00
getModuleChunks ( module : Module ) : Chunk [ ] ;
2020-04-21 14:45:35 +08:00
getNumberOfModuleChunks ( module : Module ) : number ;
2020-07-28 00:09:48 +08:00
getModuleRuntimes ( module : Module ) : RuntimeSpecSet ;
2020-04-21 14:45:35 +08:00
getNumberOfChunkModules ( chunk : Chunk ) : number ;
getChunkModulesIterable ( chunk : Chunk ) : Iterable < Module > ;
getChunkModulesIterableBySourceType (
chunk : Chunk ,
sourceType : string
2020-12-17 01:26:46 +08:00
) : undefined | Iterable < Module > ;
2020-04-21 14:45:35 +08:00
getOrderedChunkModulesIterable (
chunk : Chunk ,
comparator : ( arg0 : Module , arg1 : Module ) = > 0 | 1 | - 1
) : Iterable < Module > ;
getOrderedChunkModulesIterableBySourceType (
chunk : Chunk ,
sourceType : string ,
comparator : ( arg0 : Module , arg1 : Module ) = > 0 | 1 | - 1
2020-12-17 01:26:46 +08:00
) : undefined | Iterable < Module > ;
2020-04-23 17:43:38 +08:00
getChunkModules ( chunk : Chunk ) : Module [ ] ;
2020-04-21 14:45:35 +08:00
getOrderedChunkModules (
chunk : Chunk ,
comparator : ( arg0 : Module , arg1 : Module ) = > 0 | 1 | - 1
2020-04-23 17:43:38 +08:00
) : Module [ ] ;
2020-07-28 23:08:22 +08:00
getChunkModuleIdMap (
chunk : Chunk ,
filterFn : ( m : Module ) = > boolean ,
includeAllChunks? : boolean
) : Record < string | number , ( string | number ) [ ] > ;
getChunkModuleRenderedHashMap (
chunk : Chunk ,
filterFn : ( m : Module ) = > boolean ,
hashLength? : number ,
includeAllChunks? : boolean
) : Record < string | number , Record < string | number , string > > ;
2020-04-21 14:45:35 +08:00
getChunkConditionMap (
chunk : Chunk ,
filterFn : ( c : Chunk , chunkGraph : ChunkGraph ) = > boolean
) : Record < string | number , boolean > ;
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 < string , number > ;
2020-04-23 17:43:38 +08:00
getChunkRootModules ( chunk : Chunk ) : Module [ ] ;
2020-04-21 14:45:35 +08:00
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 ;
isEntryModuleInChunk ( module : Module , chunk : Chunk ) : boolean ;
connectChunkAndEntryModule (
chunk : Chunk ,
module : Module ,
entrypoint? : Entrypoint
) : void ;
connectChunkAndRuntimeModule ( chunk : Chunk , module : RuntimeModule ) : void ;
2020-05-01 05:43:53 +08:00
addFullHashModuleToChunk ( chunk : Chunk , module : RuntimeModule ) : void ;
2020-04-21 14:45:35 +08:00
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 < Module > ;
getChunkEntryDependentChunksIterable ( chunk : Chunk ) : Iterable < Chunk > ;
hasChunkEntryDependentChunks ( chunk : Chunk ) : boolean ;
getChunkRuntimeModulesIterable ( chunk : Chunk ) : Iterable < RuntimeModule > ;
2020-04-23 17:43:38 +08:00
getChunkRuntimeModulesInOrder ( chunk : Chunk ) : RuntimeModule [ ] ;
2020-12-17 01:26:46 +08:00
getChunkFullHashModulesIterable (
chunk : Chunk
) : undefined | Iterable < RuntimeModule > ;
2020-04-21 14:45:35 +08:00
getChunkEntryModulesWithChunkGroupIterable (
chunk : Chunk
2020-12-17 01:26:46 +08:00
) : Iterable < [ Module , undefined | Entrypoint ] > ;
2020-04-21 14:45:35 +08:00
getBlockChunkGroup ( depBlock : AsyncDependenciesBlock ) : ChunkGroup ;
connectBlockAndChunkGroup (
depBlock : AsyncDependenciesBlock ,
chunkGroup : ChunkGroup
) : void ;
disconnectChunkGroup ( chunkGroup : ChunkGroup ) : void ;
getModuleId ( module : Module ) : string | number ;
setModuleId ( module : Module , id : string | number ) : void ;
2020-10-23 20:52:23 +08:00
getRuntimeId ( runtime : string ) : string | number ;
setRuntimeId ( runtime : string , id : string | number ) : void ;
2020-11-26 17:49:59 +08:00
hasModuleHashes ( module : Module , runtime : RuntimeSpec ) : boolean ;
getModuleHash ( module : Module , runtime : RuntimeSpec ) : string ;
getRenderedModuleHash ( module : Module , runtime : RuntimeSpec ) : string ;
2020-07-28 00:09:48 +08:00
setModuleHashes (
module : Module ,
2020-11-26 17:49:59 +08:00
runtime : RuntimeSpec ,
2020-07-28 00:09:48 +08:00
hash : string ,
renderedHash : string
) : void ;
addModuleRuntimeRequirements (
module : Module ,
2020-11-26 17:49:59 +08:00
runtime : RuntimeSpec ,
2020-07-28 00:09:48 +08:00
items : Set < string >
) : void ;
2020-04-21 14:45:35 +08:00
addChunkRuntimeRequirements ( chunk : Chunk , items : Set < string > ) : void ;
addTreeRuntimeRequirements ( chunk : Chunk , items : Iterable < string > ) : void ;
2020-07-28 00:09:48 +08:00
getModuleRuntimeRequirements (
module : Module ,
2020-11-26 17:49:59 +08:00
runtime : RuntimeSpec
2020-07-28 00:09:48 +08:00
) : ReadonlySet < string > ;
2020-04-21 14:45:35 +08:00
getChunkRuntimeRequirements ( chunk : Chunk ) : ReadonlySet < string > ;
getTreeRuntimeRequirements ( chunk : Chunk ) : ReadonlySet < string > ;
static getChunkGraphForModule (
module : Module ,
deprecateMessage : string ,
deprecationCode : string
) : ChunkGraph ;
static setChunkGraphForModule ( module : Module , chunkGraph : ChunkGraph ) : void ;
static getChunkGraphForChunk (
chunk : Chunk ,
deprecateMessage : string ,
deprecationCode : string
) : ChunkGraph ;
static setChunkGraphForChunk ( chunk : Chunk , chunkGraph : ChunkGraph ) : void ;
}
declare abstract class ChunkGroup {
groupDebugId : number ;
2020-11-26 17:49:59 +08:00
options : ChunkGroupOptions ;
2020-04-23 17:43:38 +08:00
chunks : Chunk [ ] ;
2020-11-26 17:49:59 +08:00
origins : OriginRecord [ ] ;
2020-04-21 14:45:35 +08:00
index : number ;
/ * *
* when a new chunk is added to a chunkGroup , addingOptions will occur .
* /
2020-11-26 17:49:59 +08:00
addOptions ( options : ChunkGroupOptions ) : void ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* returns the name of current ChunkGroup
* sets a new name for current ChunkGroup
* /
2020-12-17 01:26:46 +08:00
name? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* get a uniqueId for ChunkGroup , made up of its member Chunk debugId ' s
* /
readonly debugId : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* get a unique id for ChunkGroup , made up of its member Chunk id ' s
* /
readonly id : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Performs an unshift of a specific chunk
* /
unshiftChunk ( chunk : Chunk ) : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* inserts a chunk before another existing chunk in group
* /
insertChunk ( chunk : Chunk , before : Chunk ) : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* add a chunk into ChunkGroup . Is pushed on or prepended
* /
pushChunk ( chunk : Chunk ) : boolean ;
replaceChunk ( oldChunk : Chunk , newChunk : Chunk ) : boolean ;
removeChunk ( chunk : Chunk ) : boolean ;
isInitial ( ) : boolean ;
addChild ( group : ChunkGroup ) : boolean ;
2020-04-23 17:43:38 +08:00
getChildren ( ) : ChunkGroup [ ] ;
2020-04-21 14:45:35 +08:00
getNumberOfChildren ( ) : number ;
readonly childrenIterable : SortableSet < ChunkGroup > ;
removeChild ( group : ChunkGroup ) : boolean ;
addParent ( parentChunk : ChunkGroup ) : boolean ;
2020-04-23 17:43:38 +08:00
getParents ( ) : ChunkGroup [ ] ;
2020-04-21 14:45:35 +08:00
getNumberOfParents ( ) : number ;
hasParent ( parent : ChunkGroup ) : boolean ;
readonly parentsIterable : SortableSet < ChunkGroup > ;
removeParent ( chunkGroup : ChunkGroup ) : boolean ;
2020-09-08 00:02:14 +08:00
addAsyncEntrypoint ( entrypoint : Entrypoint ) : boolean ;
readonly asyncEntrypointsIterable : SortableSet < ChunkGroup > ;
2020-04-23 17:43:38 +08:00
getBlocks ( ) : any [ ] ;
2020-04-21 14:45:35 +08:00
getNumberOfBlocks ( ) : number ;
hasBlock ( block? : any ) : boolean ;
readonly blocksIterable : Iterable < AsyncDependenciesBlock > ;
addBlock ( block : AsyncDependenciesBlock ) : boolean ;
2020-11-26 17:49:59 +08:00
addOrigin ( module : Module , loc : DependencyLocation , request : string ) : void ;
2020-04-23 17:43:38 +08:00
getFiles ( ) : string [ ] ;
2020-04-21 14:45:35 +08:00
remove ( ) : void ;
sortItems ( ) : void ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* 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 (
module Graph : ModuleGraph ,
chunkGraph : ChunkGraph
2020-04-23 17:43:38 +08:00
) : Record < string , ChunkGroup [ ] > ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Sets the top - down index of a module in this ChunkGroup
* /
setModulePreOrderIndex ( module : Module , index : number ) : void ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Gets the top - down index of a module in this ChunkGroup
* /
getModulePreOrderIndex ( module : Module ) : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Sets the bottom - up index of a module in this ChunkGroup
* /
setModulePostOrderIndex ( module : Module , index : number ) : void ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Gets the bottom - up index of a module in this ChunkGroup
* /
getModulePostOrderIndex ( module : Module ) : number ;
checkConstraints ( ) : void ;
getModuleIndex : ( module : Module ) = > number ;
getModuleIndex2 : ( module : Module ) = > number ;
}
2020-11-26 17:49:59 +08:00
declare interface ChunkGroupOptions {
preloadOrder? : number ;
prefetchOrder? : number ;
name? : string ;
}
2020-04-21 14:45:35 +08:00
declare interface ChunkHashContext {
/ * *
* the runtime template
* /
runtimeTemplate : RuntimeTemplate ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* the module graph
* /
module Graph : ModuleGraph ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the chunk graph
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
chunkGraph : ChunkGraph ;
}
declare interface ChunkMaps {
hash : Record < string | number , string > ;
contentHash : Record < string | number , Record < string , string > > ;
name : Record < string | number , string > ;
}
declare class ChunkModuleIdRangePlugin {
constructor ( options? : any ) ;
options : any ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare interface ChunkModuleMaps {
2020-04-23 17:43:38 +08:00
id : Record < string | number , ( string | number ) [ ] > ;
2020-04-21 14:45:35 +08:00
hash : Record < string | number , string > ;
}
declare interface ChunkPathData {
id : string | number ;
name? : string ;
hash : string ;
hashWithLength ? : ( arg0 : number ) = > string ;
contentHash? : Record < string , string > ;
contentHashWithLength? : Record < string , ( length : number ) = > string > ;
}
2020-08-20 05:17:33 +08:00
declare class ChunkPrefetchPreloadPlugin {
constructor ( ) ;
apply ( compiler : Compiler ) : void ;
}
2020-04-21 14:45:35 +08:00
declare interface ChunkSizeOptions {
/ * *
* constant overhead for a chunk
* /
chunkOverhead? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* multiplicator for initial chunks
* /
entryChunkMultiplicator? : number ;
}
declare abstract class ChunkTemplate {
hooks : Readonly < {
renderManifest : { tap : ( options? : any , fn? : any ) = > void } ;
module s : { 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 } ;
} > ;
2020-08-03 02:09:36 +08:00
readonly outputOptions : Output ;
2020-04-21 14:45:35 +08:00
}
declare interface CodeGenerationContext {
/ * *
* the dependency templates
* /
dependencyTemplates : DependencyTemplates ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* the runtime template
* /
runtimeTemplate : RuntimeTemplate ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* the module graph
* /
module Graph : ModuleGraph ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* the chunk graph
* /
chunkGraph : ChunkGraph ;
2020-07-28 00:09:48 +08:00
/ * *
* the runtimes code should be generated for
* /
2020-11-26 17:49:59 +08:00
runtime : RuntimeSpec ;
2020-09-11 15:06:24 +08:00
/ * *
* when in concatenated module , information about other concatenated module s
* /
concatenationScope? : ConcatenationScope ;
2020-04-21 14:45:35 +08:00
}
declare interface CodeGenerationResult {
/ * *
* the resulting sources for all source types
* /
sources : Map < string , Source > ;
2020-03-21 21:01:38 +08:00
2020-05-25 16:50:37 +08:00
/ * *
* the resulting data for all source types
* /
data? : Map < string , any > ;
2020-04-21 14:45:35 +08:00
/ * *
* the runtime requirements
* /
runtimeRequirements : ReadonlySet < string > ;
}
2020-07-28 00:09:48 +08:00
declare abstract class CodeGenerationResults {
map : Map < Module , RuntimeSpecMap < CodeGenerationResult > > ;
2020-11-26 17:49:59 +08:00
get ( module : Module , runtime : RuntimeSpec ) : CodeGenerationResult ;
getSource ( module : Module , runtime : RuntimeSpec , sourceType : string ) : Source ;
2020-07-28 00:09:48 +08:00
getRuntimeRequirements (
module : Module ,
2020-11-26 17:49:59 +08:00
runtime : RuntimeSpec
2020-07-28 00:09:48 +08:00
) : ReadonlySet < string > ;
2020-11-26 17:49:59 +08:00
getData ( module : Module , runtime : RuntimeSpec , key : string ) : any ;
add ( module : Module , runtime : RuntimeSpec , result : CodeGenerationResult ) : void ;
}
declare interface Comparator < T > {
( arg0 : T , arg1 : T ) : 0 | 1 | - 1 ;
2020-07-28 00:09:48 +08:00
}
2020-08-20 15:54:02 +08:00
declare class CompatSource extends Source {
constructor ( sourceLike : SourceLike ) ;
static from ( sourceLike : SourceLike ) : Source ;
}
2020-04-21 14:45:35 +08:00
declare class Compilation {
/ * *
* Creates an instance of Compilation .
* /
constructor ( compiler : Compiler ) ;
hooks : Readonly < {
2020-11-26 17:48:16 +08:00
buildModule : SyncHook < [ Module ] > ;
rebuildModule : SyncHook < [ Module ] > ;
failedModule : SyncHook < [ Module , WebpackError ] > ;
succeedModule : SyncHook < [ Module ] > ;
stillValidModule : SyncHook < [ Module ] > ;
2020-11-26 17:49:59 +08:00
addEntry : SyncHook < [ Dependency , EntryOptions ] > ;
failedEntry : SyncHook < [ Dependency , EntryOptions , Error ] > ;
succeedEntry : SyncHook < [ Dependency , EntryOptions , Module ] > ;
2020-05-28 02:34:55 +08:00
dependencyReferencedExports : SyncWaterfallHook <
2020-11-26 17:49:59 +08:00
[ ( string [ ] | ReferencedExport ) [ ] , Dependency , RuntimeSpec ]
2020-05-28 02:34:55 +08:00
> ;
2020-06-17 21:53:14 +08:00
finishModules : AsyncSeriesHook < [ Iterable < Module > ] > ;
finishRebuildingModule : AsyncSeriesHook < [ Module ] > ;
2020-11-26 17:48:16 +08:00
unseal : SyncHook < [ ] > ;
seal : SyncHook < [ ] > ;
beforeChunks : SyncHook < [ ] > ;
afterChunks : SyncHook < [ Iterable < Chunk > ] > ;
2020-04-21 14:45:35 +08:00
optimizeDependencies : SyncBailHook < [ Iterable < Module > ] , any > ;
2020-11-26 17:48:16 +08:00
afterOptimizeDependencies : SyncHook < [ Iterable < Module > ] > ;
optimize : SyncHook < [ ] > ;
2020-04-21 14:45:35 +08:00
optimizeModules : SyncBailHook < [ Iterable < Module > ] , any > ;
2020-11-26 17:48:16 +08:00
afterOptimizeModules : SyncHook < [ Iterable < Module > ] > ;
2020-04-23 17:43:38 +08:00
optimizeChunks : SyncBailHook < [ Iterable < Chunk > , ChunkGroup [ ] ] , any > ;
2020-11-26 17:48:16 +08:00
afterOptimizeChunks : SyncHook < [ Iterable < Chunk > , ChunkGroup [ ] ] > ;
2020-06-17 21:53:14 +08:00
optimizeTree : AsyncSeriesHook < [ Iterable < Chunk > , Iterable < Module > ] > ;
2020-11-26 17:48:16 +08:00
afterOptimizeTree : SyncHook < [ Iterable < Chunk > , Iterable < Module > ] > ;
2020-06-17 21:53:14 +08:00
optimizeChunkModules : AsyncSeriesBailHook <
2020-04-21 14:45:35 +08:00
[ Iterable < Chunk > , Iterable < Module > ] ,
any
2020-03-21 21:01:38 +08:00
> ;
2020-11-26 17:48:16 +08:00
afterOptimizeChunkModules : SyncHook < [ Iterable < Chunk > , Iterable < Module > ] > ;
2020-04-21 14:45:35 +08:00
shouldRecord : SyncBailHook < [ ] , boolean > ;
2020-11-26 17:48:16 +08:00
additionalChunkRuntimeRequirements : SyncHook < [ Chunk , Set < string > ] > ;
2020-04-21 14:45:35 +08:00
runtimeRequirementInChunk : HookMap < SyncBailHook < [ Chunk , Set < string > ] , any >> ;
2020-11-26 17:48:16 +08:00
additionalModuleRuntimeRequirements : SyncHook < [ Module , Set < string > ] > ;
2020-04-21 14:45:35 +08:00
runtimeRequirementInModule : HookMap <
SyncBailHook < [ Module , Set < string > ] , any >
2020-03-21 21:01:38 +08:00
> ;
2020-11-26 17:48:16 +08:00
additionalTreeRuntimeRequirements : SyncHook < [ Chunk , Set < string > ] > ;
2020-04-21 14:45:35 +08:00
runtimeRequirementInTree : HookMap < SyncBailHook < [ Chunk , Set < string > ] , any >> ;
2020-11-26 17:48:16 +08:00
runtimeModule : SyncHook < [ RuntimeModule , Chunk ] > ;
reviveModules : SyncHook < [ Iterable < Module > , any ] > ;
beforeModuleIds : SyncHook < [ Iterable < Module > ] > ;
module Ids : SyncHook < [ Iterable < Module > ] > ;
optimizeModuleIds : SyncHook < [ Iterable < Module > ] > ;
afterOptimizeModuleIds : SyncHook < [ Iterable < Module > ] > ;
reviveChunks : SyncHook < [ Iterable < Chunk > , any ] > ;
beforeChunkIds : SyncHook < [ Iterable < Chunk > ] > ;
chunkIds : SyncHook < [ Iterable < Chunk > ] > ;
optimizeChunkIds : SyncHook < [ Iterable < Chunk > ] > ;
afterOptimizeChunkIds : SyncHook < [ Iterable < Chunk > ] > ;
recordModules : SyncHook < [ Iterable < Module > , any ] > ;
recordChunks : SyncHook < [ Iterable < Chunk > , any ] > ;
optimizeCodeGeneration : SyncHook < [ Iterable < Module > ] > ;
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 < [ ] > ;
2020-04-21 14:45:35 +08:00
shouldGenerateChunkAssets : SyncBailHook < [ ] , boolean > ;
2020-11-26 17:48:16 +08:00
beforeChunkAssets : SyncHook < [ ] > ;
2020-11-26 17:49:59 +08:00
additionalChunkAssets : FakeHook <
Pick <
AsyncSeriesHook < [ Set < Chunk > ] > ,
"tap" | "tapAsync" | "tapPromise" | "name"
>
> ;
additionalAssets : FakeHook <
Pick < AsyncSeriesHook < [ ] > , "tap" | "tapAsync" | "tapPromise" | "name" >
> ;
optimizeChunkAssets : FakeHook <
Pick <
AsyncSeriesHook < [ Set < Chunk > ] > ,
"tap" | "tapAsync" | "tapPromise" | "name"
>
> ;
afterOptimizeChunkAssets : FakeHook <
Pick <
AsyncSeriesHook < [ Set < Chunk > ] > ,
"tap" | "tapAsync" | "tapPromise" | "name"
>
> ;
2020-11-09 18:58:18 +08:00
optimizeAssets : AsyncSeriesHook <
[ Record < string , Source > ] ,
2020-11-26 17:49:59 +08:00
ProcessAssetsAdditionalOptions
2020-11-09 18:58:18 +08:00
> ;
2020-11-26 17:48:16 +08:00
afterOptimizeAssets : SyncHook < [ Record < string , Source > ] > ;
2020-11-09 18:58:18 +08:00
processAssets : AsyncSeriesHook <
[ Record < string , Source > ] ,
2020-11-26 17:49:59 +08:00
ProcessAssetsAdditionalOptions
2020-11-09 18:58:18 +08:00
> ;
2020-11-26 17:48:16 +08:00
afterProcessAssets : SyncHook < [ Record < string , Source > ] > ;
2020-11-09 18:58:18 +08:00
processAdditionalAssets : AsyncSeriesHook < [ Record < string , Source > ] > ;
2020-04-21 14:45:35 +08:00
needAdditionalSeal : SyncBailHook < [ ] , boolean > ;
2020-06-17 21:53:14 +08:00
afterSeal : AsyncSeriesHook < [ ] > ;
2020-04-21 14:45:35 +08:00
renderManifest : SyncWaterfallHook <
2020-11-26 17:49:59 +08:00
[ RenderManifestEntry [ ] , RenderManifestOptions ]
2020-03-21 21:01:38 +08:00
> ;
2020-11-26 17:48:16 +08:00
fullHash : SyncHook < [ Hash ] > ;
chunkHash : SyncHook < [ Chunk , Hash , ChunkHashContext ] > ;
module Asset : SyncHook < [ Module , string ] > ;
chunkAsset : SyncHook < [ Chunk , string ] > ;
2020-12-18 20:52:15 +08:00
assetPath : SyncWaterfallHook < [ string , object , AssetInfo ] > ;
2020-04-21 14:45:35 +08:00
needAdditionalPass : SyncBailHook < [ ] , boolean > ;
2020-11-26 17:48:16 +08:00
childCompiler : SyncHook < [ Compiler , string , number ] > ;
2020-04-21 14:45:35 +08:00
log : SyncBailHook < [ string , LogEntry ] , true > ;
2020-09-21 03:24:15 +08:00
processWarnings : SyncWaterfallHook < [ WebpackError [ ] ] > ;
processErrors : SyncWaterfallHook < [ WebpackError [ ] ] > ;
2020-12-18 01:51:55 +08:00
statsPreset : HookMap <
SyncHook < [ Partial < NormalizedStatsOptions > , CreateStatsOptionsContext ] >
> ;
statsNormalize : SyncHook <
[ Partial < NormalizedStatsOptions > , CreateStatsOptionsContext ]
> ;
statsFactory : SyncHook < [ StatsFactory , NormalizedStatsOptions ] > ;
statsPrinter : SyncHook < [ StatsPrinter , NormalizedStatsOptions ] > ;
2020-12-18 20:52:15 +08:00
readonly normalModuleLoader : SyncHook < [ object , NormalModule ] > ;
2020-04-21 14:45:35 +08:00
} > ;
2020-12-17 01:26:46 +08:00
name? : string ;
2020-09-04 04:01:25 +08:00
startTime : any ;
endTime : any ;
2020-04-21 14:45:35 +08:00
compiler : Compiler ;
resolverFactory : ResolverFactory ;
inputFileSystem : InputFileSystem ;
fileSystemInfo : FileSystemInfo ;
requestShortener : RequestShortener ;
compilerPath : string ;
logger : WebpackLogger ;
options : WebpackOptionsNormalized ;
outputOptions : OutputNormalized ;
bail : boolean ;
profile : boolean ;
mainTemplate : MainTemplate ;
chunkTemplate : ChunkTemplate ;
runtimeTemplate : RuntimeTemplate ;
module Templates : { javascript : ModuleTemplate } ;
module Graph : ModuleGraph ;
2020-12-17 01:26:46 +08:00
chunkGraph? : ChunkGraph ;
2020-07-28 00:09:48 +08:00
codeGenerationResults : CodeGenerationResults ;
2020-04-21 14:45:35 +08:00
factorizeQueue : AsyncQueue < FactorizeModuleOptions , string , Module > ;
addModuleQueue : AsyncQueue < Module , string , Module > ;
buildQueue : AsyncQueue < Module , Module , Module > ;
rebuildQueue : AsyncQueue < Module , Module , Module > ;
processDependenciesQueue : AsyncQueue < Module , Module , Module > ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* 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 < Module , Set < Module > > ;
entries : Map < string , EntryData > ;
2020-05-25 16:50:37 +08:00
globalEntry : EntryData ;
2020-04-21 14:45:35 +08:00
entrypoints : Map < string , Entrypoint > ;
2020-09-08 00:02:14 +08:00
asyncEntrypoints : Entrypoint [ ] ;
2020-04-21 14:45:35 +08:00
chunks : Set < Chunk > ;
2020-04-23 17:43:38 +08:00
chunkGroups : ChunkGroup [ ] ;
2020-04-21 14:45:35 +08:00
namedChunkGroups : Map < string , ChunkGroup > ;
namedChunks : Map < string , Chunk > ;
module s : Set < Module > ;
records : any ;
2020-04-23 17:43:38 +08:00
additionalChunkAssets : string [ ] ;
2020-04-21 14:45:35 +08:00
assets : Record < string , Source > ;
assetsInfo : Map < string , AssetInfo > ;
2020-04-23 17:43:38 +08:00
errors : WebpackError [ ] ;
warnings : WebpackError [ ] ;
children : Compilation [ ] ;
logging : Map < string , LogEntry [ ] > ;
2020-11-26 17:49:59 +08:00
dependencyFactories : Map < DepConstructor , ModuleFactory > ;
2020-04-21 14:45:35 +08:00
dependencyTemplates : DependencyTemplates ;
2020-12-18 20:52:15 +08:00
childrenCounters : object ;
2020-04-21 14:45:35 +08:00
usedChunkIds : Set < string | number > ;
usedModuleIds : Set < number > ;
needAdditionalPass : boolean ;
builtModules : WeakSet < Module > ;
2020-09-02 00:08:09 +08:00
codeGeneratedModules : WeakSet < Module > ;
2020-04-21 14:45:35 +08:00
emittedAssets : Set < string > ;
comparedForEmitAssets : Set < string > ;
fileDependencies : LazySet < string > ;
contextDependencies : LazySet < string > ;
missingDependencies : LazySet < string > ;
buildDependencies : LazySet < string > ;
compilationDependencies : { add : ( item? : any ) = > LazySet < string > } ;
getStats ( ) : Stats ;
2020-12-18 01:51:55 +08:00
createStatsOptions (
optionsOrPreset : string | StatsOptions ,
context? : CreateStatsOptionsContext
) : NormalizedStatsOptions ;
2020-04-21 14:45:35 +08:00
createStatsFactory ( options? : any ) : StatsFactory ;
createStatsPrinter ( options? : any ) : StatsPrinter ;
2020-07-15 17:14:28 +08:00
getCache ( name : string ) : CacheFacade ;
2020-04-21 14:45:35 +08:00
getLogger ( name : string | ( ( ) = > string ) ) : WebpackLogger ;
addModule (
module : Module ,
callback : ( err? : WebpackError , result? : Module ) = > void
) : void ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Fetches a module from a compilation by its identifier
* /
getModule ( module : Module ) : Module ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Attempts to search for a module by its identifier
* /
2020-12-17 01:26:46 +08:00
findModule ( identifier : string ) : undefined | Module ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Schedules a build of the module object
* /
buildModule (
module : Module ,
callback : ( err? : WebpackError , result? : Module ) = > void
) : void ;
processModuleDependencies (
module : Module ,
callback : ( err? : WebpackError , result? : Module ) = > void
) : void ;
2020-04-27 00:11:05 +08:00
processModuleDependenciesNonRecursive ( module : Module ) : void ;
2020-04-21 14:45:35 +08:00
handleModuleCreation (
__0 : HandleModuleCreationOptions ,
callback : ( err? : WebpackError , result? : Module ) = > void
) : void ;
factorizeModule (
options : FactorizeModuleOptions ,
callback : ( err? : WebpackError , result? : Module ) = > void
) : void ;
addModuleChain (
context : string ,
dependency : Dependency ,
callback : ( err? : WebpackError , result? : Module ) = > void
) : void ;
addEntry (
context : string ,
2020-05-05 16:43:18 +08:00
entry : Dependency ,
2020-11-26 17:49:59 +08:00
optionsOrName : string | EntryOptions ,
2020-04-21 14:45:35 +08:00
callback : ( err? : WebpackError , result? : Module ) = > void
) : void ;
2020-05-25 16:50:37 +08:00
addInclude (
context : string ,
dependency : Dependency ,
2020-11-26 17:49:59 +08:00
options : EntryOptions ,
2020-05-25 16:50:37 +08:00
callback : ( err? : WebpackError , result? : Module ) = > void
) : void ;
2020-04-21 14:45:35 +08:00
rebuildModule (
module : Module ,
callback : ( err? : WebpackError , result? : Module ) = > void
) : void ;
finish ( callback? : any ) : void ;
unseal ( ) : void ;
seal ( callback : ( err? : WebpackError ) = > void ) : void ;
reportDependencyErrorsAndWarnings (
module : Module ,
2020-04-23 17:43:38 +08:00
blocks : DependenciesBlock [ ]
2020-04-21 14:45:35 +08:00
) : void ;
2020-07-28 00:09:48 +08:00
codeGeneration ( callback? : any ) : void ;
2020-09-08 00:02:14 +08:00
processRuntimeRequirements ( ) : void ;
2020-04-21 14:45:35 +08:00
addRuntimeModule ( chunk : Chunk , module : RuntimeModule ) : void ;
addChunkInGroup (
2020-11-26 17:49:59 +08:00
groupOptions : string | ChunkGroupOptions ,
2020-04-21 14:45:35 +08:00
module : Module ,
2020-11-26 17:49:59 +08:00
loc : DependencyLocation ,
2020-04-21 14:45:35 +08:00
request : string
) : ChunkGroup ;
2020-09-08 00:02:14 +08:00
addAsyncEntrypoint (
2020-11-26 17:49:59 +08:00
options : EntryOptions ,
2020-09-08 00:02:14 +08:00
module : Module ,
2020-11-26 17:49:59 +08:00
loc : DependencyLocation ,
2020-09-08 00:02:14 +08:00
request : string
) : Entrypoint ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* 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 ;
2020-05-28 02:34:55 +08:00
getDependencyReferencedExports (
2020-07-28 00:09:48 +08:00
dependency : Dependency ,
2020-11-26 17:49:59 +08:00
runtime : RuntimeSpec
2020-06-10 19:31:01 +08:00
) : ( string [ ] | ReferencedExport ) [ ] ;
2020-04-21 14:45:35 +08:00
removeReasonsOfDependencyBlock (
module : Module ,
block : DependenciesBlockLike
) : void ;
patchChunksAfterReasonRemoval ( module : Module , chunk : Chunk ) : void ;
removeChunkFromDependencies ( block : DependenciesBlock , chunk : Chunk ) : void ;
2020-10-23 20:52:23 +08:00
assignRuntimeIds ( ) : void ;
2020-04-21 14:45:35 +08:00
sortItemsWithChunkIds ( ) : void ;
summarizeDependencies ( ) : void ;
createModuleHashes ( ) : void ;
createHash ( ) : void ;
2020-12-17 01:26:46 +08:00
fullHash? : string ;
hash? : string ;
2020-04-21 14:45:35 +08:00
emitAsset ( file : string , source : Source , assetInfo? : AssetInfo ) : void ;
updateAsset (
file : string ,
newSourceOrFunction : Source | ( ( arg0 : Source ) = > Source ) ,
2020-12-17 01:26:46 +08:00
assetInfoUpdateOrFunction? : AssetInfo | ( ( arg0? : AssetInfo ) = > AssetInfo )
2020-04-21 14:45:35 +08:00
) : void ;
2020-08-19 03:14:43 +08:00
renameAsset ( file? : any , newFile? : any ) : void ;
2020-08-06 15:55:18 +08:00
deleteAsset ( file : string ) : void ;
2020-05-12 18:16:51 +08:00
getAssets ( ) : Readonly < Asset > [ ] ;
2020-12-17 01:26:46 +08:00
getAsset ( name : string ) : undefined | Readonly < Asset > ;
2020-04-21 14:45:35 +08:00
clearAssets ( ) : void ;
createModuleAssets ( ) : void ;
2020-11-26 17:49:59 +08:00
getRenderManifest ( options : RenderManifestOptions ) : RenderManifestEntry [ ] ;
2020-04-21 14:45:35 +08:00
createChunkAssets ( callback : ( err? : WebpackError ) = > void ) : void ;
getPath (
2020-12-17 01:26:46 +08:00
filename : string | ( ( arg0 : PathData , arg1? : AssetInfo ) = > string ) ,
2020-04-21 14:45:35 +08:00
data? : PathData
) : string ;
getPathWithInfo (
2020-12-17 01:26:46 +08:00
filename : string | ( ( arg0 : PathData , arg1? : AssetInfo ) = > string ) ,
2020-04-21 14:45:35 +08:00
data? : PathData
) : { path : string ; info : AssetInfo } ;
getAssetPath (
2020-12-17 01:26:46 +08:00
filename : string | ( ( arg0 : PathData , arg1? : AssetInfo ) = > string ) ,
2020-04-21 14:45:35 +08:00
data : PathData
) : string ;
getAssetPathWithInfo (
2020-12-17 01:26:46 +08:00
filename : string | ( ( arg0 : PathData , arg1? : AssetInfo ) = > string ) ,
2020-04-21 14:45:35 +08:00
data : PathData
) : { path : string ; info : AssetInfo } ;
2020-09-21 03:24:15 +08:00
getWarnings ( ) : WebpackError [ ] ;
getErrors ( ) : WebpackError [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* 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 ,
2020-11-09 21:54:40 +08:00
plugins : (
| ( ( this : Compiler , compiler : Compiler ) = > void )
| WebpackPluginInstance
) [ ]
2020-04-21 14:45:35 +08:00
) : Compiler ;
checkConstraints ( ) : void ;
2020-05-12 18:16:51 +08:00
/ * *
* 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 .
2020-11-09 18:58:18 +08:00
* Only assets of the same type should be merged .
* For assets of different types see PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE .
2020-05-12 18:16:51 +08:00
* /
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 ;
/ * *
2020-11-09 18:58:18 +08:00
* Add development tooling to assets , e . g . by extracting a SourceMap .
2020-05-12 18:16:51 +08:00
* /
2020-11-09 18:58:18 +08:00
static PROCESS_ASSETS_STAGE_DEV_TOOLING : number ;
2020-05-12 18:16:51 +08:00
/ * *
2020-11-09 18:58:18 +08:00
* 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 .
2020-05-12 18:16:51 +08:00
* /
2020-11-09 18:58:18 +08:00
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 ;
2020-05-12 18:16:51 +08:00
/ * *
2020-10-16 20:29:35 +08:00
* Optimize the hashes of the assets , e . g . by generating real hashes of the asset content .
2020-05-12 18:16:51 +08:00
* /
2020-10-16 20:29:35 +08:00
static PROCESS_ASSETS_STAGE_OPTIMIZE_HASH : number ;
2020-05-12 18:16:51 +08:00
2020-08-19 03:14:43 +08:00
/ * *
2020-10-16 20:29:35 +08:00
* Optimize the transfer of existing assets , e . g . by preparing a compressed ( gzip ) file as separate asset .
2020-08-19 03:14:43 +08:00
* /
2020-10-16 20:29:35 +08:00
static PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER : number ;
2020-08-19 03:14:43 +08:00
2020-05-12 18:16:51 +08:00
/ * *
* Analyse existing assets .
* /
static PROCESS_ASSETS_STAGE_ANALYSE : number ;
/ * *
* Creating assets for reporting purposes .
* /
static PROCESS_ASSETS_STAGE_REPORT : number ;
2020-04-21 14:45:35 +08:00
}
declare interface CompilationHooksAsyncWebAssemblyModulesPlugin {
2020-05-08 05:29:42 +08:00
renderModuleContent : SyncWaterfallHook < [ Source , Module , RenderContextObject ] > ;
2020-04-21 14:45:35 +08:00
}
declare interface CompilationHooksJavascriptModulesPlugin {
2020-05-08 05:29:42 +08:00
renderModuleContent : SyncWaterfallHook < [ Source , Module , RenderContextObject ] > ;
2020-04-21 14:45:35 +08:00
renderModuleContainer : SyncWaterfallHook <
2020-05-08 05:29:42 +08:00
[ Source , Module , RenderContextObject ]
2020-04-21 14:45:35 +08:00
> ;
2020-05-08 05:29:42 +08:00
renderModulePackage : SyncWaterfallHook < [ Source , Module , RenderContextObject ] > ;
renderChunk : SyncWaterfallHook < [ Source , RenderContextObject ] > ;
renderMain : SyncWaterfallHook < [ Source , RenderContextObject ] > ;
render : SyncWaterfallHook < [ Source , RenderContextObject ] > ;
2020-04-21 14:45:35 +08:00
renderRequire : SyncWaterfallHook < [ string , RenderBootstrapContext ] > ;
2020-11-26 17:48:16 +08:00
chunkHash : SyncHook < [ Chunk , Hash , ChunkHashContext ] > ;
2020-10-26 21:41:46 +08:00
useSourceMap : SyncBailHook < [ Chunk , RenderContextObject ] , boolean > ;
2020-04-21 14:45:35 +08:00
}
2020-11-09 18:58:18 +08:00
declare interface CompilationHooksRealContentHashPlugin {
updateHash : SyncBailHook < [ Buffer [ ] , string ] , string > ;
}
2020-04-21 14:45:35 +08:00
declare interface CompilationParams {
normalModuleFactory : NormalModuleFactory ;
contextModuleFactory : ContextModuleFactory ;
}
declare class Compiler {
constructor ( context : string ) ;
hooks : Readonly < {
2020-11-26 17:48:16 +08:00
initialize : SyncHook < [ ] > ;
2020-04-21 14:45:35 +08:00
shouldEmit : SyncBailHook < [ Compilation ] , boolean > ;
2020-06-17 21:53:14 +08:00
done : AsyncSeriesHook < [ Stats ] > ;
2020-11-26 17:48:16 +08:00
afterDone : SyncHook < [ Stats ] > ;
2020-06-17 21:53:14 +08:00
additionalPass : AsyncSeriesHook < [ ] > ;
beforeRun : AsyncSeriesHook < [ Compiler ] > ;
run : AsyncSeriesHook < [ Compiler ] > ;
emit : AsyncSeriesHook < [ Compilation ] > ;
assetEmitted : AsyncSeriesHook < [ string , AssetEmittedInfo ] > ;
afterEmit : AsyncSeriesHook < [ Compilation ] > ;
2020-11-26 17:48:16 +08:00
thisCompilation : SyncHook < [ Compilation , CompilationParams ] > ;
compilation : SyncHook < [ Compilation , CompilationParams ] > ;
normalModuleFactory : SyncHook < [ NormalModuleFactory ] > ;
contextModuleFactory : SyncHook < [ ContextModuleFactory ] > ;
2020-06-17 21:53:14 +08:00
beforeCompile : AsyncSeriesHook < [ CompilationParams ] > ;
2020-11-26 17:48:16 +08:00
compile : SyncHook < [ CompilationParams ] > ;
2020-04-21 14:45:35 +08:00
make : AsyncParallelHook < [ Compilation ] > ;
2020-06-10 22:28:59 +08:00
finishMake : AsyncParallelHook < [ Compilation ] > ;
2020-06-17 21:53:14 +08:00
afterCompile : AsyncSeriesHook < [ Compilation ] > ;
watchRun : AsyncSeriesHook < [ Compiler ] > ;
2020-11-26 17:48:16 +08:00
failed : SyncHook < [ Error ] > ;
2020-12-17 01:26:46 +08:00
invalid : SyncHook < [ null | string , number ] > ;
2020-11-26 17:48:16 +08:00
watchClose : SyncHook < [ ] > ;
2020-04-23 17:43:38 +08:00
infrastructureLog : SyncBailHook < [ string , string , any [ ] ] , true > ;
2020-11-26 17:48:16 +08:00
environment : SyncHook < [ ] > ;
afterEnvironment : SyncHook < [ ] > ;
afterPlugins : SyncHook < [ Compiler ] > ;
afterResolvers : SyncHook < [ Compiler ] > ;
2020-04-21 14:45:35 +08:00
entryOption : SyncBailHook < [ string , EntryNormalized ] , boolean > ;
} > ;
2020-10-13 02:16:58 +08:00
webpack : typeof exports ;
2020-12-17 01:26:46 +08:00
name? : string ;
parentCompilation? : Compilation ;
2020-04-21 14:45:35 +08:00
root : Compiler ;
outputPath : string ;
2020-09-19 12:30:04 +08:00
watching : Watching ;
2020-04-21 14:45:35 +08:00
outputFileSystem : OutputFileSystem ;
2020-11-26 17:49:59 +08:00
intermediateFileSystem : IntermediateFileSystem ;
2020-04-21 14:45:35 +08:00
inputFileSystem : InputFileSystem ;
2020-07-08 16:21:31 +08:00
watchFileSystem : WatchFileSystem ;
2020-12-17 01:26:46 +08:00
recordsInputPath : null | string ;
recordsOutputPath : null | string ;
2020-12-18 20:52:15 +08:00
records : object ;
2020-04-21 14:45:35 +08:00
managedPaths : Set < string > ;
immutablePaths : Set < string > ;
modifiedFiles : Set < string > ;
removedFiles : Set < string > ;
2020-12-17 01:26:46 +08:00
fileTimestamps : Map < string , null | FileSystemInfoEntry > ;
contextTimestamps : Map < string , null | FileSystemInfoEntry > ;
2020-04-21 14:45:35 +08:00
resolverFactory : ResolverFactory ;
infrastructureLogger : any ;
options : WebpackOptionsNormalized ;
context : string ;
requestShortener : RequestShortener ;
cache : Cache ;
compilerPath : string ;
running : boolean ;
2020-07-31 23:38:33 +08:00
idle : boolean ;
2020-04-21 14:45:35 +08:00
watchMode : boolean ;
2020-07-15 17:14:28 +08:00
getCache ( name : string ) : CacheFacade ;
2020-04-21 14:45:35 +08:00
getInfrastructureLogger ( name : string | ( ( ) = > string ) ) : WebpackLogger ;
watch ( watchOptions : WatchOptions , handler : CallbackFunction < Stats > ) : Watching ;
run ( callback : CallbackFunction < Stats > ) : void ;
runAsChild (
2020-04-23 17:43:38 +08:00
callback : ( err? : Error , entries? : Chunk [ ] , compilation? : Compilation ) = > any
2020-04-21 14:45:35 +08:00
) : void ;
purgeInputFileSystem ( ) : void ;
emitAssets ( compilation : Compilation , callback : CallbackFunction < void > ) : void ;
emitRecords ( callback : CallbackFunction < void > ) : void ;
readRecords ( callback : CallbackFunction < void > ) : void ;
createChildCompiler (
compilation : Compilation ,
compilerName : string ,
compilerIndex : number ,
outputOptions : OutputNormalized ,
2020-04-23 17:43:38 +08:00
plugins : WebpackPluginInstance [ ]
2020-04-21 14:45:35 +08:00
) : Compiler ;
isChild ( ) : boolean ;
createCompilation ( ) : Compilation ;
newCompilation ( params : CompilationParams ) : Compilation ;
createNormalModuleFactory ( ) : NormalModuleFactory ;
createContextModuleFactory ( ) : ContextModuleFactory ;
newCompilationParams ( ) : {
normalModuleFactory : NormalModuleFactory ;
contextModuleFactory : ContextModuleFactory ;
} ;
compile ( callback : CallbackFunction < Compilation > ) : void ;
close ( callback : CallbackFunction < void > ) : void ;
}
2020-08-20 02:05:47 +08:00
declare class ConcatSource extends Source {
constructor ( . . . args : ( string | Source ) [ ] ) ;
getChildren ( ) : Source [ ] ;
add ( item : string | Source ) : void ;
addAllSkipOptimizing ( items : Source [ ] ) : void ;
}
2020-09-15 16:56:06 +08:00
declare interface ConcatenatedModuleInfo {
index : number ;
module : Module ;
/ * *
* mapping from export name to symbol
* /
exportMap : Map < string , string > ;
2020-09-15 18:21:37 +08:00
/ * *
* mapping from export name to symbol
* /
rawExportMap : Map < string , string > ;
2020-09-15 17:43:06 +08:00
namespaceExportSymbol? : string ;
2020-09-15 16:56:06 +08:00
}
2020-09-15 16:07:04 +08:00
declare interface ConcatenationBailoutReasonContext {
/ * *
* the module graph
* /
module Graph : ModuleGraph ;
/ * *
* the chunk graph
* /
chunkGraph : ChunkGraph ;
}
2020-09-15 16:56:06 +08:00
declare class ConcatenationScope {
constructor (
2020-11-26 17:49:59 +08:00
module sMap : ModuleInfo [ ] | Map < Module , ModuleInfo > ,
2020-09-15 16:56:06 +08:00
currentModule : ConcatenatedModuleInfo
) ;
isModuleInScope ( module : Module ) : boolean ;
registerExport ( exportName : string , symbol : string ) : void ;
2020-09-15 18:21:37 +08:00
registerRawExport ( exportName : string , expression : string ) : void ;
2020-09-15 17:43:06 +08:00
registerNamespaceExport ( symbol : string ) : void ;
2020-09-11 15:06:24 +08:00
createModuleReference (
2020-09-15 16:56:06 +08:00
module : Module ,
__1 : Partial < ModuleReferenceOptions >
2020-09-11 15:06:24 +08:00
) : string ;
2020-09-15 16:56:06 +08:00
static isModuleReference ( name : string ) : boolean ;
static matchModuleReference (
name : string
) : {
/ * *
* the properties / exports of the module
* /
ids : string [ ] ;
/ * *
* true , when this referenced export is called
* /
call : boolean ;
/ * *
* true , when this referenced export is directly imported ( not via property access )
* /
directImport : boolean ;
/ * *
* if the position is ASI safe or unknown
* /
2020-12-17 01:26:46 +08:00
asiSafe? : boolean ;
2020-09-15 16:56:06 +08:00
index : number ;
} ;
static DEFAULT_EXPORT : string ;
static NAMESPACE_OBJECT_EXPORT : string ;
2020-09-11 15:06:24 +08:00
}
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options object as provided by the user .
* /
declare interface Configuration {
/ * *
* Set the value of ` require.amd ` and ` define.amd ` . Or disable AMD support .
* /
2020-12-17 01:26:46 +08:00
amd? : false | { [ index : string ] : any } ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Report the first error as a hard error instead of tolerating it .
* /
bail? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Cache generated module s and chunks to improve performance for multiple incremental builds .
* /
2020-12-17 01:26:46 +08:00
cache? : boolean | MemoryCacheOptions | FileCacheOptions ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* 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 ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* References to other configurations to depend on .
* /
2020-04-23 17:43:38 +08:00
dependencies? : string [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* A developer tool to enhance debugging ( false | eval | [ inline - | hidden - | eval - ] [ nosources - ] [ cheap - [ module - ] ] source - map ) .
* /
2020-12-17 01:26:46 +08:00
devtool? : string | false ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The entry point ( s ) of the compilation .
* /
2020-12-17 01:26:46 +08:00
entry ? :
| string
| ( ( ) = > string | EntryObject | string [ ] | Promise < EntryStatic > )
| EntryObject
| string [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Enables / Disables experiments ( experimental features with relax SemVer compatibility ) .
* /
experiments? : Experiments ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* 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 ` .
* /
2020-12-17 01:26:46 +08:00
externals ? :
| string
| RegExp
| ExternalItem [ ]
| {
[ index : string ] : string | boolean | string [ ] | { [ index : string ] : any } ;
}
| ( (
data : { context : string ; request : string } ,
callback : ( err? : Error , result? : string ) = > void
) = > void ) ;
2020-03-21 21:01:38 +08:00
2020-09-09 21:16:53 +08:00
/ * *
* Enable presets of externals for specific targets .
* /
externalsPresets? : ExternalsPresets ;
2020-04-21 14:45:35 +08:00
/ * *
* Specifies the default type of externals ( 'amd*' , 'umd*' , 'system' and 'jsonp' depend on output . libraryTarget set to the same value ) .
* /
2020-12-17 01:26:46 +08:00
externalsType ? :
| "var"
| "module"
| "assign"
| "this"
| "window"
| "self"
| "global"
| "commonjs"
| "commonjs2"
| "commonjs-module"
| "amd"
| "amd-require"
| "umd"
| "umd2"
| "jsonp"
| "system"
| "promise"
| "import"
| "script" ;
2020-03-21 21:01:38 +08:00
2020-09-21 04:08:38 +08:00
/ * *
* 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 )
) [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* Options for infrastructure level logging .
* /
infrastructureLogging? : InfrastructureLogging ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Custom values available in the loader context .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
loader? : Loader ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Enable production optimizations or development hints .
* /
2020-12-17 01:26:46 +08:00
mode ? : "development" | "production" | "none" ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Options affecting the normal module s ( ` NormalModuleFactory ` ) .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
module ? : ModuleOptions ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Name of the configuration . Used when loading multiple configurations .
* /
name? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Include polyfills or mocks for various node stuff .
* /
2020-12-17 01:26:46 +08:00
node? : false | NodeOptions ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Enables / Disables integrated optimizations .
* /
optimization? : Optimization ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options affecting the output of the compilation . ` output ` options tell webpack how to write the compiled files to disk .
* /
output? : Output ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* The number of parallel processed module s in the compilation .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
parallelism? : number ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Configuration for web performance recommendations .
2020-03-21 21:01:38 +08:00
* /
2020-12-17 01:26:46 +08:00
performance? : false | PerformanceOptions ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Add additional plugins to the compiler .
* /
2020-04-23 17:43:38 +08:00
plugins ? : (
| ( ( this : Compiler , compiler : Compiler ) = > void )
| WebpackPluginInstance
) [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Capture timing information for each module .
* /
profile? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Store compiler state to a json file .
* /
2020-12-17 01:26:46 +08:00
recordsInputPath? : string | false ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Load compiler state from a json file .
* /
2020-12-17 01:26:46 +08:00
recordsOutputPath? : string | false ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Store / Load compiler state from / to a json file . This will result in persistent ids of module s and chunks . An absolute path is expected . ` recordsPath ` is used for ` recordsInputPath ` and ` recordsOutputPath ` if they left undefined .
2020-03-21 21:01:38 +08:00
* /
2020-12-17 01:26:46 +08:00
recordsPath? : string | false ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options for the resolver .
* /
2020-06-17 19:22:37 +08:00
resolve? : ResolveOptionsWebpackOptions ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options for the resolver when resolving loaders .
* /
2020-06-17 19:22:37 +08:00
resolveLoader? : ResolveOptionsWebpackOptions ;
2020-03-21 21:01:38 +08:00
2020-08-26 06:36:16 +08:00
/ * *
* Options affecting how file system snapshots are created and validated .
* /
snapshot? : SnapshotOptions ;
2020-04-21 14:45:35 +08:00
/ * *
* Stats options object or preset name .
* /
2020-12-17 01:26:46 +08:00
stats ? :
| boolean
| "none"
| "summary"
| "errors-only"
| "errors-warnings"
| "minimal"
| "normal"
| "detailed"
| "verbose"
| StatsOptions ;
2020-03-21 21:01:38 +08:00
/ * *
2020-09-10 16:42:29 +08:00
* Environment to build for . An array of environments to build for all of them when possible .
2020-03-21 21:01:38 +08:00
* /
2020-12-17 01:26:46 +08:00
target? : string | false | string [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Enter watch mode , which rebuilds on file change .
* /
watch? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options for the watcher .
* /
watchOptions? : WatchOptions ;
}
2020-11-26 17:49:59 +08:00
type ConnectionState =
| boolean
| typeof TRANSITIVE_ONLY
| typeof CIRCULAR_CONNECTION ;
declare interface Constructor {
new ( . . . params : any [ ] ) : any ;
}
2020-05-26 05:14:19 +08:00
declare class ConsumeSharedPlugin {
constructor ( options : ConsumeSharedPluginOptions ) ;
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
/ * *
* Options for consuming shared module s.
* /
declare interface ConsumeSharedPluginOptions {
/ * *
* Modules that should be consumed from share scope . When provided , property names are used to match requested module s in this compilation .
* /
2020-05-26 23:11:21 +08:00
consumes : Consumes ;
2020-05-26 05:14:19 +08:00
/ * *
* Share scope name used for all consumed module s ( defaults to 'default' ) .
* /
shareScope? : string ;
}
type Consumes = ( string | ConsumesObject ) [ ] | ConsumesObject ;
/ * *
* Advanced configuration for module s that should be consumed from share scope .
* /
declare interface ConsumesConfig {
2020-05-26 23:11:21 +08:00
/ * *
* Include the fallback module directly instead behind an async request . This allows to use fallback module in initial load too . All possible shared module s need to be eager too .
* /
eager? : boolean ;
2020-05-26 05:14:19 +08:00
/ * *
* Fallback module if no shared module is found in share scope . Defaults to the property name .
* /
2020-12-17 01:26:46 +08:00
import ? : string | false ;
2020-05-26 05:14:19 +08:00
2020-06-13 20:45:37 +08:00
/ * *
* 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 ;
2020-05-26 05:14:19 +08:00
/ * *
* Version requirement from module in share scope .
* /
2020-12-17 01:26:46 +08:00
requiredVersion? : string | false ;
2020-05-26 05:14:19 +08:00
/ * *
* Module is looked up under this key from the share scope .
* /
shareKey? : string ;
/ * *
* Share scope name .
* /
shareScope? : string ;
2020-05-27 21:10:57 +08:00
/ * *
* Allow only a single version of the shared module in share scope ( disabled by default ) .
* /
singleton? : boolean ;
2020-05-26 05:14:19 +08:00
/ * *
2020-05-27 22:02:41 +08:00
* 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 ) .
2020-05-26 05:14:19 +08:00
* /
strictVersion? : boolean ;
}
/ * *
* Modules that should be consumed from share scope . Property names are used to match requested module s 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 ;
}
2020-11-26 17:49:59 +08:00
type ContainerOptionsFormat < T > =
| Record < string , string | string [ ] | T >
| ( string | Record < string , string | string [ ] | T > ) [ ] ;
2020-04-22 18:09:11 +08:00
declare class ContainerPlugin {
constructor ( options : ContainerPluginOptions ) ;
2020-04-30 19:39:58 +08:00
/ * *
* Apply the plugin
* /
2020-04-22 18:09:11 +08:00
apply ( compiler : Compiler ) : void ;
}
declare interface ContainerPluginOptions {
/ * *
2020-04-30 19:39:58 +08:00
* 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 .
2020-04-22 18:09:11 +08:00
* /
2020-05-14 21:50:35 +08:00
exposes : Exposes ;
2020-04-22 18:09:11 +08:00
/ * *
* 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 ;
/ * *
2020-05-26 23:11:21 +08:00
* The name of the share scope which is shared with the host ( defaults to 'default' ) .
2020-04-22 18:09:11 +08:00
* /
2020-05-26 23:11:21 +08:00
shareScope? : string ;
2020-04-22 18:09:11 +08:00
}
declare class ContainerReferencePlugin {
2020-04-30 19:39:58 +08:00
constructor ( options : ContainerReferencePluginOptions ) ;
/ * *
* Apply the plugin
* /
2020-04-22 18:09:11 +08:00
apply ( compiler : Compiler ) : void ;
}
2020-04-30 19:39:58 +08:00
declare interface ContainerReferencePluginOptions {
/ * *
* The external type of the remote containers .
* /
2020-05-15 22:24:11 +08:00
remoteType : ExternalsType ;
2020-04-30 19:39:58 +08:00
/ * *
* Container locations and request scopes from which module s 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 .
* /
2020-05-14 21:50:35 +08:00
remotes : Remotes ;
2020-05-26 23:11:21 +08:00
/ * *
* The name of the share scope shared with all remotes ( defaults to 'default' ) .
* /
shareScope? : string ;
2020-04-30 19:39:58 +08:00
}
2020-06-10 19:31:01 +08:00
declare abstract class ContextElementDependency extends ModuleDependency {
referencedExports : any ;
}
2020-04-21 14:45:35 +08:00
declare class ContextExclusionPlugin {
constructor ( negativeMatcher : RegExp ) ;
negativeMatcher : RegExp ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
2020-11-26 17:49:59 +08:00
type ContextMode =
| "sync"
| "eager"
| "weak"
| "async-weak"
| "lazy"
| "lazy-once" ;
2020-04-21 14:45:35 +08:00
declare abstract class ContextModuleFactory extends ModuleFactory {
hooks : Readonly < {
beforeResolve : AsyncSeriesWaterfallHook < [ any ] > ;
afterResolve : AsyncSeriesWaterfallHook < [ any ] > ;
2020-04-23 17:43:38 +08:00
contextModuleFiles : SyncWaterfallHook < [ string [ ] ] > ;
2020-11-26 17:49:59 +08:00
alternatives : FakeHook <
Pick <
AsyncSeriesWaterfallHook < [ any [ ] ] > ,
"tap" | "tapAsync" | "tapPromise" | "name"
>
> ;
2020-07-14 18:02:32 +08:00
alternativeRequests : AsyncSeriesWaterfallHook <
2020-11-26 17:49:59 +08:00
[ any [ ] , ContextModuleOptions ]
2020-07-14 18:02:32 +08:00
> ;
2020-04-21 14:45:35 +08:00
} > ;
2020-06-09 06:32:24 +08:00
resolverFactory : ResolverFactory ;
2020-06-10 19:31:01 +08:00
resolveDependencies (
fs : InputFileSystem ,
2020-11-26 17:49:59 +08:00
options : ContextModuleOptions ,
2020-06-10 19:31:01 +08:00
callback : ( err? : Error , dependencies? : ContextElementDependency [ ] ) = > any
) : void ;
2020-04-21 14:45:35 +08:00
}
2020-11-26 17:49:59 +08:00
declare interface ContextModuleOptions {
mode : ContextMode ;
recursive : boolean ;
regExp : RegExp ;
namespaceObject? : boolean | "strict" ;
addon? : string ;
chunkName? : string ;
include? : RegExp ;
exclude? : RegExp ;
groupOptions? : RawChunkGroupOptions ;
category? : string ;
/ * *
* exports referenced from module s ( won ' t be mangled )
* /
referencedExports? : string [ ] [ ] ;
resource : string ;
resourceQuery? : string ;
resourceFragment? : string ;
resolveOptions : any ;
}
2020-04-21 14:45:35 +08:00
declare class ContextReplacementPlugin {
constructor (
resourceRegExp? : any ,
newContentResource? : any ,
newContentRecursive? : any ,
newContentRegExp? : any
) ;
resourceRegExp : any ;
newContentCallback : any ;
newContentResource : any ;
newContentCreateContextMap : any ;
newContentRecursive : any ;
newContentRegExp : any ;
apply ( compiler? : any ) : void ;
}
2020-12-18 01:51:55 +08:00
type CreateStatsOptionsContext = KnownCreateStatsOptionsContext &
Record < string , any > ;
2020-04-21 14:45:35 +08:00
type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration ;
declare class DefinePlugin {
/ * *
* Create a new define plugin
* /
2020-11-26 17:48:16 +08:00
constructor (
definitions : Record <
string ,
RecursiveArrayOrRecord <
2020-12-17 01:26:46 +08:00
| undefined
| null
| string
| number
| bigint
| boolean
| Function
| RegExp
| RuntimeValue
2020-11-26 17:48:16 +08:00
>
>
) ;
definitions : Record <
string ,
RecursiveArrayOrRecord <
2020-12-17 01:26:46 +08:00
| undefined
| null
| string
| number
| bigint
| boolean
| Function
| RegExp
| RuntimeValue
2020-11-26 17:48:16 +08:00
>
> ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Apply the plugin
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
apply ( compiler : Compiler ) : void ;
static runtimeValue ( fn? : any , fileDependencies? : any ) : RuntimeValue ;
}
declare class DelegatedPlugin {
constructor ( options? : any ) ;
options : any ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
2020-11-26 17:49:59 +08:00
declare interface DepConstructor {
new ( . . . args : any [ ] ) : Dependency ;
}
2020-04-21 14:45:35 +08:00
declare abstract class DependenciesBlock {
2020-04-23 17:43:38 +08:00
dependencies : Dependency [ ] ;
blocks : AsyncDependenciesBlock [ ] ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Adds a DependencyBlock to DependencyBlock relationship .
* This is used for when a Module has a AsyncDependencyBlock tie ( for code - splitting )
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
addBlock ( block : AsyncDependenciesBlock ) : void ;
addDependency ( dependency : Dependency ) : void ;
removeDependency ( dependency : Dependency ) : void ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Removes all dependencies and blocks
* /
clearDependenciesAndBlocks ( ) : void ;
2020-07-28 00:09:48 +08:00
updateHash ( hash : Hash , context : UpdateHashContextDependency ) : void ;
2020-04-21 14:45:35 +08:00
serialize ( __0 : { write : any } ) : void ;
deserialize ( __0 : { read : any } ) : void ;
}
declare interface DependenciesBlockLike {
2020-04-23 17:43:38 +08:00
dependencies : Dependency [ ] ;
blocks : AsyncDependenciesBlock [ ] ;
2020-04-21 14:45:35 +08:00
}
declare class Dependency {
constructor ( ) ;
weak : boolean ;
optional : boolean ;
2020-11-26 17:49:59 +08:00
loc : DependencyLocation ;
2020-04-21 14:45:35 +08:00
readonly type : string ;
2020-05-28 03:57:45 +08:00
readonly category : string ;
2020-12-17 01:26:46 +08:00
getResourceIdentifier ( ) : null | string ;
2020-10-13 02:16:58 +08:00
/ * *
* Returns the referenced module and export
* /
2020-04-21 14:45:35 +08:00
getReference ( module Graph : ModuleGraph ) : never ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Returns list of exports referenced by this dependency
* /
2020-05-28 02:34:55 +08:00
getReferencedExports (
2020-07-28 00:09:48 +08:00
module Graph : ModuleGraph ,
2020-11-26 17:49:59 +08:00
runtime : RuntimeSpec
2020-06-10 19:31:01 +08:00
) : ( string [ ] | ReferencedExport ) [ ] ;
2020-07-28 00:09:48 +08:00
getCondition (
module Graph : ModuleGraph
2020-11-26 17:49:59 +08:00
) : ( arg0 : ModuleGraphConnection , arg1 : RuntimeSpec ) = > ConnectionState ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Returns the exported names
* /
2020-12-17 01:26:46 +08:00
getExports ( module Graph : ModuleGraph ) : undefined | ExportsSpec ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Returns warnings
* /
2020-04-23 17:43:38 +08:00
getWarnings ( module Graph : ModuleGraph ) : WebpackError [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Returns errors
* /
2020-04-23 17:43:38 +08:00
getErrors ( module Graph : ModuleGraph ) : WebpackError [ ] ;
/ * *
* Update the hash
* /
2020-07-28 00:09:48 +08:00
updateHash ( hash : Hash , context : UpdateHashContextDependency ) : void ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* implement this method to allow the occurrence order plugin to count correctly
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
getNumberOfIdOccurrences ( ) : number ;
2020-10-05 22:57:31 +08:00
getModuleEvaluationSideEffectsState (
module Graph : ModuleGraph
2020-11-26 17:49:59 +08:00
) : ConnectionState ;
2020-04-21 14:45:35 +08:00
serialize ( __0 : { write : any } ) : void ;
deserialize ( __0 : { read : any } ) : void ;
module : any ;
readonly disconnect : any ;
2020-04-23 17:43:38 +08:00
static NO_EXPORTS_REFERENCED : any [ ] ;
2020-12-17 01:26:46 +08:00
static EXPORTS_OBJECT_REFERENCED : never [ ] [ ] ;
2020-04-21 14:45:35 +08:00
}
2020-11-26 17:49:59 +08:00
declare interface DependencyConstructor {
new ( . . . args : any [ ] ) : Dependency ;
}
type DependencyLocation = SyntheticDependencyLocation | RealDependencyLocation ;
2020-04-21 14:45:35 +08:00
declare abstract class DependencyTemplate {
apply (
dependency : Dependency ,
source : ReplaceSource ,
templateContext : DependencyTemplateContext
) : void ;
}
declare interface DependencyTemplateContext {
/ * *
* the runtime template
* /
runtimeTemplate : RuntimeTemplate ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* the dependency templates
* /
dependencyTemplates : DependencyTemplates ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* the module graph
* /
module Graph : ModuleGraph ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* the chunk graph
* /
chunkGraph : ChunkGraph ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* the requirements for runtime
* /
runtimeRequirements : Set < string > ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* current module
* /
module : Module ;
2020-03-21 21:01:38 +08:00
2020-07-28 00:09:48 +08:00
/ * *
* current runtimes , for which code is generated
* /
2020-11-26 17:49:59 +08:00
runtime : RuntimeSpec ;
2020-07-28 00:09:48 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* mutable array of init fragments for the current module
* /
2020-04-23 17:43:38 +08:00
initFragments : InitFragment [ ] ;
2020-09-11 15:06:24 +08:00
/ * *
* when in a concatenated module , information about other concatenated module s
* /
concatenationScope? : ConcatenationScope ;
2020-04-21 14:45:35 +08:00
}
declare abstract class DependencyTemplates {
2020-11-26 17:49:59 +08:00
get ( dependency : DependencyConstructor ) : DependencyTemplate ;
2020-04-21 14:45:35 +08:00
set (
2020-11-26 17:49:59 +08:00
dependency : DependencyConstructor ,
2020-04-21 14:45:35 +08:00
dependencyTemplate : DependencyTemplate
) : void ;
updateHash ( part : string ) : void ;
getHash ( ) : string ;
clone ( ) : DependencyTemplates ;
}
2020-03-26 20:50:16 +08:00
declare class DeterministicChunkIdsPlugin {
constructor ( options? : any ) ;
options : any ;
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
2020-04-21 14:45:35 +08:00
declare class DeterministicModuleIdsPlugin {
constructor ( options? : any ) ;
options : any ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options for the webpack - dev - server .
* /
declare interface DevServer {
[ index : string ] : any ;
}
type DevTool = string | false ;
type DevtoolFallbackModuleFilenameTemplate = string | Function ;
declare class DllPlugin {
constructor ( options : DllPluginOptions ) ;
options : {
entryOnly : boolean ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Context of requests in the manifest file ( defaults to the webpack context ) .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
context? : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* If true , manifest json file ( output ) will be formatted .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
format? : boolean ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Name of the exposed dll function ( external name , use value of 'output.library' ) .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
name? : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Absolute path to the manifest json file ( output ) .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
path : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Type of the dll bundle ( external type , use value of 'output.libraryTarget' ) .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
type ? : string ;
} ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare interface DllPluginOptions {
/ * *
* Context of requests in the manifest file ( defaults to the webpack context ) .
* /
context? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* If true , only entry points will be exposed ( default : true ) .
* /
entryOnly? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* 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 ( compiler? : any ) : void ;
}
type DllReferencePluginOptions =
| {
/ * *
* Context of requests in the manifest ( or content property ) as absolute path .
* /
context? : string ;
/ * *
* Extensions used to resolve module s in the dll bundle ( only used when using 'scope' ) .
* /
2020-04-23 17:43:38 +08:00
extensions? : string [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* 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 ) .
* /
2020-12-17 01:26:46 +08:00
sourceType ? :
| "var"
| "assign"
| "this"
| "window"
| "global"
| "commonjs"
| "commonjs2"
| "commonjs-module"
| "amd"
| "amd-require"
| "umd"
| "umd2"
| "jsonp"
| "system" ;
2020-04-21 14:45:35 +08:00
/ * *
* 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 module s in the dll bundle ( only used when using 'scope' ) .
* /
2020-04-23 17:43:38 +08:00
extensions? : string [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* 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 ) .
* /
2020-12-17 01:26:46 +08:00
sourceType ? :
| "var"
| "assign"
| "this"
| "window"
| "global"
| "commonjs"
| "commonjs2"
| "commonjs-module"
| "amd"
| "amd-require"
| "umd"
| "umd2"
| "jsonp"
| "system" ;
2020-04-21 14:45:35 +08:00
/ * *
* The way how the export of the dll bundle is used .
* /
type ? : "object" | "require" ;
} ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The mappings from request to module info.
* /
declare interface DllReferencePluginOptionsContent {
[ index : string ] : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Meta information about the module .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
buildMeta ? : { [ index : string ] : any } ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Information about the provided exports of the module .
2020-03-21 21:01:38 +08:00
* /
2020-04-23 17:43:38 +08:00
exports? : true | string [ ] ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Module ID .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
id : string | number ;
} ;
}
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* An object containing content , name and type .
* /
declare interface DllReferencePluginOptionsManifest {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* The mappings from request to module info.
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
content : DllReferencePluginOptionsContent ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The name where the dll is exposed ( external name ) .
* /
name? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The type how the dll is exposed ( external type ) .
* /
2020-12-17 01:26:46 +08:00
type ? :
| "var"
| "assign"
| "this"
| "window"
| "global"
| "commonjs"
| "commonjs2"
| "commonjs-module"
| "amd"
| "amd-require"
| "umd"
| "umd2"
| "jsonp"
| "system" ;
2020-04-21 14:45:35 +08:00
}
2020-10-12 15:39:43 +08:00
declare class DynamicEntryPlugin {
constructor ( context : string , entry : ( ) = > Promise < EntryStaticNormalized > ) ;
context : string ;
entry : ( ) = > Promise < EntryStaticNormalized > ;
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
2020-04-21 14:45:35 +08:00
declare interface Effect {
type : string ;
value : any ;
}
2020-08-20 05:17:33 +08:00
declare class ElectronTargetPlugin {
2020-09-10 16:42:29 +08:00
constructor ( context ? : "main" | "preload" | "renderer" ) ;
2020-08-20 05:17:33 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
2020-08-26 03:45:56 +08:00
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 ;
}
2020-04-21 14:45:35 +08:00
declare class EnableLibraryPlugin {
2020-08-26 03:45:56 +08:00
constructor ( type : string ) ;
type : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
2020-08-26 03:45:56 +08:00
static setEnabled ( compiler : Compiler , type : string ) : void ;
static checkEnabled ( compiler : Compiler , type : string ) : void ;
2020-04-21 14:45:35 +08:00
}
type Entry =
| string
2020-10-29 03:51:08 +08:00
| ( ( ) = > string | EntryObject | string [ ] | Promise < EntryStatic > )
2020-04-21 14:45:35 +08:00
| EntryObject
2020-10-29 03:51:08 +08:00
| string [ ] ;
2020-04-21 14:45:35 +08:00
declare interface EntryData {
/ * *
2020-05-25 16:50:37 +08:00
* dependencies of the entrypoint that should be evaluated at startup
2020-04-21 14:45:35 +08:00
* /
2020-05-05 16:43:18 +08:00
dependencies : Dependency [ ] ;
2020-03-21 21:01:38 +08:00
2020-05-25 16:50:37 +08:00
/ * *
2020-06-14 06:05:35 +08:00
* dependencies of the entrypoint that should be included but not evaluated
2020-05-25 16:50:37 +08:00
* /
includeDependencies : Dependency [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* options of the entrypoint
* /
2020-11-26 17:49:59 +08:00
options : EntryOptions ;
2020-04-21 14:45:35 +08:00
}
declare abstract class EntryDependency extends ModuleDependency { }
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* An object with entry point description .
* /
declare interface EntryDescription {
2020-08-26 03:45:56 +08:00
/ * *
* The method of loading chunks ( methods included by default are 'jsonp' ( web ) , 'importScripts' ( WebWorker ) , 'require' ( sync node . js ) , 'async-node' ( async node . js ) , but others might be added by plugins ) .
* /
2020-12-17 01:26:46 +08:00
chunkLoading? : string | false ;
2020-08-26 03:45:56 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The entrypoints that the current entrypoint depend on . They must be loaded when this entrypoint is loaded .
* /
2020-12-17 01:26:46 +08:00
dependOn? : string | string [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Specifies the name of each output file on disk . You must * * not * * specify an absolute path here ! The ` output.path ` option determines the location on disk the files are written to , filename is used solely for naming the individual files .
* /
2020-12-17 01:26:46 +08:00
filename? : string | ( ( pathData : PathData , assetInfo? : AssetInfo ) = > string ) ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Module ( s ) that are loaded upon startup .
* /
import : EntryItem ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options for library .
* /
library? : LibraryOptions ;
2020-07-21 16:22:10 +08:00
/ * *
* 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 ;
2020-09-09 15:23:01 +08:00
/ * *
* 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 ) .
* /
2020-12-17 01:26:46 +08:00
wasmLoading? : string | false ;
2020-04-21 14:45:35 +08:00
}
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* An object with entry point description .
* /
declare interface EntryDescriptionNormalized {
2020-08-26 03:45:56 +08:00
/ * *
* The method of loading chunks ( methods included by default are 'jsonp' ( web ) , 'importScripts' ( WebWorker ) , 'require' ( sync node . js ) , 'async-node' ( async node . js ) , but others might be added by plugins ) .
* /
2020-12-17 01:26:46 +08:00
chunkLoading? : string | false ;
2020-08-26 03:45:56 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The entrypoints that the current entrypoint depend on . They must be loaded when this entrypoint is loaded .
* /
2020-10-29 03:51:08 +08:00
dependOn? : string [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Specifies the name of each output file on disk . You must * * not * * specify an absolute path here ! The ` output.path ` option determines the location on disk the files are written to , filename is used solely for naming the individual files .
* /
2020-12-17 01:26:46 +08:00
filename? : string | ( ( pathData : PathData , assetInfo? : AssetInfo ) = > string ) ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Module ( s ) that are loaded upon startup . The last one is exported .
* /
2020-10-29 03:51:08 +08:00
import ? : string [ ] ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Options for library .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
library? : LibraryOptions ;
2020-07-21 16:22:10 +08:00
/ * *
* 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 ;
2020-09-09 15:23:01 +08:00
/ * *
* 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 ) .
* /
2020-12-17 01:26:46 +08:00
wasmLoading? : string | false ;
2020-04-21 14:45:35 +08:00
}
2020-10-29 03:51:08 +08:00
type EntryItem = string | string [ ] ;
2020-04-21 14:45:35 +08:00
type EntryNormalized =
| ( ( ) = > Promise < EntryStaticNormalized > )
| 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 {
2020-10-29 03:51:08 +08:00
[ index : string ] : string | string [ ] | EntryDescription ;
2020-04-21 14:45:35 +08:00
}
2020-10-12 15:37:07 +08:00
declare class EntryOptionPlugin {
constructor ( ) ;
apply ( compiler : Compiler ) : void ;
static applyEntryOption (
compiler : Compiler ,
context : string ,
2020-10-12 15:45:19 +08:00
entry : EntryNormalized
2020-10-12 15:37:07 +08:00
) : void ;
static entryDescriptionToOptions (
compiler : Compiler ,
name : string ,
desc : EntryDescriptionNormalized
2020-11-26 17:49:59 +08:00
) : EntryOptions ;
}
type EntryOptions = { name? : string } & Pick <
EntryDescriptionNormalized ,
| "filename"
| "chunkLoading"
| "dependOn"
| "library"
| "runtime"
| "wasmLoading"
> ;
2020-04-21 14:45:35 +08:00
declare class EntryPlugin {
/ * *
* An entry plugin which will handle
* creation of the EntryDependency
* /
2020-11-26 17:49:59 +08:00
constructor ( context : string , entry : string , options : string | EntryOptions ) ;
2020-04-21 14:45:35 +08:00
context : string ;
entry : string ;
2020-11-26 17:49:59 +08:00
options : string | EntryOptions ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
static createDependency (
entry : string ,
2020-11-26 17:49:59 +08:00
options : string | EntryOptions
2020-04-21 14:45:35 +08:00
) : EntryDependency ;
}
2020-10-29 03:51:08 +08:00
type EntryStatic = string | EntryObject | string [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* 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 ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Fetches the chunk reference containing the webpack bootstrap code
* /
2020-12-17 01:26:46 +08:00
getRuntimeChunk ( ) : null | Chunk ;
2020-07-21 16:22:10 +08:00
/ * *
* Sets the chunk with the entrypoint module s for an entrypoint .
* /
setEntrypointChunk ( chunk : Chunk ) : void ;
/ * *
* Returns the chunk which contains the entrypoint module s
* ( or at least the execution of them )
* /
getEntrypointChunk ( ) : Chunk ;
2020-04-21 14:45:35 +08:00
}
2020-09-09 22:37:53 +08:00
/ * *
* 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 BigInt as literal ( 123 n ) .
* /
bigIntLiteral? : boolean ;
/ * *
* The environment supports const and let for variable declarations .
* /
const ? : boolean ;
/ * *
2020-09-10 16:42:29 +08:00
* The environment supports destructuring ( '{ a, b } = obj' ) .
2020-09-09 22:37:53 +08:00
* /
2020-09-10 16:42:29 +08:00
destructuring? : boolean ;
2020-09-09 22:37:53 +08:00
/ * *
2020-09-12 04:43:01 +08:00
* The environment supports an async import ( ) function to import EcmaScript module s.
2020-09-09 22:37:53 +08:00
* /
2020-09-12 04:43:01 +08:00
dynamicImport? : boolean ;
2020-09-09 22:37:53 +08:00
/ * *
2020-09-12 04:43:01 +08:00
* The environment supports 'for of' iteration ( 'for (const x of array) { ... }' ) .
2020-09-09 22:37:53 +08:00
* /
2020-09-12 04:43:01 +08:00
forOf? : boolean ;
2020-09-09 22:37:53 +08:00
/ * *
* The environment supports EcmaScript Module syntax to import EcmaScript module s ( import . . . from '...' ) .
* /
module ? : boolean ;
}
2020-04-21 14:45:35 +08:00
declare class EnvironmentPlugin {
2020-04-23 17:43:38 +08:00
constructor ( . . . keys : any [ ] ) ;
keys : any [ ] ;
2020-04-21 14:45:35 +08:00
defaultValues : any ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare interface Etag {
toString : ( ) = > string ;
}
declare class EvalDevToolModulePlugin {
constructor ( options? : any ) ;
namespace : any ;
sourceUrlComment : any ;
module FilenameTemplate : any ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare class EvalSourceMapDevToolPlugin {
2020-08-03 02:09:36 +08:00
constructor ( inputOptions : string | SourceMapDevToolPluginOptions ) ;
sourceMapComment : string ;
module FilenameTemplate : DevtoolFallbackModuleFilenameTemplate ;
namespace : string ;
options : SourceMapDevToolPluginOptions ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Apply the plugin
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
apply ( compiler : Compiler ) : void ;
}
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Enables / Disables experiments ( experimental features with relax SemVer compatibility ) .
* /
declare interface Experiments {
/ * *
* Allow module type 'asset' to generate assets .
* /
asset? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Support WebAssembly as asynchronous EcmaScript Module .
* /
asyncWebAssembly? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Allow output javascript files as module source type .
* /
outputModule? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Support WebAssembly as synchronous EcmaScript Module ( outdated ) .
* /
syncWebAssembly? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Allow using top - level - await in EcmaScript Modules .
* /
topLevelAwait? : boolean ;
}
2020-07-28 00:09:48 +08:00
declare abstract class ExportInfo {
2020-04-21 14:45:35 +08:00
name : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* 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
2020-03-21 21:01:38 +08:00
* /
2020-12-17 01:26:46 +08:00
provided? : null | boolean ;
2020-03-21 21:01:38 +08:00
2020-08-12 00:06:27 +08:00
/ * *
* is the export a terminal binding that should be checked for export star conflicts
* /
terminalBinding : boolean ;
2020-04-21 14:45:35 +08:00
/ * *
* true : it can be mangled
* false : is can not be mangled
* undefined : it was not determined if it can be mangled
* /
2020-12-17 01:26:46 +08:00
canMangleProvide? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* true : it can be mangled
* false : is can not be mangled
* undefined : it was not determined if it can be mangled
* /
2020-12-17 01:26:46 +08:00
canMangleUse? : boolean ;
2020-04-21 14:45:35 +08:00
exportsInfoOwned : boolean ;
2020-12-17 01:26:46 +08:00
exportsInfo? : ExportsInfo ;
readonly canMangle? : boolean ;
2020-11-26 17:49:59 +08:00
setUsedInUnknownWay ( runtime : RuntimeSpec ) : boolean ;
setUsedWithoutInfo ( runtime : RuntimeSpec ) : boolean ;
2020-07-28 00:09:48 +08:00
setHasUseInfo ( ) : void ;
setUsedConditionally (
2020-11-26 17:49:59 +08:00
condition : ( arg0 : UsageStateType ) = > boolean ,
newValue : UsageStateType ,
runtime : RuntimeSpec
2020-07-28 00:09:48 +08:00
) : boolean ;
2020-11-26 17:49:59 +08:00
setUsed ( newValue : UsageStateType , runtime : RuntimeSpec ) : boolean ;
2020-09-15 16:07:04 +08:00
setTarget (
key? : any ,
connection? : ModuleGraphConnection ,
exportName? : string [ ]
) : boolean ;
2020-11-26 17:49:59 +08:00
getUsed ( runtime : RuntimeSpec ) : UsageStateType ;
2020-03-29 05:55:41 +08:00
/ * *
* get used name
* /
2020-12-17 01:26:46 +08:00
getUsedName ( fallbackName : undefined | string , runtime : RuntimeSpec ) : DevTool ;
2020-07-28 00:09:48 +08:00
hasUsedName ( ) : boolean ;
/ * *
* Sets the mangled name of this export
* /
setUsedName ( name : string ) : void ;
2020-09-15 16:07:04 +08:00
getTerminalBinding (
module Graph : ModuleGraph ,
resolveTargetFilter ? : ( arg0 : {
module : Module ;
2020-12-17 01:26:46 +08:00
export ? : string [ ] ;
2020-09-15 16:07:04 +08:00
} ) = > boolean
2020-12-17 01:26:46 +08:00
) : undefined | ExportsInfo | ExportInfo ;
isReexport ( ) : undefined | boolean ;
2020-09-15 16:07:04 +08:00
findTarget (
module Graph : ModuleGraph ,
validTargetModuleFilter : ( arg0 : Module ) = > boolean
2020-12-17 01:26:46 +08:00
) : undefined | false | { module : Module ; export ? : string [ ] } ;
2020-08-13 00:05:58 +08:00
getTarget (
module Graph : ModuleGraph ,
2020-08-13 05:20:45 +08:00
resolveTargetFilter ? : ( arg0 : {
module : Module ;
2020-12-17 01:26:46 +08:00
export ? : string [ ] ;
2020-08-13 05:20:45 +08:00
} ) = > boolean
2020-12-17 01:26:46 +08:00
) : undefined | { module : Module ; export ? : string [ ] } ;
2020-11-16 18:18:10 +08:00
/ * *
* Move the target forward as long resolveTargetFilter is fulfilled
* /
moveTarget (
module Graph : ModuleGraph ,
2020-12-17 01:26:46 +08:00
resolveTargetFilter : ( arg0 : {
module : Module ;
export ? : string [ ] ;
} ) = > boolean
) : undefined | { module : Module ; export ? : string [ ] } ;
createNestedExportsInfo ( ) : undefined | ExportsInfo ;
getNestedExportsInfo ( ) : undefined | ExportsInfo ;
2020-12-24 03:30:04 +08:00
hasInfo ( baseInfo? : any , runtime? : any ) : boolean ;
2020-07-28 00:09:48 +08:00
updateHash ( hash? : any , runtime? : any ) : void ;
getUsedInfo ( ) : string ;
2020-04-21 14:45:35 +08:00
getProvidedInfo ( ) :
| "no provided info"
| "maybe provided (runtime-defined)"
| "provided"
| "not provided" ;
getRenameInfo ( ) : string ;
}
declare interface ExportSpec {
/ * *
* the name of the export
* /
name : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* can the export be renamed ( defaults to true )
* /
canMangle? : boolean ;
2020-03-21 21:01:38 +08:00
2020-08-12 00:06:27 +08:00
/ * *
* is the export a terminal binding that should be checked for export star conflicts
* /
terminalBinding? : boolean ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* nested exports
2020-03-21 21:01:38 +08:00
* /
2020-04-23 17:43:38 +08:00
exports ? : ( string | ExportSpec ) [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* when reexported : from which module
* /
2020-09-15 16:07:04 +08:00
from ? : ModuleGraphConnection ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* when reexported : from which export
* /
2020-12-17 01:26:46 +08:00
export ? : null | string [ ] ;
2020-04-21 14:45:35 +08:00
}
2020-11-26 17:49:59 +08:00
type ExportedVariableInfo = string | ScopeInfo | VariableInfo ;
2020-07-28 00:09:48 +08:00
declare abstract class ExportsInfo {
2020-04-21 14:45:35 +08:00
readonly ownedExports : Iterable < ExportInfo > ;
2020-07-28 00:09:48 +08:00
readonly orderedOwnedExports : Iterable < ExportInfo > ;
2020-04-21 14:45:35 +08:00
readonly exports : Iterable < ExportInfo > ;
readonly orderedExports : Iterable < ExportInfo > ;
readonly otherExportsInfo : ExportInfo ;
2020-04-23 02:31:26 +08:00
setRedirectNamedTo ( exportsInfo? : any ) : boolean ;
2020-04-21 14:45:35 +08:00
setHasProvideInfo ( ) : void ;
setHasUseInfo ( ) : void ;
2020-04-23 02:31:26 +08:00
getOwnExportInfo ( name : string ) : ExportInfo ;
2020-04-21 14:45:35 +08:00
getExportInfo ( name : string ) : ExportInfo ;
getReadOnlyExportInfo ( name : string ) : ExportInfo ;
2020-12-17 01:26:46 +08:00
getReadOnlyExportInfoRecursive ( name : string [ ] ) : undefined | ExportInfo ;
getNestedExportsInfo ( name? : string [ ] ) : undefined | ExportsInfo ;
2020-05-19 06:29:07 +08:00
setUnknownExportsProvided (
canMangle? : boolean ,
2020-08-13 00:05:58 +08:00
excludeExports? : Set < string > ,
targetKey? : any ,
2020-09-15 16:07:04 +08:00
targetModule? : ModuleGraphConnection
2020-05-19 06:29:07 +08:00
) : boolean ;
2020-11-26 17:49:59 +08:00
setUsedInUnknownWay ( runtime : RuntimeSpec ) : boolean ;
setUsedWithoutInfo ( runtime : RuntimeSpec ) : boolean ;
setAllKnownExportsUsed ( runtime : RuntimeSpec ) : boolean ;
setUsedForSideEffectsOnly ( runtime : RuntimeSpec ) : boolean ;
isUsed ( runtime : RuntimeSpec ) : boolean ;
isModuleUsed ( runtime : RuntimeSpec ) : boolean ;
2020-12-17 01:26:46 +08:00
getUsedExports ( runtime : RuntimeSpec ) : null | boolean | SortableSet < string > ;
getProvidedExports ( ) : null | true | string [ ] ;
2020-11-26 17:49:59 +08:00
getRelevantExports ( runtime : RuntimeSpec ) : ExportInfo [ ] ;
2020-12-17 01:26:46 +08:00
isExportProvided ( name : EntryItem ) : undefined | null | boolean ;
2020-11-26 17:49:59 +08:00
getUsageKey ( runtime : RuntimeSpec ) : string ;
isEquallyUsed ( runtimeA : RuntimeSpec , runtimeB : RuntimeSpec ) : boolean ;
getUsed ( name : EntryItem , runtime : RuntimeSpec ) : UsageStateType ;
getUsedName ( name : EntryItem , runtime : RuntimeSpec ) : Target ;
updateHash ( hash : Hash , runtime : RuntimeSpec ) : void ;
2020-04-21 14:45:35 +08:00
getRestoreProvidedData ( ) : any ;
restoreProvided ( __0 : {
otherProvided : any ;
otherCanMangleProvide : any ;
2020-08-12 00:06:27 +08:00
otherTerminalBinding : any ;
2020-04-21 14:45:35 +08:00
exports : any ;
} ) : void ;
}
declare interface ExportsSpec {
/ * *
* exported names , true for unknown exports or null for no exports
* /
2020-12-17 01:26:46 +08:00
exports : null | true | ( string | ExportSpec ) [ ] ;
2020-03-21 21:01:38 +08:00
2020-05-19 06:29:07 +08:00
/ * *
* when exports = true , list of unaffected exports
* /
excludeExports? : Set < string > ;
2020-08-13 00:05:58 +08:00
/ * *
* when reexported : from which module
* /
2020-09-15 16:07:04 +08:00
from ? : ModuleGraphConnection ;
2020-08-13 00:05:58 +08:00
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* can the export be renamed ( defaults to true )
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
canMangle? : boolean ;
2020-03-21 21:01:38 +08:00
2020-08-12 00:06:27 +08:00
/ * *
* are the exports terminal bindings that should be checked for export star conflicts
* /
terminalBinding? : boolean ;
2020-04-21 14:45:35 +08:00
/ * *
* module on which the result depends on
* /
2020-04-23 17:43:38 +08:00
dependencies? : Module [ ] ;
2020-04-21 14:45:35 +08:00
}
2020-05-14 21:50:35 +08:00
type Exposes = ( string | ExposesObject ) [ ] | ExposesObject ;
/ * *
* Advanced configuration for module s that should be exposed by this container .
* /
declare interface ExposesConfig {
/ * *
* Request to a module that should be exposed by this container .
* /
import : string | string [ ] ;
}
/ * *
* Modules that should be exposed by this container . Property names are used as public paths .
* /
declare interface ExposesObject {
[ index : string ] : string | ExposesConfig | string [ ] ;
}
2020-04-21 14:45:35 +08:00
type Expression =
| UnaryExpression
| ThisExpression
| ArrayExpression
| ObjectExpression
| FunctionExpression
| ArrowFunctionExpression
| YieldExpression
| SimpleLiteral
| RegExpLiteral
| UpdateExpression
| BinaryExpression
| AssignmentExpression
| LogicalExpression
| MemberExpression
| ConditionalExpression
| SimpleCallExpression
| NewExpression
| SequenceExpression
| TemplateLiteral
| TaggedTemplateExpression
| ClassExpression
| MetaProperty
| Identifier
2020-07-03 17:34:54 +08:00
| AwaitExpression
| ImportExpression
| ChainExpression ;
2020-11-26 17:49:59 +08:00
declare interface ExpressionExpressionInfo {
type : "expression" ;
rootInfo : string | VariableInfo ;
name : string ;
getMembers : ( ) = > string [ ] ;
}
2020-04-21 14:45:35 +08:00
type ExternalItem =
| string
| RegExp
2020-04-23 17:43:38 +08:00
| { [ index : string ] : string | boolean | string [ ] | { [ index : string ] : any } }
2020-04-21 14:45:35 +08:00
| ( (
2020-05-15 22:24:11 +08:00
data : { context : string ; request : string } ,
2020-11-26 17:48:16 +08:00
callback : ( err? : Error , result? : string ) = > void
2020-04-21 14:45:35 +08:00
) = > void ) ;
declare class ExternalModule extends Module {
constructor ( request? : any , type ? : any , userRequest? : any ) ;
2020-10-29 03:51:08 +08:00
request : string | string [ ] | Record < string , EntryItem > ;
2020-04-21 14:45:35 +08:00
externalType : string ;
userRequest : string ;
2020-09-15 16:07:04 +08:00
getSourceData (
2020-04-21 14:45:35 +08:00
runtimeTemplate? : any ,
module Graph? : any ,
chunkGraph? : any
2020-09-15 16:07:04 +08:00
) : SourceData ;
2020-04-21 14:45:35 +08:00
}
2020-09-15 16:56:06 +08:00
declare interface ExternalModuleInfo {
index : number ;
module : Module ;
}
2020-04-21 14:45:35 +08:00
type Externals =
| string
| RegExp
2020-04-23 17:43:38 +08:00
| ExternalItem [ ]
| { [ index : string ] : string | boolean | string [ ] | { [ index : string ] : any } }
2020-04-21 14:45:35 +08:00
| ( (
2020-05-15 22:24:11 +08:00
data : { context : string ; request : string } ,
2020-11-26 17:48:16 +08:00
callback : ( err? : Error , result? : string ) = > void
2020-04-21 14:45:35 +08:00
) = > void ) ;
declare class ExternalsPlugin {
2020-12-17 01:26:46 +08:00
constructor ( type : undefined | string , externals : Externals ) ;
type ? : string ;
2020-05-15 22:24:11 +08:00
externals : Externals ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
2020-09-09 21:16:53 +08:00
/ * *
* Enable presets of externals for specific targets .
* /
declare interface ExternalsPresets {
2020-09-10 16:42:29 +08:00
/ * *
* Treat common electron built - in module s in main and preload context like 'electron' , 'ipc' or 'shell' as external and load them via require ( ) when used .
* /
electron? : boolean ;
2020-09-09 21:16:53 +08:00
/ * *
* Treat electron built - in module s 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 module s in the preload context like 'web-frame' , 'ipc-renderer' or 'shell' as external and load them via require ( ) when used .
* /
electronPreload? : boolean ;
2020-09-10 16:42:29 +08:00
/ * *
* Treat electron built - in module s in the renderer context like 'web-frame' , 'ipc-renderer' or 'shell' as external and load them via require ( ) when used .
* /
electronRenderer? : boolean ;
2020-09-09 21:16:53 +08:00
/ * *
* Treat node . js built - in module s like fs , path or vm as external and load them via require ( ) when used .
* /
node? : boolean ;
/ * *
2020-09-10 16:42:29 +08:00
* Treat NW . js legacy nw . gui module as external and load it via require ( ) when used .
2020-09-09 21:16:53 +08:00
* /
2020-09-10 16:42:29 +08:00
nwjs? : boolean ;
2020-09-09 21:16:53 +08:00
/ * *
* 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 ;
}
2020-05-15 22:24:11 +08:00
type ExternalsType =
| "var"
| "module"
| "assign"
| "this"
| "window"
| "self"
| "global"
| "commonjs"
| "commonjs2"
| "commonjs-module"
| "amd"
| "amd-require"
| "umd"
| "umd2"
| "jsonp"
| "system"
| "promise"
2020-06-04 08:06:57 +08:00
| "import"
| "script" ;
2020-04-21 14:45:35 +08:00
declare interface FactorizeModuleOptions {
currentProfile : ModuleProfile ;
factory : ModuleFactory ;
2020-04-23 17:43:38 +08:00
dependencies : Dependency [ ] ;
2020-12-17 01:26:46 +08:00
originModule : null | Module ;
2020-04-21 14:45:35 +08:00
context? : string ;
}
2020-11-26 17:49:59 +08:00
type FakeHook < T > = T & FakeHookMarker ;
2020-05-12 18:16:51 +08:00
declare interface FakeHookMarker { }
2020-04-21 14:45:35 +08:00
declare interface FallbackCacheGroup {
minSize : Record < string , number > ;
maxAsyncSize : Record < string , number > ;
maxInitialSize : Record < string , number > ;
automaticNameDelimiter : string ;
}
2020-08-20 05:17:33 +08:00
declare class FetchCompileAsyncWasmPlugin {
constructor ( ) ;
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
2020-04-21 14:45:35 +08:00
declare class FetchCompileWasmPlugin {
constructor ( options? : any ) ;
options : any ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options object for persistent file - based caching .
* /
declare interface FileCacheOptions {
/ * *
* Dependencies the build depends on ( in multiple categories , default categories : 'defaultWebpack' ) .
* /
2020-04-23 17:43:38 +08:00
buildDependencies ? : { [ index : string ] : string [ ] } ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Base directory for the cache ( defaults to node_modules / . cache / webpack ) .
* /
cacheDirectory? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Locations for the cache ( defaults to cacheDirectory / name ) .
* /
cacheLocation? : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Algorithm used for generation the hash ( see node . js crypto package ) .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
hashAlgorithm? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Time in ms after which idle period the cache storing should happen ( only for store : 'pack' or 'idle' ) .
* /
idleTimeout? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Time in ms after which idle period the initial cache storing should happen ( only for store : 'pack' or 'idle' ) .
* /
idleTimeoutForInitialStore? : number ;
2020-03-21 21:01:38 +08:00
/ * *
2020-05-02 19:10:55 +08:00
* List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable .
2020-03-21 21:01:38 +08:00
* /
2020-04-23 17:43:38 +08:00
immutablePaths? : string [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* List of paths that are managed by a package manager and can be trusted to not be modified otherwise .
* /
2020-04-23 17:43:38 +08:00
managedPaths? : string [ ] ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Name for the cache . Different names will lead to different coexisting caches .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
name? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* When to store data to the filesystem . ( pack : Store data when compiler is idle in a single file ) .
* /
store ? : "pack" ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Filesystem caching .
* /
type : "filesystem" ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* 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 ;
}
2020-06-17 19:22:37 +08:00
declare interface FileSystem {
2020-07-17 16:27:48 +08:00
readFile : {
( arg0 : string , arg1 : FileSystemCallback < string | Buffer > ) : void ;
( arg0 : string , arg1 : any , arg2 : FileSystemCallback < string | Buffer > ) : void ;
} ;
readdir : {
(
arg0 : string ,
arg1 : FileSystemCallback < ( string | Buffer ) [ ] | FileSystemDirent [ ] >
) : void ;
(
arg0 : string ,
arg1 : any ,
arg2 : FileSystemCallback < ( string | Buffer ) [ ] | FileSystemDirent [ ] >
) : void ;
} ;
readJson ? : {
( arg0 : string , arg1 : FileSystemCallback < any > ) : void ;
( arg0 : string , arg1 : any , arg2 : FileSystemCallback < any > ) : void ;
} ;
readlink : {
( arg0 : string , arg1 : FileSystemCallback < string | Buffer > ) : void ;
( arg0 : string , arg1 : any , arg2 : FileSystemCallback < string | Buffer > ) : void ;
} ;
2020-09-30 15:51:16 +08:00
lstat ? : {
( arg0 : string , arg1 : FileSystemCallback < FileSystemStats > ) : void ;
( arg0 : string , arg1 : any , arg2 : FileSystemCallback < string | Buffer > ) : void ;
} ;
2020-07-17 16:27:48 +08:00
stat : {
( arg0 : string , arg1 : FileSystemCallback < FileSystemStats > ) : void ;
( arg0 : string , arg1 : any , arg2 : FileSystemCallback < string | Buffer > ) : void ;
} ;
}
declare interface FileSystemCallback < T > {
2020-12-17 01:26:46 +08:00
( err? : null | ( PossibleFileSystemError & Error ) , result? : T ) : any ;
2020-07-17 16:27:48 +08:00
}
declare interface FileSystemDirent {
name : string | Buffer ;
isDirectory : ( ) = > boolean ;
isFile : ( ) = > boolean ;
2020-06-17 19:22:37 +08:00
}
2020-04-21 14:45:35 +08:00
declare abstract class FileSystemInfo {
fs : InputFileSystem ;
2020-12-17 01:26:46 +08:00
logger? : WebpackLogger ;
fileTimestampQueue : AsyncQueue < string , string , null | FileSystemInfoEntry > ;
fileHashQueue : AsyncQueue < string , string , null | string > ;
contextTimestampQueue : AsyncQueue < string , string , null | FileSystemInfoEntry > ;
contextHashQueue : AsyncQueue < string , string , null | string > ;
managedItemQueue : AsyncQueue < string , string , null | string > ;
2020-04-21 14:45:35 +08:00
managedItemDirectoryQueue : AsyncQueue < string , string , Set < string > > ;
2020-04-23 17:43:38 +08:00
managedPaths : string [ ] ;
managedPathsWithSlash : string [ ] ;
immutablePaths : string [ ] ;
immutablePathsWithSlash : string [ ] ;
2020-08-21 03:57:44 +08:00
logStatistics ( ) : void ;
2020-12-17 01:26:46 +08:00
addFileTimestamps (
map : Map < string , null | FileSystemInfoEntry | " ignore " >
) : void ;
addContextTimestamps (
map : Map < string , null | FileSystemInfoEntry | " ignore " >
) : void ;
2020-04-21 14:45:35 +08:00
getFileTimestamp (
path : string ,
2020-12-17 01:26:46 +08:00
callback : (
arg0? : WebpackError ,
arg1? : null | FileSystemInfoEntry | "ignore"
) = > void
2020-04-21 14:45:35 +08:00
) : void ;
getContextTimestamp (
path : string ,
2020-12-17 01:26:46 +08:00
callback : (
arg0? : WebpackError ,
arg1? : null | FileSystemInfoEntry | "ignore"
) = > void
2020-04-21 14:45:35 +08:00
) : void ;
getFileHash (
path : string ,
2020-12-17 01:26:46 +08:00
callback : ( arg0? : WebpackError , arg1? : string ) = > void
2020-04-21 14:45:35 +08:00
) : void ;
getContextHash (
path : string ,
2020-12-17 01:26:46 +08:00
callback : ( arg0? : WebpackError , arg1? : string ) = > void
2020-04-21 14:45:35 +08:00
) : void ;
resolveBuildDependencies (
context : string ,
deps : Iterable < string > ,
2020-12-17 01:26:46 +08:00
callback : ( arg0? : Error , arg1? : ResolveBuildDependenciesResult ) = > void
2020-04-21 14:45:35 +08:00
) : void ;
checkResolveResultsValid (
resolveResults : Map < string , string > ,
2020-12-17 01:26:46 +08:00
callback : ( arg0? : Error , arg1? : boolean ) = > void
2020-04-21 14:45:35 +08:00
) : void ;
createSnapshot (
startTime : number ,
files : Iterable < string > ,
directories : Iterable < string > ,
missing : Iterable < string > ,
options : {
2020-03-21 21:01:38 +08:00
/ * *
2020-08-26 06:36:16 +08:00
* Use hashes of the content of the files / directories to determine invalidation .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
hash? : boolean ;
2020-08-21 03:57:44 +08:00
/ * *
2020-08-26 06:36:16 +08:00
* Use timestamps of the files / directories to determine invalidation .
2020-08-21 03:57:44 +08:00
* /
timestamp? : boolean ;
2020-04-21 14:45:35 +08:00
} ,
2020-12-17 01:26:46 +08:00
callback : ( arg0? : WebpackError , arg1? : Snapshot ) = > void
2020-04-21 14:45:35 +08:00
) : void ;
mergeSnapshots ( snapshot1 : Snapshot , snapshot2 : Snapshot ) : Snapshot ;
checkSnapshotValid (
snapshot : Snapshot ,
2020-12-17 01:26:46 +08:00
callback : ( arg0? : WebpackError , arg1? : boolean ) = > void
2020-04-21 14:45:35 +08:00
) : void ;
getDeprecatedFileTimestamps ( ) : Map < any , any > ;
getDeprecatedContextTimestamps ( ) : Map < any , any > ;
}
declare interface FileSystemInfoEntry {
safeTime : number ;
timestamp? : number ;
timestampHash? : string ;
}
2020-06-17 19:22:37 +08:00
declare interface FileSystemStats {
isDirectory : ( ) = > boolean ;
isFile : ( ) = > boolean ;
}
2020-04-21 14:45:35 +08:00
type FilterItemTypes = string | RegExp | ( ( value : string ) = > boolean ) ;
declare interface GenerateContext {
/ * *
* mapping from dependencies to templates
* /
dependencyTemplates : DependencyTemplates ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* the runtime template
* /
runtimeTemplate : RuntimeTemplate ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* the module graph
* /
module Graph : ModuleGraph ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* the chunk graph
* /
chunkGraph : ChunkGraph ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* the requirements for runtime
* /
runtimeRequirements : Set < string > ;
2020-03-21 21:01:38 +08:00
2020-07-28 00:09:48 +08:00
/ * *
* the runtime
* /
2020-11-26 17:49:59 +08:00
runtime : RuntimeSpec ;
2020-07-28 00:09:48 +08:00
2020-09-11 15:06:24 +08:00
/ * *
* when in concatenated module , information about other concatenated module s
* /
concatenationScope? : ConcatenationScope ;
2020-04-21 14:45:35 +08:00
/ * *
* which kind of code should be generated
* /
type : string ;
}
declare class Generator {
constructor ( ) ;
getTypes ( module : NormalModule ) : Set < string > ;
getSize ( module : NormalModule , type ? : string ) : number ;
generate ( module : NormalModule , __1 : GenerateContext ) : Source ;
2020-09-15 16:07:04 +08:00
getConcatenationBailoutReason (
module : NormalModule ,
context : ConcatenationBailoutReasonContext
2020-12-17 01:26:46 +08:00
) : undefined | string ;
2020-07-28 00:09:48 +08:00
updateHash ( hash : Hash , __1 : UpdateHashContextGenerator ) : void ;
2020-04-21 14:45:35 +08:00
static byType ( map? : any ) : ByTypeGenerator ;
}
2020-09-25 02:29:08 +08:00
declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
constructor (
contentType : string ,
name : string ,
global : string ,
getFilenameForChunk : (
arg0 : Chunk
2020-12-17 01:26:46 +08:00
) = > string | ( ( arg0 : PathData , arg1? : AssetInfo ) = > string ) ,
2020-09-25 02:29:08 +08:00
allChunks : boolean
) ;
contentType : string ;
global : string ;
getFilenameForChunk : (
arg0 : Chunk
2020-12-17 01:26:46 +08:00
) = > string | ( ( arg0 : PathData , arg1? : AssetInfo ) = > string ) ;
2020-09-25 02:29:08 +08:00
allChunks : boolean ;
2020-12-11 21:32:42 +08:00
/ * *
* Runtime module s without any dependencies to other runtime module s
* /
static STAGE_NORMAL : number ;
/ * *
* Runtime module s with simple dependencies on other runtime module s
* /
static STAGE_BASIC : number ;
/ * *
* Runtime module s which attach to handlers of other runtime module s
* /
static STAGE_ATTACH : number ;
/ * *
* Runtime module s which trigger actions on bootstrap
* /
static STAGE_TRIGGER : number ;
2020-09-25 02:29:08 +08:00
}
2020-08-27 15:59:12 +08:00
declare interface GroupConfig < T , R > {
getKeys : ( arg0 : T ) = > string [ ] ;
createGroup : ( arg0 : string , arg1 : ( T | R ) [ ] , arg2 : T [ ] ) = > R ;
getOptions ? : ( arg0 : string , arg1 : T [ ] ) = > GroupOptions ;
}
declare interface GroupOptions {
groupChildren? : boolean ;
force? : boolean ;
2020-09-02 00:08:09 +08:00
targetGroupCount? : number ;
2020-08-27 15:59:12 +08:00
}
2020-04-21 14:45:35 +08:00
declare interface HMRJavascriptParserHooks {
2020-04-23 17:43:38 +08:00
hotAcceptCallback : SyncBailHook < [ any , string [ ] ] , void > ;
hotAcceptWithoutCallback : SyncBailHook < [ any , string [ ] ] , void > ;
2020-04-21 14:45:35 +08:00
}
declare interface HandleModuleCreationOptions {
factory : ModuleFactory ;
2020-04-23 17:43:38 +08:00
dependencies : Dependency [ ] ;
2020-12-17 01:26:46 +08:00
originModule : null | Module ;
2020-04-21 14:45:35 +08:00
context? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* recurse into dependencies of the created module
* /
recursive? : boolean ;
}
declare class Hash {
constructor ( ) ;
2020-10-13 02:16:58 +08:00
/ * *
* Update hash { @link https : //nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
* /
2020-04-21 14:45:35 +08:00
update ( data : string | Buffer , inputEncoding? : string ) : Hash ;
2020-10-13 02:16:58 +08:00
/ * *
* Calculates the digest { @link https : //nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
* /
2020-04-21 14:45:35 +08:00
digest ( encoding? : string ) : string | Buffer ;
}
type HashFunction = string | typeof Hash ;
2020-07-15 17:14:28 +08:00
declare interface HashableObject {
updateHash : ( arg0 : Hash ) = > void ;
}
2020-04-21 14:45:35 +08:00
declare class HashedModuleIdsPlugin {
constructor ( options? : HashedModuleIdsPluginOptions ) ;
options : HashedModuleIdsPluginOptions ;
apply ( compiler? : any ) : void ;
}
declare interface HashedModuleIdsPluginOptions {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* The context directory for creating names .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
context? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The encoding to use when generating the hash , defaults to 'base64' . All encodings from Node . JS ' hash . digest are supported .
* /
2020-11-26 17:49:59 +08:00
hashDigest ? : "hex" | "latin1" | "base64" ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The prefix length of the hash digest to use , defaults to 4 .
* /
hashDigestLength? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The hashing algorithm to use , defaults to 'md4' . All functions from Node . JS ' crypto . createHash are supported .
* /
hashFunction? : string ;
}
2020-08-19 21:05:49 +08:00
declare abstract class HelperRuntimeModule extends RuntimeModule { }
2020-04-21 14:45:35 +08:00
declare class HotModuleReplacementPlugin {
constructor ( options? : any ) ;
options : any ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
static getParserHooks ( parser : JavascriptParser ) : HMRJavascriptParserHooks ;
}
2020-09-25 02:29:08 +08:00
declare class HotUpdateChunk extends Chunk {
constructor ( ) ;
}
2020-07-03 20:45:49 +08:00
declare class HttpUriPlugin {
constructor ( ) ;
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
2020-07-06 23:45:09 +08:00
declare class HttpsUriPlugin {
constructor ( ) ;
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
2020-04-21 14:45:35 +08:00
declare class IgnorePlugin {
constructor ( options : IgnorePluginOptions ) ;
options : IgnorePluginOptions ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Note that if "contextRegExp" is given , both the "resourceRegExp"
* and "contextRegExp" have to match .
2020-03-21 21:01:38 +08:00
* /
2020-12-17 01:26:46 +08:00
checkIgnore ( resolveData : ResolveData ) : undefined | false ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
type IgnorePluginOptions =
| {
/ * *
* A RegExp to test the context ( directory ) against .
* /
contextRegExp? : RegExp ;
/ * *
* A RegExp to test the request against .
* /
resourceRegExp? : RegExp ;
}
| {
/ * *
* A filter function for resource and context .
* /
checkResource ? : ( resource : string , context : string ) = > boolean ;
} ;
2020-12-17 01:26:46 +08:00
type ImportSource = undefined | null | string | SimpleLiteral | RegExpLiteral ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options for infrastructure level logging .
* /
declare interface InfrastructureLogging {
/ * *
* Enable debug logging for specific loggers .
* /
debug ? :
| string
| boolean
| RegExp
2020-04-23 17:43:38 +08:00
| FilterItemTypes [ ]
2020-04-21 14:45:35 +08:00
| ( ( value : string ) = > boolean ) ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Log level .
* /
level ? : "none" | "verbose" | "error" | "warn" | "info" | "log" ;
}
declare abstract class InitFragment {
content : string | Source ;
stage : number ;
position : number ;
2020-12-17 01:26:46 +08:00
key? : string ;
endContent? : string | Source ;
2020-04-21 14:45:35 +08:00
getContent ( generateContext : GenerateContext ) : string | Source ;
2020-12-17 01:26:46 +08:00
getEndContent ( generateContext : GenerateContext ) : undefined | string | Source ;
2020-04-21 14:45:35 +08:00
merge : any ;
}
declare interface InputFileSystem {
readFile : (
arg0 : string ,
2020-12-17 01:26:46 +08:00
arg1 : ( arg0? : NodeJS.ErrnoException , arg1? : Buffer ) = > void
2020-04-21 14:45:35 +08:00
) = > void ;
2020-06-13 20:45:37 +08:00
readJson ? : (
arg0 : string ,
2020-12-17 01:26:46 +08:00
arg1 : ( arg0? : Error | NodeJS . ErrnoException , arg1? : any ) = > void
2020-06-13 20:45:37 +08:00
) = > void ;
2020-06-18 04:17:14 +08:00
readlink : (
arg0 : string ,
2020-12-17 01:26:46 +08:00
arg1 : ( arg0? : NodeJS.ErrnoException , arg1? : string | Buffer ) = > void
2020-06-18 04:17:14 +08:00
) = > void ;
2020-04-21 14:45:35 +08:00
readdir : (
arg0 : string ,
2020-12-17 01:26:46 +08:00
arg1 : ( arg0? : NodeJS.ErrnoException , arg1? : string [ ] ) = > void
2020-04-21 14:45:35 +08:00
) = > void ;
stat : (
arg0 : string ,
2020-12-17 01:26:46 +08:00
arg1 : ( arg0? : NodeJS.ErrnoException , arg1? : FsStats ) = > void
2020-04-21 14:45:35 +08:00
) = > void ;
realpath ? : (
arg0 : string ,
2020-12-17 01:26:46 +08:00
arg1 : ( arg0? : NodeJS.ErrnoException , arg1? : string ) = > void
2020-04-21 14:45:35 +08:00
) = > void ;
2020-12-17 01:26:46 +08:00
purge ? : ( arg0? : string ) = > void ;
2020-04-21 14:45:35 +08:00
join ? : ( arg0 : string , arg1 : string ) = > string ;
relative ? : ( arg0 : string , arg1 : string ) = > string ;
dirname ? : ( arg0 : string ) = > string ;
}
2020-11-26 17:49:59 +08:00
type IntermediateFileSystem = InputFileSystem &
OutputFileSystem &
IntermediateFileSystemExtras ;
2020-04-21 14:45:35 +08:00
declare interface IntermediateFileSystemExtras {
mkdirSync : ( arg0 : string ) = > void ;
createWriteStream : ( arg0 : string ) = > WriteStream ;
2020-12-14 20:16:20 +08:00
open : (
2020-12-12 18:19:39 +08:00
arg0 : string ,
2020-12-14 20:16:20 +08:00
arg1 : string ,
2020-12-17 01:26:46 +08:00
arg2 : ( arg0? : NodeJS.ErrnoException , arg1? : number ) = > void
2020-12-14 20:16:20 +08:00
) = > void ;
read : (
arg0 : number ,
arg1 : Buffer ,
arg2 : number ,
arg3 : number ,
arg4 : number ,
2020-12-17 01:26:46 +08:00
arg5 : ( arg0? : NodeJS.ErrnoException , arg1? : number ) = > void
2020-12-14 20:16:20 +08:00
) = > void ;
2020-12-17 01:26:46 +08:00
close : ( arg0 : number , arg1 : ( arg0? : NodeJS.ErrnoException ) = > void ) = > void ;
2020-04-21 14:45:35 +08:00
rename : (
arg0 : string ,
arg1 : string ,
2020-12-17 01:26:46 +08:00
arg2 : ( arg0? : NodeJS.ErrnoException ) = > void
2020-04-21 14:45:35 +08:00
) = > void ;
}
2020-11-26 17:49:59 +08:00
type InternalCell < T > = T | typeof TOMBSTONE | typeof UNDEFINED_MARKER ;
2020-07-15 17:14:28 +08:00
declare abstract class ItemCacheFacade {
get < T > ( callback : CallbackCache < T > ) : void ;
getPromise < T > ( ) : Promise < T > ;
store < T > ( data : T , callback : CallbackCache < void > ) : void ;
storePromise < T > ( data : T ) : Promise < void > ;
2020-08-19 17:25:24 +08:00
provide < T > (
computer : ( arg0 : CallbackNormalErrorCache < T > ) = > void ,
callback : CallbackNormalErrorCache < T >
) : void ;
providePromise < T > ( computer : ( ) = > T | Promise < T > ) : Promise < T > ;
2020-07-15 17:14:28 +08:00
}
2020-04-21 14:45:35 +08:00
declare class JavascriptModulesPlugin {
2020-12-18 20:52:15 +08:00
constructor ( options? : object ) ;
options : object ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
renderModule (
module : Module ,
2020-05-08 05:29:42 +08:00
renderContext : RenderContextObject ,
2020-04-21 14:45:35 +08:00
hooks : CompilationHooksJavascriptModulesPlugin ,
factory : boolean | "strict"
) : Source ;
renderChunk (
2020-05-08 05:29:42 +08:00
renderContext : RenderContextObject ,
2020-04-21 14:45:35 +08:00
hooks : CompilationHooksJavascriptModulesPlugin
) : Source ;
renderMain (
renderContext : MainRenderContext ,
2020-09-02 00:08:09 +08:00
hooks : CompilationHooksJavascriptModulesPlugin ,
compilation : Compilation
2020-04-21 14:45:35 +08:00
) : Source ;
2020-09-28 17:36:17 +08:00
updateHashWithBootstrap (
hash : Hash ,
renderContext : RenderBootstrapContext ,
hooks : CompilationHooksJavascriptModulesPlugin
) : void ;
2020-04-21 14:45:35 +08:00
renderBootstrap (
renderContext : RenderBootstrapContext ,
hooks : CompilationHooksJavascriptModulesPlugin
2020-12-11 21:32:42 +08:00
) : {
header : string [ ] ;
beforeStartup : string [ ] ;
startup : string [ ] ;
afterStartup : string [ ] ;
allowInlineStartup : boolean ;
} ;
2020-04-21 14:45:35 +08:00
renderRequire (
renderContext : RenderBootstrapContext ,
hooks : CompilationHooksJavascriptModulesPlugin
) : string ;
static getCompilationHooks (
compilation : Compilation
) : CompilationHooksJavascriptModulesPlugin ;
static getChunkFilenameTemplate ( chunk? : any , outputOptions? : any ) : any ;
static chunkHasJs : ( chunk : Chunk , chunkGraph : ChunkGraph ) = > boolean ;
}
2020-08-28 07:25:34 +08:00
declare class JavascriptParser extends Parser {
constructor ( sourceType ? : "module" | "script" | "auto" ) ;
2020-04-21 14:45:35 +08:00
hooks : Readonly < {
evaluateTypeof : HookMap <
2020-12-17 01:26:46 +08:00
SyncBailHook <
[ UnaryExpression ] ,
undefined | null | BasicEvaluatedExpression
>
> ;
evaluate : HookMap <
SyncBailHook < [ Expression ] , undefined | null | BasicEvaluatedExpression >
2020-04-21 14:45:35 +08:00
> ;
evaluateIdentifier : HookMap <
SyncBailHook <
2020-06-25 03:47:43 +08:00
[ ThisExpression | MemberExpression | MetaProperty | Identifier ] ,
2020-12-17 01:26:46 +08:00
undefined | null | BasicEvaluatedExpression
2020-04-21 14:45:35 +08:00
>
> ;
evaluateDefinedIdentifier : HookMap <
SyncBailHook <
[ ThisExpression | MemberExpression | Identifier ] ,
2020-12-17 01:26:46 +08:00
undefined | null | BasicEvaluatedExpression
2020-04-21 14:45:35 +08:00
>
> ;
evaluateCallExpressionMember : HookMap <
SyncBailHook <
2020-12-17 01:26:46 +08:00
[ CallExpression , undefined | BasicEvaluatedExpression ] ,
undefined | null | BasicEvaluatedExpression
2020-04-21 14:45:35 +08:00
>
> ;
2020-10-05 22:57:31 +08:00
isPure : HookMap <
SyncBailHook <
[
(
| UnaryExpression
| ThisExpression
| ArrayExpression
| ObjectExpression
| FunctionExpression
| ArrowFunctionExpression
| YieldExpression
| SimpleLiteral
| RegExpLiteral
| UpdateExpression
| BinaryExpression
| AssignmentExpression
| LogicalExpression
| MemberExpression
| ConditionalExpression
| SimpleCallExpression
| NewExpression
| SequenceExpression
| TemplateLiteral
| TaggedTemplateExpression
| ClassExpression
| MetaProperty
| Identifier
| AwaitExpression
| ImportExpression
| ChainExpression
| FunctionDeclaration
| VariableDeclaration
| ClassDeclaration
) ,
number
] ,
boolean | void
>
> ;
2020-04-21 14:45:35 +08:00
preStatement : SyncBailHook <
[
2020-10-05 22:57:31 +08:00
| FunctionDeclaration
| VariableDeclaration
| ClassDeclaration
2020-04-21 14:45:35 +08:00
| ExpressionStatement
| BlockStatement
| EmptyStatement
| DebuggerStatement
| WithStatement
| ReturnStatement
| LabeledStatement
| BreakStatement
| ContinueStatement
| IfStatement
| SwitchStatement
| ThrowStatement
| TryStatement
| WhileStatement
| DoWhileStatement
| ForStatement
| ForInStatement
| ForOfStatement
| ImportDeclaration
| ExportNamedDeclaration
| ExportDefaultDeclaration
| ExportAllDeclaration
] ,
boolean | void
> ;
blockPreStatement : SyncBailHook <
[
2020-10-05 22:57:31 +08:00
| FunctionDeclaration
| VariableDeclaration
| ClassDeclaration
2020-04-21 14:45:35 +08:00
| ExpressionStatement
| BlockStatement
| EmptyStatement
| DebuggerStatement
| WithStatement
| ReturnStatement
| LabeledStatement
| BreakStatement
| ContinueStatement
| IfStatement
| SwitchStatement
| ThrowStatement
| TryStatement
| WhileStatement
| DoWhileStatement
| ForStatement
| ForInStatement
| ForOfStatement
| ImportDeclaration
| ExportNamedDeclaration
| ExportDefaultDeclaration
| ExportAllDeclaration
] ,
boolean | void
> ;
statement : SyncBailHook <
[
2020-10-05 22:57:31 +08:00
| FunctionDeclaration
| VariableDeclaration
| ClassDeclaration
2020-04-21 14:45:35 +08:00
| ExpressionStatement
| BlockStatement
| EmptyStatement
| DebuggerStatement
| WithStatement
| ReturnStatement
| LabeledStatement
| BreakStatement
| ContinueStatement
| IfStatement
| SwitchStatement
| ThrowStatement
| TryStatement
| WhileStatement
| DoWhileStatement
| ForStatement
| ForInStatement
| ForOfStatement
| ImportDeclaration
| ExportNamedDeclaration
| ExportDefaultDeclaration
| ExportAllDeclaration
] ,
boolean | void
> ;
statementIf : SyncBailHook < [ IfStatement ] , boolean | void > ;
classExtendsExpression : SyncBailHook <
[ Expression , ClassExpression | ClassDeclaration ] ,
boolean | void
> ;
classBodyElement : SyncBailHook <
[ MethodDefinition , ClassExpression | ClassDeclaration ] ,
boolean | void
> ;
label : HookMap < SyncBailHook < [ LabeledStatement ] , boolean | void > > ;
2020-11-26 17:49:59 +08:00
import : SyncBailHook < [ Statement , ImportSource ] , boolean | void > ;
2020-04-21 14:45:35 +08:00
importSpecifier : SyncBailHook <
2020-11-26 17:49:59 +08:00
[ Statement , ImportSource , string , string ] ,
2020-04-21 14:45:35 +08:00
boolean | void
> ;
export : SyncBailHook < [ Statement ] , boolean | void > ;
2020-11-26 17:49:59 +08:00
exportImport : SyncBailHook < [ Statement , ImportSource ] , boolean | void > ;
2020-04-21 14:45:35 +08:00
exportDeclaration : SyncBailHook < [ Statement , Declaration ] , boolean | void > ;
exportExpression : SyncBailHook < [ Statement , Declaration ] , boolean | void > ;
exportSpecifier : SyncBailHook <
2020-12-17 01:26:46 +08:00
[ Statement , string , string , undefined | number ] ,
2020-04-21 14:45:35 +08:00
boolean | void
> ;
exportImportSpecifier : SyncBailHook <
2020-12-17 01:26:46 +08:00
[ Statement , ImportSource , string , string , undefined | number ] ,
2020-04-21 14:45:35 +08:00
boolean | void
> ;
preDeclarator : SyncBailHook <
[ VariableDeclarator , Statement ] ,
boolean | void
> ;
declarator : SyncBailHook < [ VariableDeclarator , Statement ] , boolean | void > ;
varDeclaration : HookMap < SyncBailHook < [ Declaration ] , boolean | void > > ;
varDeclarationLet : HookMap < SyncBailHook < [ Declaration ] , boolean | void > > ;
varDeclarationConst : HookMap < SyncBailHook < [ Declaration ] , boolean | void > > ;
varDeclarationVar : HookMap < SyncBailHook < [ Declaration ] , boolean | void > > ;
pattern : HookMap < SyncBailHook < any , any > > ;
canRename : HookMap < SyncBailHook < [ Expression ] , boolean | void > > ;
rename : HookMap < SyncBailHook < [ Expression ] , boolean | void > > ;
assign : HookMap < SyncBailHook < [ AssignmentExpression ] , boolean | void > > ;
assignMemberChain : HookMap <
2020-04-23 17:43:38 +08:00
SyncBailHook < [ AssignmentExpression , string [ ] ] , boolean | void >
2020-04-21 14:45:35 +08:00
> ;
typeof : HookMap < SyncBailHook < [ Expression ] , boolean | void > > ;
importCall : SyncBailHook < [ Expression ] , boolean | void > ;
topLevelAwait : SyncBailHook < [ Expression ] , boolean | void > ;
call : HookMap < SyncBailHook < [ Expression ] , boolean | void > > ;
callMemberChain : HookMap <
2020-08-18 03:32:47 +08:00
SyncBailHook < [ CallExpression , string [ ] ] , boolean | void >
2020-04-21 14:45:35 +08:00
> ;
memberChainOfCallMemberChain : HookMap <
SyncBailHook <
2020-04-23 17:43:38 +08:00
[ Expression , string [ ] , CallExpression , string [ ] ] ,
2020-04-21 14:45:35 +08:00
boolean | void
>
> ;
callMemberChainOfCallMemberChain : HookMap <
SyncBailHook <
2020-04-23 17:43:38 +08:00
[ Expression , string [ ] , CallExpression , string [ ] ] ,
2020-04-21 14:45:35 +08:00
boolean | void
>
> ;
2020-07-20 03:14:57 +08:00
optionalChaining : SyncBailHook < [ ChainExpression ] , boolean | void > ;
2020-09-08 00:02:14 +08:00
new : HookMap < SyncBailHook < [ NewExpression ] , boolean | void > > ;
2020-04-21 14:45:35 +08:00
expression : HookMap < SyncBailHook < [ Expression ] , boolean | void > > ;
expressionMemberChain : HookMap <
2020-04-23 17:43:38 +08:00
SyncBailHook < [ Expression , string [ ] ] , boolean | void >
2020-04-21 14:45:35 +08:00
> ;
2020-07-06 23:13:09 +08:00
unhandledExpressionMemberChain : HookMap <
SyncBailHook < [ Expression , string [ ] ] , boolean | void >
> ;
2020-04-21 14:45:35 +08:00
expressionConditionalOperator : SyncBailHook < [ Expression ] , boolean | void > ;
expressionLogicalOperator : SyncBailHook < [ Expression ] , boolean | void > ;
2020-04-23 17:43:38 +08:00
program : SyncBailHook < [ Program , Comment [ ] ] , boolean | void > ;
finish : SyncBailHook < [ Program , Comment [ ] ] , boolean | void > ;
2020-04-21 14:45:35 +08:00
} > ;
sourceType : "module" | "script" | "auto" ;
scope : ScopeInfo ;
2020-11-26 17:49:59 +08:00
state : ParserState ;
2020-04-21 14:45:35 +08:00
comments : any ;
semicolons : any ;
2020-08-18 03:32:47 +08:00
statementPath : (
| UnaryExpression
| ThisExpression
| ArrayExpression
| ObjectExpression
| FunctionExpression
| ArrowFunctionExpression
| YieldExpression
| SimpleLiteral
| RegExpLiteral
| UpdateExpression
| BinaryExpression
| AssignmentExpression
| LogicalExpression
| MemberExpression
| ConditionalExpression
| SimpleCallExpression
| NewExpression
| SequenceExpression
| TemplateLiteral
| TaggedTemplateExpression
| ClassExpression
| MetaProperty
| Identifier
| AwaitExpression
| ImportExpression
| ChainExpression
2020-10-05 22:57:31 +08:00
| FunctionDeclaration
| VariableDeclaration
| ClassDeclaration
2020-08-18 03:32:47 +08:00
| ExpressionStatement
| BlockStatement
| EmptyStatement
| DebuggerStatement
| WithStatement
| ReturnStatement
| LabeledStatement
| BreakStatement
| ContinueStatement
| IfStatement
| SwitchStatement
| ThrowStatement
| TryStatement
| WhileStatement
| DoWhileStatement
| ForStatement
| ForInStatement
| ForOfStatement
) [ ] ;
prevStatement : any ;
2020-04-21 14:45:35 +08:00
currentTagData : any ;
2020-12-17 01:26:46 +08:00
getRenameIdentifier ( expr? : any ) : undefined | string ;
2020-04-21 14:45:35 +08:00
walkClass ( classy : ClassExpression | ClassDeclaration ) : void ;
walkMethodDefinition ( methodDefinition? : any ) : void ;
preWalkStatements ( statements? : any ) : void ;
blockPreWalkStatements ( statements? : any ) : void ;
walkStatements ( statements? : any ) : void ;
preWalkStatement ( statement? : any ) : void ;
blockPreWalkStatement ( statement? : any ) : void ;
walkStatement ( statement? : any ) : void ;
2020-11-26 05:36:49 +08:00
/ * *
* Walks a statements that is nested within a parent statement
* and can potentially be a non - block statement .
* This enforces the nested statement to never be in ASI position .
* /
walkNestedStatement ( statement : Statement ) : void ;
2020-04-21 14:45:35 +08:00
preWalkBlockStatement ( statement? : any ) : void ;
walkBlockStatement ( statement? : any ) : void ;
walkExpressionStatement ( statement? : any ) : void ;
preWalkIfStatement ( statement? : any ) : void ;
walkIfStatement ( statement? : any ) : void ;
preWalkLabeledStatement ( statement? : any ) : void ;
walkLabeledStatement ( statement? : any ) : void ;
preWalkWithStatement ( statement? : any ) : void ;
walkWithStatement ( statement? : any ) : void ;
preWalkSwitchStatement ( statement? : any ) : void ;
walkSwitchStatement ( statement? : any ) : void ;
walkTerminatingStatement ( statement? : any ) : void ;
walkReturnStatement ( statement? : any ) : void ;
walkThrowStatement ( statement? : any ) : void ;
preWalkTryStatement ( statement? : any ) : void ;
walkTryStatement ( statement? : any ) : void ;
preWalkWhileStatement ( statement? : any ) : void ;
walkWhileStatement ( statement? : any ) : void ;
preWalkDoWhileStatement ( statement? : any ) : void ;
walkDoWhileStatement ( statement? : any ) : void ;
preWalkForStatement ( statement? : any ) : void ;
walkForStatement ( statement? : any ) : void ;
preWalkForInStatement ( statement? : any ) : void ;
walkForInStatement ( statement? : any ) : void ;
preWalkForOfStatement ( statement? : any ) : void ;
walkForOfStatement ( statement? : any ) : void ;
preWalkFunctionDeclaration ( statement? : any ) : void ;
walkFunctionDeclaration ( statement? : any ) : void ;
blockPreWalkImportDeclaration ( statement? : any ) : void ;
enterDeclaration ( declaration? : any , onIdent? : any ) : void ;
blockPreWalkExportNamedDeclaration ( statement? : any ) : void ;
walkExportNamedDeclaration ( statement? : any ) : void ;
blockPreWalkExportDefaultDeclaration ( statement? : any ) : void ;
walkExportDefaultDeclaration ( statement? : any ) : void ;
blockPreWalkExportAllDeclaration ( statement? : any ) : void ;
preWalkVariableDeclaration ( statement? : any ) : void ;
blockPreWalkVariableDeclaration ( statement? : any ) : void ;
walkVariableDeclaration ( statement? : any ) : void ;
blockPreWalkClassDeclaration ( statement? : any ) : void ;
walkClassDeclaration ( statement? : any ) : void ;
preWalkSwitchCases ( switchCases? : any ) : void ;
walkSwitchCases ( switchCases? : any ) : void ;
preWalkCatchClause ( catchClause? : any ) : void ;
walkCatchClause ( catchClause? : any ) : void ;
walkPattern ( pattern? : any ) : void ;
walkAssignmentPattern ( pattern? : any ) : void ;
walkObjectPattern ( pattern? : any ) : void ;
walkArrayPattern ( pattern? : any ) : void ;
walkRestElement ( pattern? : any ) : void ;
walkExpressions ( expressions? : any ) : void ;
walkExpression ( expression? : any ) : void ;
walkAwaitExpression ( expression? : any ) : void ;
walkArrayExpression ( expression? : any ) : void ;
walkSpreadElement ( expression? : any ) : void ;
walkObjectExpression ( expression? : any ) : void ;
walkFunctionExpression ( expression? : any ) : void ;
walkArrowFunctionExpression ( expression? : any ) : void ;
2020-08-18 03:32:47 +08:00
walkSequenceExpression ( expression : SequenceExpression ) : void ;
2020-04-21 14:45:35 +08:00
walkUpdateExpression ( expression? : any ) : void ;
walkUnaryExpression ( expression? : any ) : void ;
walkLeftRightExpression ( expression? : any ) : void ;
walkBinaryExpression ( expression? : any ) : void ;
walkLogicalExpression ( expression? : any ) : void ;
walkAssignmentExpression ( expression? : any ) : void ;
walkConditionalExpression ( expression? : any ) : void ;
2020-11-26 17:49:59 +08:00
walkNewExpression ( expression? : any ) : void ;
2020-04-21 14:45:35 +08:00
walkYieldExpression ( expression? : any ) : void ;
walkTemplateLiteral ( expression? : any ) : void ;
walkTaggedTemplateExpression ( expression? : any ) : void ;
walkClassExpression ( expression? : any ) : void ;
2020-07-23 20:38:40 +08:00
walkChainExpression ( expression : ChainExpression ) : void ;
2020-04-21 14:45:35 +08:00
walkImportExpression ( expression? : any ) : void ;
2020-11-26 17:49:59 +08:00
walkCallExpression ( expression? : any ) : void ;
2020-04-21 14:45:35 +08:00
walkMemberExpression ( expression? : any ) : void ;
walkMemberExpressionWithExpressionName (
expression? : any ,
name? : any ,
rootInfo? : any ,
2020-06-25 03:47:43 +08:00
members? : any ,
2020-07-06 23:13:09 +08:00
onUnhandled? : any
2020-04-21 14:45:35 +08:00
) : void ;
walkThisExpression ( expression? : any ) : void ;
walkIdentifier ( expression? : any ) : void ;
2020-07-06 23:13:09 +08:00
walkMetaProperty ( metaProperty : MetaProperty ) : void ;
2020-04-23 17:43:38 +08:00
callHooksForExpression ( hookMap : any , expr : any , . . . args : any [ ] ) : any ;
2020-04-21 14:45:35 +08:00
callHooksForExpressionWithFallback < T , R > (
hookMap : HookMap < SyncBailHook < T , R > > ,
expr : MemberExpression ,
fallback : (
arg0 : string ,
2020-11-26 17:49:59 +08:00
arg1 : ExportedVariableInfo ,
2020-04-23 17:43:38 +08:00
arg2 : ( ) = > string [ ]
2020-04-21 14:45:35 +08:00
) = > any ,
defined : ( arg0 : string ) = > any ,
. . . args : AsArray < T >
) : R ;
callHooksForName < T , R > (
hookMap : HookMap < SyncBailHook < T , R > > ,
name : string ,
. . . args : AsArray < T >
) : R ;
callHooksForInfo < T , R > (
hookMap : HookMap < SyncBailHook < T , R > > ,
2020-11-26 17:49:59 +08:00
info : ExportedVariableInfo ,
2020-04-21 14:45:35 +08:00
. . . args : AsArray < T >
) : R ;
callHooksForInfoWithFallback < T , R > (
hookMap : HookMap < SyncBailHook < T , R > > ,
2020-11-26 17:49:59 +08:00
info : ExportedVariableInfo ,
2020-04-21 14:45:35 +08:00
fallback : ( arg0 : string ) = > any ,
defined : ( ) = > any ,
. . . args : AsArray < T >
) : R ;
callHooksForNameWithFallback < T , R > (
hookMap : HookMap < SyncBailHook < T , R > > ,
name : string ,
fallback : ( arg0 : string ) = > any ,
defined : ( ) = > any ,
. . . args : AsArray < T >
) : R ;
inScope ( params : any , fn : ( ) = > void ) : void ;
inFunctionScope ( hasThis? : any , params? : any , fn? : any ) : void ;
inBlockScope ( fn? : any ) : void ;
detectMode ( statements? : any ) : void ;
enterPatterns ( patterns? : any , onIdent? : any ) : void ;
enterPattern ( pattern? : any , onIdent? : any ) : void ;
enterIdentifier ( pattern? : any , onIdent? : any ) : void ;
enterObjectPattern ( pattern? : any , onIdent? : any ) : void ;
enterArrayPattern ( pattern? : any , onIdent? : any ) : void ;
enterRestElement ( pattern? : any , onIdent? : any ) : void ;
enterAssignmentPattern ( pattern? : any , onIdent? : any ) : void ;
2020-12-17 01:26:46 +08:00
evaluateExpression (
expression : Expression
) : undefined | BasicEvaluatedExpression ;
2020-04-21 14:45:35 +08:00
parseString ( expression? : any ) : any ;
parseCalculatedString ( expression? : any ) : any ;
2020-12-17 01:26:46 +08:00
evaluate ( source? : any ) : undefined | BasicEvaluatedExpression ;
2020-10-05 22:57:31 +08:00
isPure (
expr :
2020-12-17 01:26:46 +08:00
| undefined
| null
2020-10-05 22:57:31 +08:00
| UnaryExpression
| ThisExpression
| ArrayExpression
| ObjectExpression
| FunctionExpression
| ArrowFunctionExpression
| YieldExpression
| SimpleLiteral
| RegExpLiteral
| UpdateExpression
| BinaryExpression
| AssignmentExpression
| LogicalExpression
| MemberExpression
| ConditionalExpression
| SimpleCallExpression
| NewExpression
| SequenceExpression
| TemplateLiteral
| TaggedTemplateExpression
| ClassExpression
| MetaProperty
| Identifier
| AwaitExpression
| ImportExpression
| ChainExpression
| FunctionDeclaration
| VariableDeclaration
| ClassDeclaration ,
2020-11-26 17:49:59 +08:00
commentsStartPos : number
2020-10-05 22:57:31 +08:00
) : boolean ;
2020-04-21 14:45:35 +08:00
getComments ( range? : any ) : any ;
2020-09-01 17:06:14 +08:00
isAsiPosition ( pos : number ) : boolean ;
2020-11-03 22:35:43 +08:00
unsetAsiPosition ( pos : number ) : void ;
2020-08-18 03:32:47 +08:00
isStatementLevelExpression ( expr? : any ) : boolean ;
2020-04-21 14:45:35 +08:00
getTagData ( name? : any , tag? : any ) : any ;
tagVariable ( name? : any , tag? : any , data? : any ) : void ;
defineVariable ( name? : any ) : void ;
undefineVariable ( name? : any ) : void ;
isVariableDefined ( name? : any ) : boolean ;
2020-11-26 17:49:59 +08:00
getVariableInfo ( name : string ) : ExportedVariableInfo ;
setVariable ( name : string , variableInfo : ExportedVariableInfo ) : void ;
2020-12-17 01:26:46 +08:00
parseCommentOptions (
range? : any
2020-12-18 20:52:15 +08:00
) : { options : null ; errors : null } | { options : object ; errors : any [ ] } ;
2020-04-21 14:45:35 +08:00
extractMemberExpressionChain (
expression : MemberExpression
) : {
2020-04-23 17:43:38 +08:00
members : string [ ] ;
2020-04-21 14:45:35 +08:00
object :
| UnaryExpression
| ThisExpression
| ArrayExpression
| ObjectExpression
| FunctionExpression
| ArrowFunctionExpression
| YieldExpression
| SimpleLiteral
| RegExpLiteral
| UpdateExpression
| BinaryExpression
| AssignmentExpression
| LogicalExpression
| MemberExpression
| ConditionalExpression
| SimpleCallExpression
| NewExpression
| SequenceExpression
| TemplateLiteral
| TaggedTemplateExpression
| ClassExpression
| MetaProperty
| Identifier
| AwaitExpression
2020-07-03 17:34:54 +08:00
| ImportExpression
| ChainExpression
2020-04-21 14:45:35 +08:00
| Super ;
} ;
getFreeInfoFromVariable (
varName : string
) : { name : string ; info : string | VariableInfo } ;
getMemberExpressionInfo (
expression : MemberExpression ,
2020-08-25 03:00:08 +08:00
allowedTypes : number
2020-12-17 01:26:46 +08:00
) : undefined | CallExpressionInfo | ExpressionExpressionInfo ;
2020-04-21 14:45:35 +08:00
getNameForExpression (
expression : MemberExpression
) : {
name : string ;
2020-11-26 17:49:59 +08:00
rootInfo : ExportedVariableInfo ;
2020-04-23 17:43:38 +08:00
getMembers : ( ) = > string [ ] ;
2020-04-21 14:45:35 +08:00
} ;
2020-11-26 17:49:59 +08:00
static ALLOWED_MEMBER_TYPES_ALL : 3 ;
static ALLOWED_MEMBER_TYPES_EXPRESSION : 2 ;
static ALLOWED_MEMBER_TYPES_CALL_EXPRESSION : 1 ;
2020-04-21 14:45:35 +08:00
}
2020-08-25 19:20:29 +08:00
declare class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
constructor ( runtimeRequirements? : any ) ;
static getCompilationHooks (
compilation : Compilation
) : JsonpCompilationPluginHooks ;
2020-12-11 21:32:42 +08:00
/ * *
* Runtime module s without any dependencies to other runtime module s
* /
static STAGE_NORMAL : number ;
/ * *
* Runtime module s with simple dependencies on other runtime module s
* /
static STAGE_BASIC : number ;
/ * *
* Runtime module s which attach to handlers of other runtime module s
* /
static STAGE_ATTACH : number ;
/ * *
* Runtime module s which trigger actions on bootstrap
* /
static STAGE_TRIGGER : number ;
2020-04-21 14:45:35 +08:00
}
declare interface JsonpCompilationPluginHooks {
2020-08-25 19:20:29 +08:00
linkPreload : SyncWaterfallHook < [ string , Chunk ] > ;
linkPrefetch : SyncWaterfallHook < [ string , Chunk ] > ;
2020-04-21 14:45:35 +08:00
}
declare class JsonpTemplatePlugin {
constructor ( ) ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
static getCompilationHooks (
compilation : Compilation
) : JsonpCompilationPluginHooks ;
}
2020-12-17 17:07:29 +08:00
declare interface KnownAssetInfo {
/ * *
* true , if the asset can be long term cached forever ( contains a hash )
* /
immutable? : boolean ;
/ * *
* whether the asset is minimized
* /
minimized? : boolean ;
/ * *
* the value ( s ) of the full hash used for this asset
* /
fullhash? : string | string [ ] ;
/ * *
* the value ( s ) of the chunk hash used for this asset
* /
chunkhash? : string | string [ ] ;
/ * *
* the value ( s ) of the module hash used for this asset
* /
module hash? : string | string [ ] ;
/ * *
* the value ( s ) of the content hash used for this asset
* /
contenthash? : string | string [ ] ;
/ * *
* when asset was created from a source file ( potentially transformed ) , the original filename relative to compilation context
* /
sourceFilename? : string ;
/ * *
* size in bytes , only set after asset has been emitted
* /
size? : number ;
/ * *
* true , when asset is only used for development and doesn ' t count towards user - facing assets
* /
development? : boolean ;
/ * *
* true , when asset ships data for updating an existing application ( HMR )
* /
hotModuleReplacement? : boolean ;
/ * *
* true , when asset is javascript and an ESM
* /
javascriptModule? : boolean ;
/ * *
* object of pointers to other assets , keyed by type of relation ( only points from parent to child )
* /
related? : Record < string , EntryItem > ;
}
2020-04-21 14:45:35 +08:00
declare interface KnownBuildMeta {
module Argument? : string ;
exportsArgument? : string ;
strict? : boolean ;
module ConcatenationBailout? : string ;
2020-08-18 03:32:47 +08:00
exportsType ? : "namespace" | "dynamic" | "default" | "flagged" ;
2020-07-08 16:58:20 +08:00
defaultObject? : false | "redirect" | "redirect-warn" ;
2020-04-21 14:45:35 +08:00
strictHarmonyModule? : boolean ;
async ? : boolean ;
2020-10-05 22:57:31 +08:00
sideEffectFree? : boolean ;
2020-04-21 14:45:35 +08:00
}
2020-12-18 01:51:55 +08:00
declare interface KnownCreateStatsOptionsContext {
forToString? : boolean ;
}
declare interface KnownNormalizedStatsOptions {
context : string ;
requestShortener : RequestShortener ;
chunksSort : string ;
module sSort : string ;
chunkModulesSort : string ;
nestedModulesSort : string ;
assetsSort : string ;
ids : boolean ;
cachedAssets : boolean ;
groupAssetsByEmitStatus : boolean ;
groupAssetsByPath : boolean ;
groupAssetsByExtension : boolean ;
assetsSpace : number ;
excludeAssets : Function [ ] ;
excludeModules : Function [ ] ;
warningsFilter : Function [ ] ;
cachedModules : boolean ;
orphanModules : boolean ;
dependentModules : boolean ;
runtimeModules : boolean ;
groupModulesByCacheStatus : boolean ;
groupModulesByAttributes : boolean ;
groupModulesByPath : boolean ;
groupModulesByExtension : boolean ;
groupModulesByType : boolean ;
entrypoints : boolean | "auto" ;
chunkGroups : boolean ;
chunkGroupAuxiliary : boolean ;
chunkGroupChildren : boolean ;
chunkGroupMaxAssets : number ;
module sSpace : number ;
chunkModulesSpace : number ;
nestedModulesSpace : number ;
logging : false | "none" | "verbose" | "error" | "warn" | "info" | "log" ;
loggingDebug : Function [ ] ;
loggingTrace : boolean ;
}
declare interface KnownStatsFactoryContext {
type : string ;
makePathsRelative ? : ( arg0 : string ) = > string ;
compilation? : Compilation ;
rootModules? : Set < Module > ;
compilationFileToChunks? : Map < string , Chunk [ ] > ;
compilationAuxiliaryFileToChunks? : Map < string , Chunk [ ] > ;
runtime? : RuntimeSpec ;
cachedGetErrors ? : ( arg0 : Compilation ) = > WebpackError [ ] ;
cachedGetWarnings ? : ( arg0 : Compilation ) = > WebpackError [ ] ;
}
declare interface KnownStatsPrinterContext {
type ? : string ;
compilation? : Object ;
chunkGroup? : Object ;
asset? : Object ;
module ? : Object ;
chunk? : Object ;
module Reason? : Object ;
bold ? : ( str : string ) = > string ;
yellow ? : ( str : string ) = > string ;
red ? : ( str : string ) = > string ;
green ? : ( str : string ) = > string ;
magenta ? : ( str : string ) = > string ;
cyan ? : ( str : string ) = > string ;
formatFilename ? : ( file : string , oversize? : boolean ) = > string ;
formatModuleId ? : ( id : string ) = > string ;
formatChunkId ? : (
id : string ,
direction ? : "parent" | "child" | "sibling"
) = > string ;
formatSize ? : ( size : number ) = > string ;
formatDateTime ? : ( dateTime : number ) = > string ;
formatFlag ? : ( flag : string ) = > string ;
formatTime ? : ( time : number , boldQuantity? : boolean ) = > string ;
chunkGroupKind? : string ;
}
2020-04-21 14:45:35 +08:00
declare abstract class LazySet < T > {
readonly size : number ;
add ( item : T ) : LazySet < T > ;
addAll ( iterable : LazySet < T > | Iterable < T > ) : LazySet < T > ;
clear ( ) : void ;
delete ( value : T ) : boolean ;
entries ( ) : IterableIterator < [ T , T ] > ;
forEach (
callbackFn : ( arg0 : T , arg1 : T , arg2 : Set < T > ) = > void ,
thisArg? : any
) : void ;
has ( item : T ) : boolean ;
keys ( ) : IterableIterator < T > ;
values ( ) : IterableIterator < T > ;
[ Symbol . iterator ] ( ) : IterableIterator < T > ;
readonly [ Symbol . toStringTag ] : string ;
serialize ( __0 : { write : any } ) : void ;
}
declare interface LibIdentOptions {
/ * *
* absolute context path to which lib ident is relative to
* /
context : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* object for caching
2020-03-21 21:01:38 +08:00
* /
2020-12-17 01:26:46 +08:00
associatedObjectForCache? : Object ;
2020-04-21 14:45:35 +08:00
}
declare class LibManifestPlugin {
constructor ( options? : any ) ;
options : any ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare interface LibraryContext < T > {
compilation : Compilation ;
options : T ;
}
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Set explicit comments for ` commonjs ` , ` commonjs2 ` , ` amd ` , and ` root ` .
* /
declare interface LibraryCustomUmdCommentObject {
/ * *
* Set comment for ` amd ` section in UMD .
* /
amd? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Set comment for ` commonjs ` ( exports ) section in UMD .
* /
commonjs? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Set comment for ` commonjs2 ` ( module .exports ) section in UMD .
* /
commonjs2? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Set comment for ` root ` ( global variable ) section in UMD .
* /
root? : string ;
}
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Description object for all UMD variants of the library name .
* /
declare interface LibraryCustomUmdObject {
/ * *
* Name of the exposed AMD library in the UMD .
* /
amd? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Name of the exposed commonjs export in the UMD .
* /
commonjs? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Name of the property exposed globally by a UMD library .
* /
2020-12-17 01:26:46 +08:00
root? : string | string [ ] ;
2020-04-21 14:45:35 +08:00
}
2020-04-23 17:43:38 +08:00
type LibraryName = string | string [ ] | LibraryCustomUmdObject ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options for library .
* /
declare interface LibraryOptions {
/ * *
* Add a comment in the UMD wrapper .
* /
2020-12-17 01:26:46 +08:00
auxiliaryComment? : string | LibraryCustomUmdCommentObject ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Specify which export should be exposed as library .
* /
2020-12-17 01:26:46 +08:00
export ? : string | string [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The name of the library ( some types allow unnamed libraries too ) .
* /
2020-12-17 01:26:46 +08:00
name? : string | string [ ] | LibraryCustomUmdObject ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
2020-08-26 03:45:56 +08:00
* Type of library ( types included by default are 'var' , 'module' , 'assign' , 'this' , 'window' , 'self' , 'global' , 'commonjs' , 'commonjs2' , 'commonjs-module' , 'amd' , 'amd-require' , 'umd' , 'umd2' , 'jsonp' , 'system' , but others might be added by plugins ) .
2020-04-21 14:45:35 +08:00
* /
2020-08-26 03:45:56 +08:00
type : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* If ` output.libraryTarget ` is set to umd and ` output.library ` is set , setting this to true will name the AMD module .
* /
umdNamedDefine? : boolean ;
}
declare class LibraryTemplatePlugin {
constructor (
name : LibraryName ,
2020-08-26 03:45:56 +08:00
target : string ,
2020-04-21 14:45:35 +08:00
umdNamedDefine : boolean ,
auxiliaryComment : AuxiliaryComment ,
2020-10-29 03:51:08 +08:00
exportProperty : EntryItem
2020-04-21 14:45:35 +08:00
) ;
library : {
2020-08-26 03:45:56 +08:00
type : string ;
2020-04-21 14:45:35 +08:00
name : LibraryName ;
umdNamedDefine : boolean ;
auxiliaryComment : AuxiliaryComment ;
2020-10-29 03:51:08 +08:00
export : EntryItem ;
2020-04-21 14:45:35 +08:00
} ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare class LimitChunkCountPlugin {
constructor ( options? : LimitChunkCountPluginOptions ) ;
2020-12-17 01:26:46 +08:00
options? : LimitChunkCountPluginOptions ;
2020-04-21 14:45:35 +08:00
apply ( compiler : Compiler ) : void ;
}
declare interface LimitChunkCountPluginOptions {
/ * *
* Constant overhead for a chunk .
* /
chunkOverhead? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Multiplicator for initial chunks .
* /
entryChunkMultiplicator? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Limit the maximum number of chunks using a value greater greater than or equal to 1 .
* /
maxChunks : number ;
}
2020-08-19 21:05:49 +08:00
declare interface LoadScriptCompilationHooks {
createScript : SyncWaterfallHook < [ string , Chunk ] > ;
}
declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
constructor ( ) ;
static getCompilationHooks (
compilation : Compilation
) : LoadScriptCompilationHooks ;
2020-12-11 21:32:42 +08:00
/ * *
* Runtime module s without any dependencies to other runtime module s
* /
static STAGE_NORMAL : number ;
/ * *
* Runtime module s with simple dependencies on other runtime module s
* /
static STAGE_BASIC : number ;
/ * *
* Runtime module s which attach to handlers of other runtime module s
* /
static STAGE_ATTACH : number ;
/ * *
* Runtime module s which trigger actions on bootstrap
* /
static STAGE_TRIGGER : number ;
2020-08-19 21:05:49 +08:00
}
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Custom values available in the loader context .
* /
declare interface Loader {
[ index : string ] : any ;
}
declare interface LoaderItem {
loader : string ;
options : any ;
2020-12-17 01:26:46 +08:00
ident : null | string ;
type : null | string ;
2020-04-21 14:45:35 +08:00
}
declare class LoaderOptionsPlugin {
constructor ( options? : LoaderOptionsPluginOptions ) ;
options : LoaderOptionsPluginOptions ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare interface LoaderOptionsPluginOptions {
[ index : string ] : any ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Whether loaders should be in debug mode or not . debug will be removed as of webpack 3 .
* /
debug? : boolean ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Where loaders can be switched to minimize mode .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
minimize? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* A configuration object that can be used to configure older loaders .
* /
options ? : {
[ index : string ] : any ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* The context that can be used to configure older loaders .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
context? : string ;
} ;
}
declare class LoaderTargetPlugin {
constructor ( target : string ) ;
target : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare interface LogEntry {
type : string ;
2020-04-23 17:43:38 +08:00
args : any [ ] ;
2020-04-21 14:45:35 +08:00
time : number ;
2020-04-23 17:43:38 +08:00
trace? : string [ ] ;
2020-04-21 14:45:35 +08:00
}
declare const MEASURE_END_OPERATION : unique symbol ;
declare const MEASURE_START_OPERATION : unique symbol ;
declare interface MainRenderContext {
/ * *
* the chunk
* /
chunk : Chunk ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* the dependency templates
* /
dependencyTemplates : DependencyTemplates ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the runtime template
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
runtimeTemplate : RuntimeTemplate ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* the module graph
* /
module Graph : ModuleGraph ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the chunk graph
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
chunkGraph : ChunkGraph ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* results of code generation
2020-03-21 21:01:38 +08:00
* /
2020-07-28 00:09:48 +08:00
codeGenerationResults : CodeGenerationResults ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* hash to be used for render call
* /
hash : string ;
}
declare abstract class MainTemplate {
hooks : Readonly < {
renderManifest : { tap : ( options? : any , fn? : any ) = > void } ;
module s : { tap : ( ) = > never } ;
module Obj : { tap : ( ) = > never } ;
require : { tap : ( options? : any , fn? : any ) = > void } ;
beforeStartup : { tap : ( ) = > never } ;
startup : { tap : ( ) = > never } ;
afterStartup : { tap : ( ) = > never } ;
render : { tap : ( options? : any , fn? : any ) = > void } ;
renderWithEntry : { tap : ( options? : any , fn? : any ) = > void } ;
assetPath : {
tap : ( options? : any , fn? : any ) = > void ;
call : ( filename? : any , options? : any ) = > string ;
} ;
hash : { tap : ( options? : any , fn? : any ) = > void } ;
hashForChunk : { tap : ( options? : any , fn? : any ) = > void } ;
globalHashPaths : { tap : ( ) = > void } ;
globalHash : { tap : ( ) = > void } ;
hotBootstrap : { tap : ( ) = > never } ;
bootstrap : SyncWaterfallHook <
[ string , Chunk , string , ModuleTemplate , DependencyTemplates ]
> ;
localVars : SyncWaterfallHook < [ string , Chunk , string ] > ;
requireExtensions : SyncWaterfallHook < [ string , Chunk , string ] > ;
requireEnsure : SyncWaterfallHook < [ string , Chunk , string , string ] > ;
2020-08-19 21:05:49 +08:00
readonly jsonpScript : SyncWaterfallHook < [ string , Chunk ] > ;
2020-08-25 19:20:29 +08:00
readonly linkPrefetch : SyncWaterfallHook < [ string , Chunk ] > ;
readonly linkPreload : SyncWaterfallHook < [ string , Chunk ] > ;
2020-04-21 14:45:35 +08:00
} > ;
renderCurrentHashCode : ( hash : string , length? : number ) = > string ;
2020-12-18 20:52:15 +08:00
getPublicPath : ( options : object ) = > string ;
2020-04-21 14:45:35 +08:00
getAssetPath : ( path? : any , options? : any ) = > string ;
getAssetPathWithInfo : (
path? : any ,
options? : any
) = > { path : string ; info : AssetInfo } ;
2020-12-17 01:26:46 +08:00
readonly requireFn : "__webpack_require__" ;
2020-08-03 02:09:36 +08:00
readonly outputOptions : Output ;
2020-04-21 14:45:35 +08:00
}
declare interface MapOptions {
columns? : boolean ;
module ? : boolean ;
}
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options object for in - memory caching .
* /
declare interface MemoryCacheOptions {
/ * *
* In memory caching .
* /
type : "memory" ;
}
declare class MemoryCachePlugin {
constructor ( ) ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare class MinChunkSizePlugin {
constructor ( options : MinChunkSizePluginOptions ) ;
options : MinChunkSizePluginOptions ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare interface MinChunkSizePluginOptions {
/ * *
* Constant overhead for a chunk .
* /
chunkOverhead? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Multiplicator for initial chunks .
* /
entryChunkMultiplicator? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Minimum number of characters .
* /
minChunkSize : number ;
}
declare class Module extends DependenciesBlock {
constructor ( type : string , context? : string ) ;
type : string ;
context : string ;
needId : boolean ;
debugId : number ;
2020-08-03 02:09:36 +08:00
resolveOptions : ResolveOptionsWebpackOptions ;
2020-12-18 20:52:15 +08:00
factoryMeta? : object ;
2020-10-26 21:41:46 +08:00
useSourceMap : boolean ;
useSimpleSourceMap : boolean ;
2020-11-26 17:49:59 +08:00
buildMeta : BuildMeta ;
2020-12-17 01:26:46 +08:00
buildInfo : Record < string , any > ;
presentationalDependencies? : Dependency [ ] ;
2020-04-21 14:45:35 +08:00
id : string | number ;
readonly hash : string ;
readonly renderedHash : string ;
2020-12-17 01:26:46 +08:00
profile : null | ModuleProfile ;
2020-04-21 14:45:35 +08:00
index : number ;
index2 : number ;
depth : number ;
2020-12-17 01:26:46 +08:00
issuer : null | Module ;
readonly usedExports : null | boolean | SortableSet < string > ;
2020-04-23 17:43:38 +08:00
readonly optimizationBailout : (
| string
| ( ( requestShortener : RequestShortener ) = > string )
) [ ] ;
2020-04-21 14:45:35 +08:00
readonly optional : boolean ;
addChunk ( chunk? : any ) : boolean ;
removeChunk ( chunk? : any ) : void ;
isInChunk ( chunk? : any ) : boolean ;
isEntryModule ( ) : boolean ;
2020-04-23 17:43:38 +08:00
getChunks ( ) : Chunk [ ] ;
2020-04-21 14:45:35 +08:00
getNumberOfChunks ( ) : number ;
readonly chunksIterable : Iterable < Chunk > ;
2020-12-17 01:26:46 +08:00
isProvided ( exportName : string ) : null | boolean ;
2020-04-21 14:45:35 +08:00
readonly exportsArgument : string ;
readonly module Argument : string ;
getExportsType (
2020-08-18 03:32:47 +08:00
module Graph : ModuleGraph ,
2020-04-21 14:45:35 +08:00
strict : boolean
2020-04-23 02:31:26 +08:00
) : "namespace" | "default-only" | "default-with-named" | "dynamic" ;
2020-04-21 14:45:35 +08:00
addPresentationalDependency ( presentationalDependency : Dependency ) : void ;
addWarning ( warning : WebpackError ) : void ;
2020-12-17 01:26:46 +08:00
getWarnings ( ) : undefined | Iterable < WebpackError > ;
2020-07-07 22:38:57 +08:00
getNumberOfWarnings ( ) : number ;
2020-04-21 14:45:35 +08:00
addError ( error : WebpackError ) : void ;
2020-12-17 01:26:46 +08:00
getErrors ( ) : undefined | Iterable < WebpackError > ;
2020-07-07 22:38:57 +08:00
getNumberOfErrors ( ) : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* removes all warnings and errors
* /
clearWarningsAndErrors ( ) : void ;
isOptional ( module Graph : ModuleGraph ) : boolean ;
isAccessibleInChunk (
chunkGraph : ChunkGraph ,
chunk : Chunk ,
ignoreChunk? : Chunk
) : boolean ;
isAccessibleInChunkGroup (
chunkGraph : ChunkGraph ,
chunkGroup : ChunkGroup ,
ignoreChunk? : Chunk
) : boolean ;
hasReasonForChunk (
chunk : Chunk ,
module Graph : ModuleGraph ,
chunkGraph : ChunkGraph
) : boolean ;
2020-11-26 17:49:59 +08:00
hasReasons ( module Graph : ModuleGraph , runtime : RuntimeSpec ) : boolean ;
2020-04-21 14:45:35 +08:00
needBuild (
context : NeedBuildContext ,
2020-12-17 01:26:46 +08:00
callback : ( arg0? : WebpackError , arg1? : boolean ) = > void
2020-04-21 14:45:35 +08:00
) : void ;
2020-08-03 02:09:36 +08:00
needRebuild (
2020-12-17 01:26:46 +08:00
fileTimestamps : Map < string , null | number > ,
contextTimestamps : Map < string , null | number >
2020-08-03 02:09:36 +08:00
) : boolean ;
2020-04-21 14:45:35 +08:00
invalidateBuild ( ) : void ;
identifier ( ) : string ;
readableIdentifier ( requestShortener : RequestShortener ) : string ;
build (
options : WebpackOptionsNormalized ,
compilation : Compilation ,
2020-11-26 17:49:59 +08:00
resolver : ResolverWithOptions ,
2020-04-21 14:45:35 +08:00
fs : InputFileSystem ,
2020-12-17 01:26:46 +08:00
callback : ( arg0? : WebpackError ) = > void
2020-04-21 14:45:35 +08:00
) : void ;
getSourceTypes ( ) : Set < string > ;
2020-07-02 23:02:48 +08:00
source (
dependencyTemplates : DependencyTemplates ,
runtimeTemplate : RuntimeTemplate ,
type ? : string
) : Source ;
2020-04-21 14:45:35 +08:00
size ( type ? : string ) : number ;
2020-12-17 01:26:46 +08:00
libIdent ( options : LibIdentOptions ) : null | string ;
nameForCondition ( ) : null | string ;
2020-09-15 16:07:04 +08:00
getConcatenationBailoutReason (
context : ConcatenationBailoutReasonContext
2020-12-17 01:26:46 +08:00
) : undefined | string ;
2020-11-26 17:49:59 +08:00
getSideEffectsConnectionState ( module Graph : ModuleGraph ) : ConnectionState ;
2020-04-21 14:45:35 +08:00
codeGeneration ( context : CodeGenerationContext ) : CodeGenerationResult ;
chunkCondition ( chunk : Chunk , compilation : Compilation ) : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Assuming this module is in the cache . Update the ( cached ) module with
* the fresh module from the factory . Usually updates internal references
* and properties .
* /
updateCacheModule ( module : Module ) : void ;
2020-12-17 01:26:46 +08:00
originalSource ( ) : null | Source ;
2020-08-23 03:54:34 +08:00
addCacheDependencies (
fileDependencies : LazySet < string > ,
contextDependencies : LazySet < string > ,
missingDependencies : LazySet < string > ,
buildDependencies : LazySet < string >
) : void ;
2020-04-21 14:45:35 +08:00
readonly hasEqualsChunks : any ;
readonly isUsed : any ;
readonly errors : any ;
readonly warnings : any ;
used : any ;
}
declare class ModuleConcatenationPlugin {
constructor ( options? : any ) ;
options : any ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare abstract class ModuleDependency extends Dependency {
request : string ;
userRequest : string ;
range : any ;
}
declare abstract class ModuleFactory {
create (
data : ModuleFactoryCreateData ,
2020-12-17 01:26:46 +08:00
callback : ( arg0? : Error , arg1? : ModuleFactoryResult ) = > void
2020-04-21 14:45:35 +08:00
) : void ;
}
declare interface ModuleFactoryCreateData {
contextInfo : ModuleFactoryCreateDataContextInfo ;
2020-07-17 16:27:48 +08:00
resolveOptions? : ResolveOptionsWebpackOptions ;
2020-04-21 14:45:35 +08:00
context : string ;
2020-04-23 17:43:38 +08:00
dependencies : Dependency [ ] ;
2020-04-21 14:45:35 +08:00
}
declare interface ModuleFactoryCreateDataContextInfo {
issuer : string ;
compiler : string ;
}
declare interface ModuleFactoryResult {
/ * *
* the created module or unset if no module was created
* /
module ? : Module ;
fileDependencies? : Set < string > ;
contextDependencies? : Set < string > ;
missingDependencies? : Set < string > ;
}
2020-04-22 18:09:11 +08:00
declare class ModuleFederationPlugin {
2020-04-30 19:39:58 +08:00
constructor ( options : ModuleFederationPluginOptions ) ;
/ * *
* Apply the plugin
* /
2020-04-22 18:09:11 +08:00
apply ( compiler : Compiler ) : void ;
}
2020-04-30 19:39:58 +08:00
declare interface ModuleFederationPluginOptions {
/ * *
* 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 .
* /
2020-12-17 01:26:46 +08:00
exposes ? : ( string | ExposesObject ) [ ] | ExposesObject ;
2020-04-30 19:39:58 +08:00
/ * *
* The filename of the container as relative path inside the ` output.path ` directory .
* /
filename? : string ;
/ * *
* Options for library .
* /
library? : LibraryOptions ;
/ * *
* The name of the container .
* /
name? : string ;
/ * *
* The external type of the remote containers .
* /
2020-12-17 01:26:46 +08:00
remoteType ? :
| "var"
| "module"
| "assign"
| "this"
| "window"
| "self"
| "global"
| "commonjs"
| "commonjs2"
| "commonjs-module"
| "amd"
| "amd-require"
| "umd"
| "umd2"
| "jsonp"
| "system"
| "promise"
| "import"
| "script" ;
2020-04-30 19:39:58 +08:00
/ * *
* Container locations and request scopes from which module s 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 .
* /
2020-12-17 01:26:46 +08:00
remotes ? : ( string | RemotesObject ) [ ] | RemotesObject ;
2020-04-30 19:39:58 +08:00
/ * *
2020-05-26 23:11:21 +08:00
* Share scope name used for all shared module s ( defaults to 'default' ) .
* /
shareScope? : string ;
/ * *
* Modules that should be shared in the share scope . When provided , property names are used to match requested module s in this compilation .
2020-04-30 19:39:58 +08:00
* /
2020-12-17 01:26:46 +08:00
shared ? : ( string | SharedObject ) [ ] | SharedObject ;
2020-04-30 19:39:58 +08:00
}
2020-04-21 14:45:35 +08:00
declare class ModuleGraph {
constructor ( ) ;
setParents (
dependency : Dependency ,
block : DependenciesBlock ,
module : Module
) : void ;
getParentModule ( dependency : Dependency ) : Module ;
getParentBlock ( dependency : Dependency ) : DependenciesBlock ;
setResolvedModule (
originModule : Module ,
dependency : Dependency ,
module : Module
) : void ;
updateModule ( dependency : Dependency , module : Module ) : void ;
removeConnection ( dependency : Dependency ) : void ;
addExplanation ( dependency : Dependency , explanation : string ) : void ;
cloneModuleAttributes ( sourceModule : Module , targetModule : Module ) : void ;
removeModuleAttributes ( module : Module ) : void ;
removeAllModuleAttributes ( ) : void ;
moveModuleConnections (
oldModule : Module ,
newModule : Module ,
filterConnection : ( arg0 : ModuleGraphConnection ) = > boolean
) : void ;
2020-07-28 00:09:48 +08:00
copyOutgoingModuleConnections (
oldModule : Module ,
newModule : Module ,
filterConnection : ( arg0 : ModuleGraphConnection ) = > boolean
) : void ;
2020-04-21 14:45:35 +08:00
addExtraReason ( module : Module , explanation : string ) : void ;
getResolvedModule ( dependency : Dependency ) : Module ;
2020-12-17 01:26:46 +08:00
getConnection ( dependency : Dependency ) : undefined | ModuleGraphConnection ;
2020-04-21 14:45:35 +08:00
getModule ( dependency : Dependency ) : Module ;
getOrigin ( dependency : Dependency ) : Module ;
getResolvedOrigin ( dependency : Dependency ) : Module ;
getIncomingConnections ( module : Module ) : Iterable < ModuleGraphConnection > ;
getOutgoingConnections ( module : Module ) : Iterable < ModuleGraphConnection > ;
2020-12-17 01:26:46 +08:00
getProfile ( module : Module ) : null | ModuleProfile ;
setProfile ( module : Module , profile : null | ModuleProfile ) : void ;
getIssuer ( module : Module ) : null | Module ;
setIssuer ( module : Module , issuer : null | Module ) : void ;
setIssuerIfUnset ( module : Module , issuer : null | Module ) : void ;
2020-04-21 14:45:35 +08:00
getOptimizationBailout (
module : Module
2020-04-23 17:43:38 +08:00
) : ( string | ( ( requestShortener : RequestShortener ) = > string ) ) [ ] ;
2020-12-17 01:26:46 +08:00
getProvidedExports ( module : Module ) : null | true | string [ ] ;
isExportProvided ( module : Module , exportName : EntryItem ) : null | boolean ;
2020-04-21 14:45:35 +08:00
getExportsInfo ( module : Module ) : ExportsInfo ;
getExportInfo ( module : Module , exportName : string ) : ExportInfo ;
getReadOnlyExportInfo ( module : Module , exportName : string ) : ExportInfo ;
2020-07-28 00:09:48 +08:00
getUsedExports (
module : Module ,
2020-11-26 17:49:59 +08:00
runtime : RuntimeSpec
2020-12-17 01:26:46 +08:00
) : null | boolean | SortableSet < string > ;
2020-04-21 14:45:35 +08:00
getPreOrderIndex ( module : Module ) : number ;
getPostOrderIndex ( module : Module ) : number ;
setPreOrderIndex ( module : Module , index : number ) : void ;
setPreOrderIndexIfUnset ( module : Module , index : number ) : boolean ;
setPostOrderIndex ( module : Module , index : number ) : void ;
setPostOrderIndexIfUnset ( module : Module , index : number ) : boolean ;
getDepth ( module : Module ) : number ;
setDepth ( module : Module , depth : number ) : void ;
setDepthIfLower ( module : Module , depth : number ) : boolean ;
isAsync ( module : Module ) : boolean ;
setAsync ( module : Module ) : void ;
2020-12-17 01:26:46 +08:00
getMeta ( thing? : any ) : Object ;
2020-04-21 14:45:35 +08:00
static getModuleGraphForModule (
module : Module ,
deprecateMessage : string ,
deprecationCode : string
) : ModuleGraph ;
static setModuleGraphForModule (
module : Module ,
module Graph : ModuleGraph
) : void ;
2020-07-28 01:36:06 +08:00
static ModuleGraphConnection : typeof ModuleGraphConnection ;
2020-04-21 14:45:35 +08:00
}
2020-07-28 01:36:06 +08:00
declare class ModuleGraphConnection {
constructor (
2020-12-17 01:26:46 +08:00
originModule : undefined | Module ,
dependency : undefined | Dependency ,
2020-07-28 01:36:06 +08:00
module : Module ,
explanation? : string ,
weak? : boolean ,
condition ? : (
arg0 : ModuleGraphConnection ,
2020-11-26 17:49:59 +08:00
arg1 : RuntimeSpec
) = > ConnectionState
2020-07-28 01:36:06 +08:00
) ;
2020-12-17 01:26:46 +08:00
originModule? : Module ;
resolvedOriginModule? : Module ;
dependency? : Dependency ;
2020-04-21 14:45:35 +08:00
resolvedModule : Module ;
module : Module ;
weak : boolean ;
conditional : boolean ;
2020-07-28 00:09:48 +08:00
condition : (
arg0 : ModuleGraphConnection ,
2020-11-26 17:49:59 +08:00
arg1 : RuntimeSpec
) = > ConnectionState ;
2020-04-21 14:45:35 +08:00
explanations : Set < string > ;
2020-09-15 16:07:04 +08:00
clone ( ) : ModuleGraphConnection ;
2020-07-28 00:09:48 +08:00
addCondition (
condition : (
arg0 : ModuleGraphConnection ,
2020-11-26 17:49:59 +08:00
arg1 : RuntimeSpec
) = > ConnectionState
2020-07-28 00:09:48 +08:00
) : void ;
2020-04-21 14:45:35 +08:00
addExplanation ( explanation : string ) : void ;
readonly explanation : string ;
2020-07-28 00:09:48 +08:00
active : void ;
2020-11-26 17:49:59 +08:00
isActive ( runtime : RuntimeSpec ) : boolean ;
isTargetActive ( runtime : RuntimeSpec ) : boolean ;
getActiveState ( runtime : RuntimeSpec ) : ConnectionState ;
2020-10-05 22:57:31 +08:00
setActive ( value : boolean ) : void ;
static addConnectionStates : (
2020-11-26 17:49:59 +08:00
a : ConnectionState ,
b : ConnectionState
) = > ConnectionState ;
2020-10-05 22:57:31 +08:00
static TRANSITIVE_ONLY : typeof TRANSITIVE_ONLY ;
static CIRCULAR_CONNECTION : typeof CIRCULAR_CONNECTION ;
2020-04-21 14:45:35 +08:00
}
2020-11-26 17:49:59 +08:00
type ModuleInfo = ConcatenatedModuleInfo | ExternalModuleInfo ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options affecting the normal module s ( ` NormalModuleFactory ` ) .
* /
declare interface ModuleOptions {
/ * *
* An array of rules applied by default for module s.
* /
2020-07-11 16:30:18 +08:00
defaultRules ? : ( RuleSetRule | "..." ) [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Enable warnings for full dynamic dependencies .
* /
exprContextCritical? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Enable recursive directory lookup for full dynamic dependencies .
* /
exprContextRecursive? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Sets the default regular expression for full dynamic dependencies .
* /
exprContextRegExp? : boolean | RegExp ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Set the default request for full dynamic dependencies .
* /
exprContextRequest? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Don 't parse files matching. It' s matched against the full resolved request .
* /
2020-10-29 03:51:08 +08:00
noParse? : string | Function | RegExp | ( string | Function | RegExp ) [ ] ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* An array of rules applied for module s.
2020-03-21 21:01:38 +08:00
* /
2020-07-11 16:30:18 +08:00
rules ? : ( RuleSetRule | "..." ) [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Emit errors instead of warnings when imported names don ' t exist in imported module .
* /
strictExportPresence? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Handle the this context correctly according to the spec for namespace objects .
* /
strictThisContextOnImports? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Enable warnings when using the require function in a not statically analyse - able way .
* /
unknownContextCritical? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Enable recursive directory lookup when using the require function in a not statically analyse - able way .
* /
unknownContextRecursive? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Sets the regular expression when using the require function in a not statically analyse - able way .
* /
unknownContextRegExp? : boolean | RegExp ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Sets the request when using the require function in a not statically analyse - able way .
* /
unknownContextRequest? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Cache the resolving of module requests.
* /
unsafeCache? : boolean | Function ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Enable warnings for partial dynamic dependencies .
* /
wrappedContextCritical? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Enable recursive directory lookup for partial dynamic dependencies .
* /
wrappedContextRecursive? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Set the inner regular expression for partial dynamic dependencies .
* /
wrappedContextRegExp? : RegExp ;
}
declare interface ModulePathData {
id : string | number ;
hash : string ;
hashWithLength ? : ( arg0 : number ) = > string ;
}
declare abstract class ModuleProfile {
startTime : number ;
factory : number ;
restoring : number ;
integration : number ;
building : number ;
storing : number ;
additionalFactories : number ;
additionalIntegration : number ;
markFactoryStart ( ) : void ;
2020-12-17 01:26:46 +08:00
factoryStartTime? : number ;
2020-04-21 14:45:35 +08:00
markFactoryEnd ( ) : void ;
2020-12-17 01:26:46 +08:00
factoryEndTime? : number ;
2020-04-21 14:45:35 +08:00
markRestoringStart ( ) : void ;
2020-12-17 01:26:46 +08:00
restoringStartTime? : number ;
2020-04-21 14:45:35 +08:00
markRestoringEnd ( ) : void ;
2020-12-17 01:26:46 +08:00
restoringEndTime? : number ;
2020-04-21 14:45:35 +08:00
markIntegrationStart ( ) : void ;
2020-12-17 01:26:46 +08:00
integrationStartTime? : number ;
2020-04-21 14:45:35 +08:00
markIntegrationEnd ( ) : void ;
2020-12-17 01:26:46 +08:00
integrationEndTime? : number ;
2020-04-21 14:45:35 +08:00
markBuildingStart ( ) : void ;
2020-12-17 01:26:46 +08:00
buildingStartTime? : number ;
2020-04-21 14:45:35 +08:00
markBuildingEnd ( ) : void ;
2020-12-17 01:26:46 +08:00
buildingEndTime? : number ;
2020-04-21 14:45:35 +08:00
markStoringStart ( ) : void ;
2020-12-17 01:26:46 +08:00
storingStartTime? : number ;
2020-04-21 14:45:35 +08:00
markStoringEnd ( ) : void ;
2020-12-17 01:26:46 +08:00
storingEndTime? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Merge this profile into another one
* /
mergeInto ( realProfile : ModuleProfile ) : void ;
}
2020-09-15 16:56:06 +08:00
declare interface ModuleReferenceOptions {
/ * *
* the properties / exports of the module
* /
ids : string [ ] ;
/ * *
* true , when this referenced export is called
* /
call : boolean ;
/ * *
* true , when this referenced export is directly imported ( not via property access )
* /
directImport : boolean ;
/ * *
* if the position is ASI safe or unknown
* /
2020-12-17 01:26:46 +08:00
asiSafe? : boolean ;
2020-09-15 16:56:06 +08:00
}
2020-04-21 14:45:35 +08:00
declare abstract class ModuleTemplate {
type : string ;
hooks : Readonly < {
content : { tap : ( options? : any , fn? : any ) = > void } ;
module : { tap : ( options? : any , fn? : any ) = > void } ;
render : { tap : ( options? : any , fn? : any ) = > void } ;
package : { tap : ( options? : any , fn? : any ) = > void } ;
hash : { tap : ( options? : any , fn? : any ) = > void } ;
} > ;
readonly runtimeTemplate : any ;
}
declare class MultiCompiler {
2020-04-23 17:43:38 +08:00
constructor ( compilers : Compiler [ ] | Record < string , Compiler > ) ;
2020-04-21 14:45:35 +08:00
hooks : Readonly < {
2020-11-26 17:48:16 +08:00
done : SyncHook < [ MultiStats ] > ;
2020-12-17 01:26:46 +08:00
invalid : MultiHook < SyncHook < [ null | string , number ] > > ;
2020-06-17 21:53:14 +08:00
run : MultiHook < AsyncSeriesHook < [ Compiler ] > > ;
2020-11-26 17:48:16 +08:00
watchClose : SyncHook < [ ] > ;
2020-06-17 21:53:14 +08:00
watchRun : MultiHook < AsyncSeriesHook < [ Compiler ] > > ;
2020-04-23 17:43:38 +08:00
infrastructureLog : MultiHook < SyncBailHook < [ string , string , any [ ] ] , true > > ;
2020-04-21 14:45:35 +08:00
} > ;
2020-04-23 17:43:38 +08:00
compilers : Compiler [ ] ;
dependencies : WeakMap < Compiler , string [ ] > ;
2020-04-21 14:45:35 +08:00
running : boolean ;
2020-04-23 17:43:38 +08:00
readonly options : WebpackOptionsNormalized [ ] ;
2020-04-21 14:45:35 +08:00
readonly outputPath : string ;
inputFileSystem : InputFileSystem ;
outputFileSystem : OutputFileSystem ;
2020-07-08 16:21:31 +08:00
watchFileSystem : WatchFileSystem ;
2020-11-26 17:49:59 +08:00
intermediateFileSystem : IntermediateFileSystem ;
2020-04-21 14:45:35 +08:00
getInfrastructureLogger ( name? : any ) : WebpackLogger ;
2020-04-23 17:43:38 +08:00
setDependencies ( compiler : Compiler , dependencies : string [ ] ) : void ;
2020-04-21 14:45:35 +08:00
validateDependencies ( callback : CallbackFunction < MultiStats > ) : boolean ;
runWithDependencies (
2020-04-23 17:43:38 +08:00
compilers : Compiler [ ] ,
2020-04-21 14:45:35 +08:00
fn : ( compiler : Compiler , callback : CallbackFunction < MultiStats > ) = > any ,
callback : CallbackFunction < MultiStats >
) : void ;
watch (
2020-04-23 17:43:38 +08:00
watchOptions : WatchOptions | WatchOptions [ ] ,
2020-04-21 14:45:35 +08:00
handler : CallbackFunction < MultiStats >
) : MultiWatching ;
run ( callback : CallbackFunction < MultiStats > ) : void ;
purgeInputFileSystem ( ) : void ;
close ( callback : CallbackFunction < void > ) : void ;
}
declare abstract class MultiStats {
2020-04-23 17:43:38 +08:00
stats : Stats [ ] ;
2020-09-04 04:09:43 +08:00
readonly hash : string ;
2020-04-21 14:45:35 +08:00
hasErrors ( ) : boolean ;
hasWarnings ( ) : boolean ;
toJson (
options? : any
) : {
2020-04-23 17:43:38 +08:00
children : any [ ] ;
2020-04-21 14:45:35 +08:00
version : any ;
hash : string ;
2020-04-23 17:43:38 +08:00
errors : any [ ] ;
warnings : any [ ] ;
2020-09-04 04:09:43 +08:00
errorsCount : number ;
warningsCount : number ;
2020-04-21 14:45:35 +08:00
} ;
toString ( options? : any ) : string ;
}
declare abstract class MultiWatching {
2020-04-23 17:43:38 +08:00
watchings : Watching [ ] ;
2020-04-21 14:45:35 +08:00
compiler : MultiCompiler ;
2020-07-31 23:38:33 +08:00
invalidate ( callback? : any ) : void ;
2020-04-21 14:45:35 +08:00
suspend ( ) : void ;
resume ( ) : void ;
close ( callback : CallbackFunction < void > ) : void ;
}
declare class NamedChunkIdsPlugin {
constructor ( options? : any ) ;
delimiter : any ;
context : any ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare class NamedModuleIdsPlugin {
constructor ( options? : any ) ;
options : any ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare class NaturalModuleIdsPlugin {
constructor ( ) ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare interface NeedBuildContext {
fileSystemInfo : FileSystemInfo ;
}
declare class NoEmitOnErrorsPlugin {
constructor ( ) ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare class NodeEnvironmentPlugin {
constructor ( options? : any ) ;
options : any ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
2020-07-23 04:05:26 +08:00
type NodeEstreeIndex =
| UnaryExpression
| ThisExpression
| ArrayExpression
| ObjectExpression
| FunctionExpression
| ArrowFunctionExpression
| YieldExpression
| SimpleLiteral
| RegExpLiteral
| UpdateExpression
| BinaryExpression
| AssignmentExpression
| LogicalExpression
| MemberExpression
| ConditionalExpression
| SimpleCallExpression
| NewExpression
| SequenceExpression
| TemplateLiteral
| TaggedTemplateExpression
| ClassExpression
| MetaProperty
| Identifier
| AwaitExpression
| ImportExpression
| ChainExpression
2020-10-05 22:57:31 +08:00
| FunctionDeclaration
| VariableDeclaration
| ClassDeclaration
2020-07-23 04:05:26 +08:00
| ExpressionStatement
| BlockStatement
| EmptyStatement
| DebuggerStatement
| WithStatement
| ReturnStatement
| LabeledStatement
| BreakStatement
| ContinueStatement
| IfStatement
| SwitchStatement
| ThrowStatement
| TryStatement
| WhileStatement
| DoWhileStatement
| ForStatement
| ForInStatement
| ForOfStatement
| ImportDeclaration
| ExportNamedDeclaration
| ExportDefaultDeclaration
| ExportAllDeclaration
| MethodDefinition
| VariableDeclarator
| Program
2020-12-17 01:26:46 +08:00
| Super
2020-07-23 04:05:26 +08:00
| SwitchCase
| CatchClause
| Property
| AssignmentProperty
| TemplateElement
| SpreadElement
| ObjectPattern
| ArrayPattern
| RestElement
| AssignmentPattern
| ClassBody
| ImportSpecifier
| ImportDefaultSpecifier
| ImportNamespaceSpecifier
| ExportSpecifier ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options object for node compatibility features .
* /
declare interface NodeOptions {
2020-06-17 03:09:07 +08:00
/ * *
* Include a polyfill for the '__dirname' variable .
* /
2020-09-10 16:42:29 +08:00
__dirname? : boolean | "mock" | "eval-only" ;
2020-06-17 03:09:07 +08:00
/ * *
* Include a polyfill for the '__filename' variable .
* /
2020-09-10 16:42:29 +08:00
__filename? : boolean | "mock" | "eval-only" ;
2020-06-17 03:09:07 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Include a polyfill for the 'global' variable .
* /
global ? : boolean ;
}
2020-08-20 05:17:33 +08:00
declare class NodeSourcePlugin {
2020-09-10 16:42:29 +08:00
constructor ( ) ;
2020-08-20 05:17:33 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare class NodeTargetPlugin {
constructor ( ) ;
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
2020-04-21 14:45:35 +08:00
declare class NodeTemplatePlugin {
constructor ( options? : any ) ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Apply the plugin
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
apply ( compiler : Compiler ) : void ;
}
2020-07-23 04:05:26 +08:00
type NodeWebpackOptions = false | NodeOptions ;
2020-04-21 14:45:35 +08:00
declare class NormalModule extends Module {
constructor ( __0 : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* module type
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
type : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* request string
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
request : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* request intended by user ( without loaders from config )
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
userRequest : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* request without resolving
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
rawRequest : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* list of loaders
2020-03-21 21:01:38 +08:00
* /
2020-04-23 17:43:38 +08:00
loaders : LoaderItem [ ] ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* path + query of the real resource
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
resource : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* path + query of the matched resource ( virtual )
2020-03-21 21:01:38 +08:00
* /
2020-12-17 01:26:46 +08:00
matchResource? : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the parser used
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
parser : Parser ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the generator used
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
generator : Generator ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* options used for resolving requests from this module
2020-03-21 21:01:38 +08:00
* /
2020-12-17 01:26:46 +08:00
resolveOptions : Object ;
2020-04-21 14:45:35 +08:00
} ) ;
request : string ;
userRequest : string ;
rawRequest : string ;
binary : boolean ;
parser : Parser ;
generator : Generator ;
resource : string ;
2020-12-17 01:26:46 +08:00
matchResource? : string ;
2020-04-23 17:43:38 +08:00
loaders : LoaderItem [ ] ;
2020-12-17 01:26:46 +08:00
error? : WebpackError ;
2020-04-21 14:45:35 +08:00
createSourceForAsset (
context : string ,
name : string ,
content : string ,
sourceMap? : any ,
2020-12-17 01:26:46 +08:00
associatedObjectForCache? : Object
2020-04-21 14:45:35 +08:00
) : Source ;
createLoaderContext (
2020-11-26 17:49:59 +08:00
resolver : ResolverWithOptions ,
2020-04-21 14:45:35 +08:00
options : WebpackOptionsNormalized ,
compilation : Compilation ,
fs : InputFileSystem
) : any ;
2020-12-17 01:26:46 +08:00
getCurrentLoader ( loaderContext? : any , index? : any ) : null | LoaderItem ;
2020-04-21 14:45:35 +08:00
createSource (
context : string ,
content : string | Buffer ,
sourceMap? : any ,
2020-12-17 01:26:46 +08:00
associatedObjectForCache? : Object
2020-04-21 14:45:35 +08:00
) : Source ;
doBuild (
options : WebpackOptionsNormalized ,
compilation : Compilation ,
2020-11-26 17:49:59 +08:00
resolver : ResolverWithOptions ,
2020-04-21 14:45:35 +08:00
fs : InputFileSystem ,
2020-12-17 01:26:46 +08:00
callback : ( arg0? : WebpackError ) = > void
2020-04-21 14:45:35 +08:00
) : void ;
markModuleAsErrored ( error : WebpackError ) : void ;
applyNoParseRule ( rule? : any , content? : any ) : any ;
shouldPreventParsing ( noParseRule? : any , request? : any ) : any ;
static getCompilationHooks (
compilation : Compilation
) : NormalModuleCompilationHooks ;
static deserialize ( context? : any ) : NormalModule ;
}
declare interface NormalModuleCompilationHooks {
2020-12-18 20:52:15 +08:00
loader : SyncHook < [ object , NormalModule ] > ;
beforeLoaders : SyncHook < [ LoaderItem [ ] , NormalModule , object ] > ;
2020-07-03 20:45:49 +08:00
readResourceForScheme : HookMap <
AsyncSeriesBailHook < [ string , NormalModule ] , string | Buffer >
> ;
2020-04-21 14:45:35 +08:00
}
declare abstract class NormalModuleFactory extends ModuleFactory {
hooks : Readonly < {
2020-06-17 21:53:14 +08:00
resolve : AsyncSeriesBailHook < [ ResolveData ] , any > ;
2020-07-03 20:45:49 +08:00
resolveForScheme : HookMap <
2020-11-26 17:49:59 +08:00
AsyncSeriesBailHook < [ ResourceDataWithData , ResolveData ] , true | void >
2020-07-03 20:45:49 +08:00
> ;
2020-06-17 21:53:14 +08:00
factorize : AsyncSeriesBailHook < [ ResolveData ] , any > ;
beforeResolve : AsyncSeriesBailHook < [ ResolveData ] , any > ;
afterResolve : AsyncSeriesBailHook < [ ResolveData ] , any > ;
2020-12-17 01:26:46 +08:00
createModule : AsyncSeriesBailHook < [ Object , ResolveData ] , any > ;
module : SyncWaterfallHook < [ Module , Object , ResolveData ] , any > ;
2020-04-21 14:45:35 +08:00
createParser : HookMap < SyncBailHook < any , any > > ;
2020-11-26 17:48:16 +08:00
parser : HookMap < SyncHook < any > > ;
2020-04-21 14:45:35 +08:00
createGenerator : HookMap < SyncBailHook < any , any > > ;
2020-11-26 17:48:16 +08:00
generator : HookMap < SyncHook < any > > ;
2020-04-21 14:45:35 +08:00
} > ;
2020-06-09 06:32:24 +08:00
resolverFactory : ResolverFactory ;
2020-04-21 14:45:35 +08:00
ruleSet : RuleSet ;
unsafeCache : boolean ;
2020-06-09 06:32:24 +08:00
cachePredicate : Function ;
context : string ;
fs : InputFileSystem ;
2020-12-17 01:26:46 +08:00
parserCache : Map < string , WeakMap < Object , any > > ;
generatorCache : Map < string , WeakMap < Object , Generator > > ;
2020-09-15 21:10:25 +08:00
resolveResource (
contextInfo? : any ,
context? : any ,
unresolvedResource? : any ,
resolver? : any ,
resolveContext? : any ,
callback? : any
) : void ;
2020-04-21 14:45:35 +08:00
resolveRequestArray (
contextInfo? : any ,
context? : any ,
array? : any ,
resolver? : any ,
resolveContext? : any ,
callback? : any
) : any ;
2020-12-18 20:52:15 +08:00
getParser ( type ? : any , parserOptions? : object ) : any ;
2020-08-03 02:09:36 +08:00
createParser ( type : string , parserOptions ? : { [ index : string ] : any } ) : Parser ;
2020-12-18 20:52:15 +08:00
getGenerator ( type ? : any , generatorOptions? : object ) : undefined | Generator ;
createGenerator ( type ? : any , generatorOptions? : object ) : any ;
2020-11-26 17:49:59 +08:00
getResolver ( type ? : any , resolveOptions? : any ) : ResolverWithOptions ;
2020-04-21 14:45:35 +08:00
}
declare class NormalModuleReplacementPlugin {
/ * *
* Create an instance of the plugin
* /
constructor (
resourceRegExp : RegExp ,
newResource : string | ( ( arg0? : any ) = > void )
) ;
resourceRegExp : RegExp ;
newResource : string | ( ( arg0? : any ) = > void ) ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
2020-12-18 01:51:55 +08:00
type NormalizedStatsOptions = KnownNormalizedStatsOptions &
StatsOptions &
Record < string , any > ;
2020-04-21 14:45:35 +08:00
declare interface ObjectDeserializerContext {
read : ( ) = > any ;
}
declare interface ObjectSerializer {
serialize : ( arg0 : any , arg1 : ObjectSerializerContext ) = > void ;
deserialize : ( arg0 : ObjectDeserializerContext ) = > any ;
}
declare interface ObjectSerializerContext {
write : ( arg0? : any ) = > void ;
}
declare class OccurrenceChunkIdsPlugin {
constructor ( options? : OccurrenceChunkIdsPluginOptions ) ;
options : OccurrenceChunkIdsPluginOptions ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare interface OccurrenceChunkIdsPluginOptions {
/ * *
* Prioritise initial size over total size .
* /
prioritiseInitial? : boolean ;
}
declare class OccurrenceModuleIdsPlugin {
constructor ( options? : OccurrenceModuleIdsPluginOptions ) ;
options : OccurrenceModuleIdsPluginOptions ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare interface OccurrenceModuleIdsPluginOptions {
/ * *
* Prioritise initial size over total size .
* /
prioritiseInitial? : boolean ;
}
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Enables / Disables integrated optimizations .
* /
declare interface Optimization {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Check for incompatible wasm types when importing / exporting from / to ESM .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
checkWasmTypes? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Define the algorithm to choose chunk ids ( named : readable ids for better debugging , deterministic : numeric hash ids for better long term caching , size : numeric ids focused on minimal initial download size , total - size : numeric ids focused on minimal total download size , false : no algorithm used , as custom one can be provided via plugin ) .
* /
chunkIds ? :
| false
| "natural"
| "named"
| "deterministic"
| "size"
| "total-size" ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Concatenate module s when possible to generate less module s , more efficient code and enable more optimizations by the minimizer .
* /
concatenateModules? : boolean ;
2020-03-21 21:01:38 +08:00
2020-07-17 21:39:16 +08:00
/ * *
2020-08-03 17:41:54 +08:00
* Emit assets even when errors occur . Critical errors are emitted into the generated code and will cause errors at runtime .
2020-07-17 21:39:16 +08:00
* /
emitOnErrors? : boolean ;
2020-04-21 14:45:35 +08:00
/ * *
* Also flag chunks as loaded which contain a subset of the module s.
* /
flagIncludedChunks? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Creates a module - internal dependency graph for top level symbols , exports and imports , to improve unused exports detection .
* /
innerGraph? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
2020-07-31 18:13:30 +08:00
* Rename exports when possible to generate shorter code ( depends on optimization . usedExports and optimization . providedExports , true / "deterministic" : generate short deterministic names optimized for caching , "size" : generate the shortest possible names ) .
2020-04-21 14:45:35 +08:00
* /
2020-07-31 18:13:30 +08:00
mangleExports? : boolean | "deterministic" | "size" ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Reduce size of WASM by changing imports to shorter strings .
* /
mangleWasmImports? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Merge chunks which contain the same module s.
* /
mergeDuplicateChunks? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Enable minimizing the output . Uses optimization . minimizer .
* /
minimize? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Minimizer ( s ) to use for minimizing the output .
* /
2020-04-23 17:43:38 +08:00
minimizer ? : (
| ( ( this : Compiler , compiler : Compiler ) = > void )
| WebpackPluginInstance
2020-07-11 16:30:18 +08:00
| "..."
2020-04-23 17:43:38 +08:00
) [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Define the algorithm to choose module ids ( natural : numeric ids in order of usage , named : readable ids for better debugging , hashed : ( deprecated ) short hashes as ids for better long term caching , deterministic : numeric hash ids for better long term caching , size : numeric ids focused on minimal initial download size , false : no algorithm used , as custom one can be provided via plugin ) .
* /
module Ids? : false | "natural" | "named" | "deterministic" | "size" | "hashed" ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
2020-07-17 21:39:16 +08:00
* Avoid emitting assets when errors occur ( deprecated : use 'emitOnErrors' instead ) .
2020-04-21 14:45:35 +08:00
* /
noEmitOnErrors? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Set process . env . NODE_ENV to a specific value .
* /
2020-12-17 01:26:46 +08:00
nodeEnv? : string | false ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Generate records with relative paths to be able to move the context folder .
* /
portableRecords? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Figure out which exports are provided by module s to generate more efficient code .
* /
providedExports? : boolean ;
2020-03-21 21:01:38 +08:00
2020-08-19 03:14:43 +08:00
/ * *
* Use real [ contenthash ] based on final content of the assets .
* /
realContentHash? : boolean ;
2020-04-21 14:45:35 +08:00
/ * *
* Removes module s from chunks when these module s are already included in all parents .
* /
removeAvailableModules? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Remove chunks which are empty .
* /
removeEmptyChunks? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Create an additional chunk which contains only the webpack runtime and chunk hash maps .
* /
2020-12-17 01:26:46 +08:00
runtimeChunk ? :
| boolean
| "single"
| "multiple"
| {
/ * *
* The name or name factory for the runtime chunks .
* /
name? : string | Function ;
} ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
2020-10-26 22:32:34 +08:00
* Skip over module s which contain no side effects when exports are not used ( false : disabled , 'flag' : only use manually placed side effects flag , true : also analyse source code for side effects ) .
2020-04-21 14:45:35 +08:00
* /
2020-10-26 22:32:34 +08:00
sideEffects? : boolean | "flag" ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Optimize duplication and caching by splitting chunks by shared module s and cache group .
* /
splitChunks? : false | OptimizationSplitChunksOptions ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
2020-07-28 00:09:48 +08:00
* Figure out which exports are used by module s to mangle export names , omit unused exports and generate more efficient code ( true : analyse used exports for each runtime , "global" : analyse exports globally for all runtimes combined ) .
2020-04-21 14:45:35 +08:00
* /
2020-07-28 00:09:48 +08:00
usedExports? : boolean | "global" ;
2020-04-21 14:45:35 +08:00
}
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options object for describing behavior of a cache group selecting module s that should be cached together .
* /
declare interface OptimizationSplitChunksCacheGroup {
/ * *
* Sets the name delimiter for created chunks .
* /
automaticNameDelimiter? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Select chunks for determining cache group content ( defaults to "initial" , "initial" and "all" requires adding these chunks to the HTML ) .
* /
chunks ? : "initial" | "async" | "all" | ( ( chunk : Chunk ) = > boolean ) ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Ignore minimum size , minimum chunks and maximum requests and always create chunks for this cache group .
* /
enforce? : boolean ;
2020-03-21 21:01:38 +08:00
2020-07-13 16:12:17 +08:00
/ * *
* Size threshold at which splitting is enforced and other restrictions ( minRemainingSize , maxAsyncRequests , maxInitialRequests ) are ignored .
* /
2020-12-17 01:26:46 +08:00
enforceSizeThreshold? : number | { [ index : string ] : number } ;
2020-07-13 16:12:17 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Sets the template for the filename for created chunks .
* /
2020-11-26 17:48:16 +08:00
filename? : string | ( ( pathData : PathData , assetInfo? : AssetInfo ) = > string ) ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Sets the hint for chunk id .
* /
idHint? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Maximum number of requests which are accepted for on - demand loading .
* /
maxAsyncRequests? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Maximal size hint for the on - demand chunks .
* /
2020-12-17 01:26:46 +08:00
maxAsyncSize? : number | { [ index : string ] : number } ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Maximum number of initial chunks which are accepted for an entry point .
* /
maxInitialRequests? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Maximal size hint for the initial chunks .
* /
2020-12-17 01:26:46 +08:00
maxInitialSize? : number | { [ index : string ] : number } ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Maximal size hint for the created chunks .
* /
2020-12-17 01:26:46 +08:00
maxSize? : number | { [ index : string ] : number } ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Minimum number of times a module has to be duplicated until it ' s considered for splitting .
* /
minChunks? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Minimal size for the chunks the stay after moving the module s to a new chunk .
* /
2020-12-17 01:26:46 +08:00
minRemainingSize? : number | { [ index : string ] : number } ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Minimal size for the created chunk .
* /
2020-12-17 01:26:46 +08:00
minSize? : number | { [ index : string ] : number } ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Give chunks for this cache group a name ( chunks with equal name are merged ) .
* /
name? : string | false | Function ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Priority of this cache group .
* /
priority? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Try to reuse existing chunk ( with name ) when it has matching module s.
* /
reuseExistingChunk? : boolean ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Assign module s to a cache group by module name.
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
test? : string | Function | RegExp ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Assign module s to a cache group by module type.
* /
type ? : string | Function | RegExp ;
2020-07-28 00:09:48 +08:00
/ * *
* Compare used exports when checking common module s. Modules will only be put in the same chunk when exports are equal .
* /
usedExports? : boolean ;
2020-04-21 14:45:35 +08:00
}
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options object for splitting chunks into smaller chunks .
* /
declare interface OptimizationSplitChunksOptions {
/ * *
* Sets the name delimiter for created chunks .
* /
automaticNameDelimiter? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Assign module s to a cache group ( module s from different cache groups are tried to keep in separate chunks , default categories : 'default' , 'defaultVendors' ) .
* /
cacheGroups ? : {
[ index : string ] :
| string
| false
| Function
| RegExp
| OptimizationSplitChunksCacheGroup ;
} ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Select chunks for determining shared module s ( defaults to "async" , "initial" and "all" requires adding these chunks to the HTML ) .
* /
chunks ? : "initial" | "async" | "all" | ( ( chunk : Chunk ) = > boolean ) ;
2020-03-21 21:01:38 +08:00
2020-09-29 17:16:24 +08:00
/ * *
* Sets the size types which are used when a number is used for sizes .
* /
defaultSizeTypes? : string [ ] ;
2020-07-13 16:12:17 +08:00
/ * *
* Size threshold at which splitting is enforced and other restrictions ( minRemainingSize , maxAsyncRequests , maxInitialRequests ) are ignored .
* /
2020-12-17 01:26:46 +08:00
enforceSizeThreshold? : number | { [ index : string ] : number } ;
2020-07-13 16:12:17 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options for module s not selected by any other cache group .
* /
fallbackCacheGroup ? : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Sets the name delimiter for created chunks .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
automaticNameDelimiter? : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Maximal size hint for the on - demand chunks .
2020-03-21 21:01:38 +08:00
* /
2020-12-17 01:26:46 +08:00
maxAsyncSize? : number | { [ index : string ] : number } ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Maximal size hint for the initial chunks .
2020-03-21 21:01:38 +08:00
* /
2020-12-17 01:26:46 +08:00
maxInitialSize? : number | { [ index : string ] : number } ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Maximal size hint for the created chunks .
2020-03-21 21:01:38 +08:00
* /
2020-12-17 01:26:46 +08:00
maxSize? : number | { [ index : string ] : number } ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Minimal size for the created chunk .
2020-03-21 21:01:38 +08:00
* /
2020-12-17 01:26:46 +08:00
minSize? : number | { [ index : string ] : number } ;
2020-04-21 14:45:35 +08:00
} ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Sets the template for the filename for created chunks .
* /
2020-11-26 17:48:16 +08:00
filename? : string | ( ( pathData : PathData , assetInfo? : AssetInfo ) = > string ) ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Prevents exposing path info when creating names for parts splitted by maxSize .
* /
hidePathInfo? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Maximum number of requests which are accepted for on - demand loading .
* /
maxAsyncRequests? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Maximal size hint for the on - demand chunks .
* /
2020-12-17 01:26:46 +08:00
maxAsyncSize? : number | { [ index : string ] : number } ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Maximum number of initial chunks which are accepted for an entry point .
* /
maxInitialRequests? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Maximal size hint for the initial chunks .
* /
2020-12-17 01:26:46 +08:00
maxInitialSize? : number | { [ index : string ] : number } ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Maximal size hint for the created chunks .
* /
2020-12-17 01:26:46 +08:00
maxSize? : number | { [ index : string ] : number } ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Minimum number of times a module has to be duplicated until it ' s considered for splitting .
* /
minChunks? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Minimal size for the chunks the stay after moving the module s to a new chunk .
* /
2020-12-17 01:26:46 +08:00
minRemainingSize? : number | { [ index : string ] : number } ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Minimal size for the created chunks .
* /
2020-12-17 01:26:46 +08:00
minSize? : number | { [ index : string ] : number } ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Give chunks created a name ( chunks with equal name are merged ) .
* /
name? : string | false | Function ;
2020-07-28 00:09:48 +08:00
/ * *
* Compare used exports when checking common module s. Modules will only be put in the same chunk when exports are equal .
* /
usedExports? : boolean ;
2020-04-21 14:45:35 +08:00
}
declare abstract class OptionsApply {
process ( options? : any , compiler? : any ) : void ;
}
2020-11-26 17:49:59 +08:00
declare interface OriginRecord {
module : Module ;
loc : DependencyLocation ;
request : string ;
}
2020-08-20 02:05:47 +08:00
declare class OriginalSource extends Source {
constructor ( source : string | Buffer , name : string ) ;
getName ( ) : string ;
}
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options affecting the output of the compilation . ` output ` options tell webpack how to write the compiled files to disk .
* /
declare interface Output {
/ * *
* The filename of asset module s as relative path inside the ` output.path ` directory .
* /
2020-12-17 01:26:46 +08:00
assetModuleFilename ? :
| string
| ( ( pathData : PathData , assetInfo? : AssetInfo ) = > string ) ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Add a comment in the UMD wrapper .
* /
2020-12-17 01:26:46 +08:00
auxiliaryComment? : string | LibraryCustomUmdCommentObject ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
2020-08-17 20:34:23 +08:00
* Add charset attribute for script tag .
2020-04-21 14:45:35 +08:00
* /
2020-08-17 20:34:23 +08:00
charset? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
2020-09-25 17:04:14 +08:00
* The filename of non - initial chunks as relative path inside the ` output.path ` directory .
2020-04-21 14:45:35 +08:00
* /
2020-12-17 01:26:46 +08:00
chunkFilename ? :
| string
| ( ( pathData : PathData , assetInfo? : AssetInfo ) = > string ) ;
2020-03-21 21:01:38 +08:00
2020-08-26 03:45:56 +08:00
/ * *
* The format of chunks ( formats included by default are 'array-push' ( web / WebWorker ) , 'commonjs' ( node . js ) , but others might be added by plugins ) .
* /
2020-12-17 01:26:46 +08:00
chunkFormat? : string | false ;
2020-08-26 03:45:56 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Number of milliseconds before chunk request expires .
* /
chunkLoadTimeout? : number ;
2020-03-21 21:01:38 +08:00
2020-08-25 19:37:40 +08:00
/ * *
* The method of loading chunks ( methods included by default are 'jsonp' ( web ) , 'importScripts' ( WebWorker ) , 'require' ( sync node . js ) , 'async-node' ( async node . js ) , but others might be added by plugins ) .
* /
2020-12-17 01:26:46 +08:00
chunkLoading? : string | false ;
2020-08-25 19:37:40 +08:00
2020-08-25 15:16:49 +08:00
/ * *
* The global variable used by webpack for loading of chunks .
* /
chunkLoadingGlobal? : string ;
2020-04-21 14:45:35 +08:00
/ * *
* Check if to be emitted file already exists and have the same content before writing to output filesystem .
* /
compareBeforeEmit? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* This option enables cross - origin loading of chunks .
* /
2020-12-17 01:26:46 +08:00
crossOriginLoading? : false | "anonymous" | "use-credentials" ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Similar to ` output.devtoolModuleFilenameTemplate ` , but used in the case of duplicate module identifiers.
* /
2020-12-17 01:26:46 +08:00
devtoolFallbackModuleFilenameTemplate? : string | Function ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Filename template string of function for the sources array in a generated SourceMap .
* /
2020-12-17 01:26:46 +08:00
devtoolModuleFilenameTemplate? : string | Function ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Module namespace to use when interpolating filename template string for the sources array in a generated SourceMap . Defaults to ` output.library ` if not set . It ' s useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries .
* /
devtoolNamespace? : string ;
2020-03-21 21:01:38 +08:00
2020-08-26 03:45:56 +08:00
/ * *
* List of chunk loading types enabled for use by entry points .
* /
enabledChunkLoadingTypes? : string [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* List of library types enabled for use by entry points .
* /
2020-08-26 03:45:56 +08:00
enabledLibraryTypes? : string [ ] ;
2020-03-21 21:01:38 +08:00
2020-09-09 15:23:01 +08:00
/ * *
* List of wasm loading types enabled for use by entry points .
* /
enabledWasmLoadingTypes? : string [ ] ;
2020-09-09 22:37:53 +08:00
/ * *
* The abilities of the environment where the webpack generated code should run .
* /
environment? : Environment ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Specifies the name of each output file on disk . You must * * not * * specify an absolute path here ! The ` output.path ` option determines the location on disk the files are written to , filename is used solely for naming the individual files .
2020-03-21 21:01:38 +08:00
* /
2020-12-17 01:26:46 +08:00
filename? : string | ( ( pathData : PathData , assetInfo? : AssetInfo ) = > string ) ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* An expression which is used to address the global object / scope in runtime code .
* /
globalObject? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Digest type used for the hash .
* /
hashDigest? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Number of chars which are used for the hash .
* /
hashDigestLength? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Algorithm used for generation the hash ( see node . js crypto package ) .
* /
2020-12-17 01:26:46 +08:00
hashFunction? : string | typeof Hash ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Any string which is added to the hash to salt it .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
hashSalt? : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* The filename of the Hot Update Chunks . They are inside the output . path directory .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
hotUpdateChunkFilename? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
2020-08-25 15:16:49 +08:00
* The global variable used by webpack for loading of hot update chunks .
2020-04-21 14:45:35 +08:00
* /
2020-08-25 15:16:49 +08:00
hotUpdateGlobal? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The filename of the Hot Update Main File . It is inside the ` output.path ` directory .
* /
hotUpdateMainFilename? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Wrap javascript code into IIFE ' s to avoid leaking into global scope .
* /
iife? : boolean ;
2020-03-21 21:01:38 +08:00
2020-05-15 22:24:11 +08:00
/ * *
* The name of the native import ( ) function ( can be exchanged for a polyfill ) .
* /
importFunctionName? : string ;
2020-09-18 16:55:37 +08:00
/ * *
* The name of the native import . meta object ( can be exchanged for a polyfill ) .
* /
importMetaName? : string ;
2020-04-21 14:45:35 +08:00
/ * *
* Make the output files a library , exporting the exports of the entry point .
* /
2020-12-17 01:26:46 +08:00
library? : string | string [ ] | LibraryOptions | LibraryCustomUmdObject ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Specify which export should be exposed as library .
* /
2020-12-17 01:26:46 +08:00
libraryExport? : string | string [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
2020-08-26 03:45:56 +08:00
* Type of library ( types included by default are 'var' , 'module' , 'assign' , 'this' , 'window' , 'self' , 'global' , 'commonjs' , 'commonjs2' , 'commonjs-module' , 'amd' , 'amd-require' , 'umd' , 'umd2' , 'jsonp' , 'system' , but others might be added by plugins ) .
2020-04-21 14:45:35 +08:00
* /
2020-08-26 03:45:56 +08:00
libraryTarget? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Output javascript files as module source type .
* /
module ? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The output directory as * * absolute path * * ( required ) .
* /
path? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Include comments with information about the module s.
* /
2020-12-17 01:26:46 +08:00
pathinfo? : boolean | "verbose" ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The ` publicPath ` specifies the public URL address of the output files when referenced in a browser .
* /
2020-12-17 01:26:46 +08:00
publicPath? : string | ( ( pathData : PathData , assetInfo? : AssetInfo ) = > string ) ;
2020-03-21 21:01:38 +08:00
2020-06-25 04:05:21 +08:00
/ * *
* This option enables loading async chunks via a custom script type , such as script type = "module" .
* /
2020-12-17 01:26:46 +08:00
scriptType? : false | "module" | "text/javascript" ;
2020-06-25 04:05:21 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The filename of the SourceMaps for the JavaScript files . They are inside the ` output.path ` directory .
* /
sourceMapFilename? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Prefixes every line of the source in the bundle with this string .
* /
sourcePrefix? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Handles exceptions in module loading correctly at a performance cost .
* /
strictModuleExceptionHandling? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* If ` output.libraryTarget ` is set to umd and ` output.library ` is set , setting this to true will name the AMD module .
* /
umdNamedDefine? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals .
* /
uniqueName? : string ;
2020-03-21 21:01:38 +08:00
2020-09-09 15:23:01 +08:00
/ * *
* 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 ) .
* /
2020-12-17 01:26:46 +08:00
wasmLoading? : string | false ;
2020-09-09 15:23:01 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The filename of WebAssembly module s as relative path inside the ` output.path ` directory .
* /
webassemblyModuleFilename? : string ;
2020-09-08 00:02:14 +08:00
/ * *
* The method of loading chunks ( methods included by default are 'jsonp' ( web ) , 'importScripts' ( WebWorker ) , 'require' ( sync node . js ) , 'async-node' ( async node . js ) , but others might be added by plugins ) .
* /
2020-12-17 01:26:46 +08:00
workerChunkLoading? : string | false ;
2020-09-09 15:23:01 +08:00
/ * *
* 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 ) .
* /
2020-12-17 01:26:46 +08:00
workerWasmLoading? : string | false ;
2020-04-21 14:45:35 +08:00
}
declare interface OutputFileSystem {
writeFile : (
arg0 : string ,
arg1 : string | Buffer ,
2020-12-17 01:26:46 +08:00
arg2 : ( arg0? : NodeJS.ErrnoException ) = > void
2020-04-21 14:45:35 +08:00
) = > void ;
2020-12-17 01:26:46 +08:00
mkdir : ( arg0 : string , arg1 : ( arg0? : NodeJS.ErrnoException ) = > void ) = > void ;
2020-04-21 14:45:35 +08:00
stat : (
arg0 : string ,
2020-12-17 01:26:46 +08:00
arg1 : ( arg0? : NodeJS.ErrnoException , arg1? : FsStats ) = > void
2020-04-21 14:45:35 +08:00
) = > void ;
readFile : (
arg0 : string ,
2020-12-17 01:26:46 +08:00
arg1 : ( arg0? : NodeJS.ErrnoException , arg1? : Buffer ) = > void
2020-04-21 14:45:35 +08:00
) = > void ;
join ? : ( arg0 : string , arg1 : string ) = > string ;
relative ? : ( arg0 : string , arg1 : string ) = > string ;
dirname ? : ( arg0 : string ) = > string ;
}
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Normalized options affecting the output of the compilation . ` output ` options tell webpack how to write the compiled files to disk .
* /
declare interface OutputNormalized {
/ * *
* The filename of asset module s as relative path inside the ` output.path ` directory .
* /
2020-12-17 01:26:46 +08:00
assetModuleFilename ? :
| string
| ( ( pathData : PathData , assetInfo? : AssetInfo ) = > string ) ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
2020-08-17 21:44:32 +08:00
* Add charset attribute for script tag .
2020-04-21 14:45:35 +08:00
* /
2020-08-17 21:44:32 +08:00
charset? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
2020-09-25 17:04:14 +08:00
* The filename of non - initial chunks as relative path inside the ` output.path ` directory .
2020-04-21 14:45:35 +08:00
* /
2020-12-17 01:26:46 +08:00
chunkFilename ? :
| string
| ( ( pathData : PathData , assetInfo? : AssetInfo ) = > string ) ;
2020-03-21 21:01:38 +08:00
2020-08-26 03:45:56 +08:00
/ * *
* The format of chunks ( formats included by default are 'array-push' ( web / WebWorker ) , 'commonjs' ( node . js ) , but others might be added by plugins ) .
* /
2020-12-17 01:26:46 +08:00
chunkFormat? : string | false ;
2020-08-26 03:45:56 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Number of milliseconds before chunk request expires .
* /
chunkLoadTimeout? : number ;
2020-03-21 21:01:38 +08:00
2020-08-25 19:37:40 +08:00
/ * *
* The method of loading chunks ( methods included by default are 'jsonp' ( web ) , 'importScripts' ( WebWorker ) , 'require' ( sync node . js ) , 'async-node' ( async node . js ) , but others might be added by plugins ) .
* /
2020-12-17 01:26:46 +08:00
chunkLoading? : string | false ;
2020-08-25 19:37:40 +08:00
2020-08-25 15:16:49 +08:00
/ * *
* The global variable used by webpack for loading of chunks .
* /
chunkLoadingGlobal? : string ;
2020-04-21 14:45:35 +08:00
/ * *
* Check if to be emitted file already exists and have the same content before writing to output filesystem .
* /
compareBeforeEmit? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* This option enables cross - origin loading of chunks .
* /
2020-12-17 01:26:46 +08:00
crossOriginLoading? : false | "anonymous" | "use-credentials" ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Similar to ` output.devtoolModuleFilenameTemplate ` , but used in the case of duplicate module identifiers.
* /
2020-12-17 01:26:46 +08:00
devtoolFallbackModuleFilenameTemplate? : string | Function ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Filename template string of function for the sources array in a generated SourceMap .
* /
2020-12-17 01:26:46 +08:00
devtoolModuleFilenameTemplate? : string | Function ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Module namespace to use when interpolating filename template string for the sources array in a generated SourceMap . Defaults to ` output.library ` if not set . It ' s useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries .
* /
devtoolNamespace? : string ;
2020-03-21 21:01:38 +08:00
2020-08-26 03:45:56 +08:00
/ * *
* List of chunk loading types enabled for use by entry points .
* /
enabledChunkLoadingTypes? : string [ ] ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* List of library types enabled for use by entry points .
2020-03-21 21:01:38 +08:00
* /
2020-08-26 03:45:56 +08:00
enabledLibraryTypes? : string [ ] ;
2020-03-21 21:01:38 +08:00
2020-09-09 15:23:01 +08:00
/ * *
* List of wasm loading types enabled for use by entry points .
* /
enabledWasmLoadingTypes? : string [ ] ;
2020-09-09 22:37:53 +08:00
/ * *
* The abilities of the environment where the webpack generated code should run .
* /
environment? : Environment ;
2020-04-21 14:45:35 +08:00
/ * *
* Specifies the name of each output file on disk . You must * * not * * specify an absolute path here ! The ` output.path ` option determines the location on disk the files are written to , filename is used solely for naming the individual files .
* /
2020-12-17 01:26:46 +08:00
filename? : string | ( ( pathData : PathData , assetInfo? : AssetInfo ) = > string ) ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* An expression which is used to address the global object / scope in runtime code .
* /
globalObject? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Digest type used for the hash .
* /
hashDigest? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Number of chars which are used for the hash .
* /
hashDigestLength? : number ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Algorithm used for generation the hash ( see node . js crypto package ) .
2020-03-21 21:01:38 +08:00
* /
2020-12-17 01:26:46 +08:00
hashFunction? : string | typeof Hash ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Any string which is added to the hash to salt it .
* /
hashSalt? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The filename of the Hot Update Chunks . They are inside the output . path directory .
* /
hotUpdateChunkFilename? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
2020-08-25 15:16:49 +08:00
* The global variable used by webpack for loading of hot update chunks .
2020-04-21 14:45:35 +08:00
* /
2020-08-25 15:16:49 +08:00
hotUpdateGlobal? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The filename of the Hot Update Main File . It is inside the ` output.path ` directory .
* /
hotUpdateMainFilename? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Wrap javascript code into IIFE ' s to avoid leaking into global scope .
* /
iife? : boolean ;
2020-03-21 21:01:38 +08:00
2020-05-15 22:24:11 +08:00
/ * *
* The name of the native import ( ) function ( can be exchanged for a polyfill ) .
* /
importFunctionName? : string ;
2020-09-18 16:55:37 +08:00
/ * *
* The name of the native import . meta object ( can be exchanged for a polyfill ) .
* /
importMetaName? : string ;
2020-04-21 14:45:35 +08:00
/ * *
* Options for library .
* /
library? : LibraryOptions ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Output javascript files as module source type .
* /
module ? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The output directory as * * absolute path * * ( required ) .
* /
path? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Include comments with information about the module s.
* /
2020-12-17 01:26:46 +08:00
pathinfo? : boolean | "verbose" ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The ` publicPath ` specifies the public URL address of the output files when referenced in a browser .
* /
2020-12-17 01:26:46 +08:00
publicPath? : string | ( ( pathData : PathData , assetInfo? : AssetInfo ) = > string ) ;
2020-03-21 21:01:38 +08:00
2020-06-25 04:05:21 +08:00
/ * *
* This option enables loading async chunks via a custom script type , such as script type = "module" .
* /
2020-12-17 01:26:46 +08:00
scriptType? : false | "module" | "text/javascript" ;
2020-06-25 04:05:21 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The filename of the SourceMaps for the JavaScript files . They are inside the ` output.path ` directory .
* /
sourceMapFilename? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Prefixes every line of the source in the bundle with this string .
* /
sourcePrefix? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Handles exceptions in module loading correctly at a performance cost .
* /
strictModuleExceptionHandling? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals .
* /
uniqueName? : string ;
2020-03-21 21:01:38 +08:00
2020-09-09 15:23:01 +08:00
/ * *
* 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 ) .
* /
2020-12-17 01:26:46 +08:00
wasmLoading? : string | false ;
2020-09-09 15:23:01 +08:00
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* The filename of WebAssembly module s as relative path inside the ` output.path ` directory .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
webassemblyModuleFilename? : string ;
2020-09-08 00:02:14 +08:00
/ * *
* The method of loading chunks ( methods included by default are 'jsonp' ( web ) , 'importScripts' ( WebWorker ) , 'require' ( sync node . js ) , 'async-node' ( async node . js ) , but others might be added by plugins ) .
* /
2020-12-17 01:26:46 +08:00
workerChunkLoading? : string | false ;
2020-09-09 15:23:01 +08:00
/ * *
* 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 ) .
* /
2020-12-17 01:26:46 +08:00
workerWasmLoading? : string | false ;
2020-04-21 14:45:35 +08:00
}
2020-11-26 17:49:59 +08:00
declare interface ParameterizedComparator < TArg , T > {
( arg0 : TArg ) : Comparator < T > ;
}
2020-06-17 19:22:37 +08:00
declare interface ParsedIdentifier {
request : string ;
query : string ;
fragment : string ;
directory : boolean ;
module : boolean ;
file : boolean ;
2020-09-16 12:58:59 +08:00
internal : boolean ;
2020-06-17 19:22:37 +08:00
}
2020-04-21 14:45:35 +08:00
declare class Parser {
constructor ( ) ;
parse (
source : string | Record < string , any > | Buffer ,
2020-11-26 17:49:59 +08:00
state : ParserState
) : ParserState ;
2020-04-21 14:45:35 +08:00
}
2020-11-26 17:49:59 +08:00
type ParserState = Record < string , any > & ParserStateBase ;
2020-04-21 14:45:35 +08:00
declare interface ParserStateBase {
current : NormalModule ;
module : NormalModule ;
compilation : Compilation ;
2020-08-03 02:09:36 +08:00
options : { [ index : string ] : any } ;
2020-04-21 14:45:35 +08:00
}
declare interface PathData {
chunkGraph? : ChunkGraph ;
hash? : string ;
hashWithLength ? : ( arg0 : number ) = > string ;
chunk? : Chunk | ChunkPathData ;
module ? : Module | ModulePathData ;
2020-11-26 17:49:59 +08:00
runtime? : RuntimeSpec ;
2020-04-21 14:45:35 +08:00
filename? : string ;
basename? : string ;
query? : string ;
contentHashType? : string ;
contentHash? : string ;
contentHashWithLength ? : ( arg0 : number ) = > string ;
noChunkHash? : boolean ;
url? : string ;
}
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Configuration object for web performance recommendations .
* /
declare interface PerformanceOptions {
/ * *
* Filter function to select assets that are checked .
* /
assetFilter? : Function ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Sets the format of the hints : warnings , errors or nothing at all .
* /
hints? : false | "error" | "warning" ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* File size limit ( in bytes ) when exceeded , that webpack will provide performance hints .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
maxAssetSize? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Total size of an entry point ( in bytes ) .
* /
maxEntrypointSize? : number ;
}
2020-06-17 19:22:37 +08:00
declare interface PnpApiImpl {
resolveToUnqualified : ( arg0 : string , arg1 : string , arg2? : any ) = > string ;
}
declare interface PossibleFileSystemError {
code? : string ;
errno? : number ;
path? : string ;
syscall? : string ;
}
2020-04-21 14:45:35 +08:00
declare class PrefetchPlugin {
constructor ( context? : any , request? : any ) ;
context : any ;
request : any ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
2020-08-20 02:05:47 +08:00
declare class PrefixSource extends Source {
constructor ( prefix : string , source : string | Source ) ;
original ( ) : Source ;
getPrefix ( ) : string ;
}
2020-04-21 14:45:35 +08:00
declare interface PrintedElement {
element : string ;
content : string ;
}
declare interface Problem {
2020-11-26 17:49:59 +08:00
type : ProblemType ;
2020-04-21 14:45:35 +08:00
path : string ;
argument : string ;
value? : any ;
index? : number ;
expected? : string ;
}
2020-11-26 17:49:59 +08:00
type ProblemType =
| "unknown-argument"
| "unexpected-non-array-in-path"
| "unexpected-non-object-in-path"
| "multiple-values-unexpected"
| "invalid-value" ;
declare interface ProcessAssetsAdditionalOptions {
additionalAssets? : true | Function ;
}
2020-04-21 14:45:35 +08:00
declare class Profiler {
constructor ( inspector? : any ) ;
session : any ;
inspector : any ;
hasSession ( ) : boolean ;
startProfiling ( ) : Promise < void > | Promise < [ any , any , any ] > ;
sendCommand ( method? : any , params? : any ) : Promise < any > ;
destroy ( ) : Promise < void > ;
stopProfiling ( ) : Promise < any > ;
}
declare class ProfilingPlugin {
constructor ( options? : ProfilingPluginOptions ) ;
outputPath : string ;
apply ( compiler? : any ) : void ;
static Profiler : typeof Profiler ;
}
declare interface ProfilingPluginOptions {
/ * *
* Path to the output file e . g . ` path.resolve(__dirname, 'profiling/events.json') ` . Defaults to ` events.json ` .
* /
outputPath? : string ;
}
declare class ProgressPlugin {
constructor ( options : ProgressPluginArgument ) ;
2020-12-17 01:26:46 +08:00
profile? : null | boolean ;
handler ? : ( percentage : number , msg : string , . . . args : string [ ] ) = > void ;
module sCount? : number ;
dependenciesCount? : number ;
showEntries? : boolean ;
showModules? : boolean ;
showDependencies? : boolean ;
showActiveModules? : boolean ;
percentBy? : null | "dependencies" | "modules" | "entries" ;
2020-04-21 14:45:35 +08:00
apply ( compiler : Compiler | MultiCompiler ) : void ;
static getReporter (
compiler : Compiler
2020-04-23 17:43:38 +08:00
) : ( p : number , . . . args : string [ ] ) = > void ;
2020-04-21 14:45:35 +08:00
static defaultOptions : {
profile : boolean ;
module sCount : number ;
dependenciesCount : number ;
module s : boolean ;
dependencies : boolean ;
activeModules : boolean ;
entries : boolean ;
} ;
}
type ProgressPluginArgument =
| ProgressPluginOptions
2020-04-23 17:43:38 +08:00
| ( ( percentage : number , msg : string , . . . args : string [ ] ) = > void ) ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options object for the ProgressPlugin .
* /
declare interface ProgressPluginOptions {
/ * *
* Show active module s count and one active module in progress message .
* /
activeModules? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Show dependencies count in progress message .
* /
dependencies? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Minimum dependencies count to start with . For better progress calculation . Default : 10000.
* /
dependenciesCount? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Show entries count in progress message .
* /
entries? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Function that executes for every progress step .
* /
2020-04-23 17:43:38 +08:00
handler ? : ( percentage : number , msg : string , . . . args : string [ ] ) = > void ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Show module s count in progress message .
* /
module s? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Minimum module s count to start with . For better progress calculation . Default : 5000.
* /
module sCount? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Collect percent algorithm . By default it calculates by a median from module s , entries and dependencies percent .
* /
2020-12-17 01:26:46 +08:00
percentBy? : null | "dependencies" | "modules" | "entries" ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Collect profile data for progress steps . Default : false.
* /
2020-12-17 01:26:46 +08:00
profile? : null | boolean ;
2020-04-21 14:45:35 +08:00
}
declare class ProvidePlugin {
2020-10-29 03:51:08 +08:00
constructor ( definitions : Record < string , EntryItem > ) ;
definitions : Record < string , EntryItem > ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
2020-05-25 16:50:37 +08:00
declare class ProvideSharedPlugin {
constructor ( options : ProvideSharedPluginOptions ) ;
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare interface ProvideSharedPluginOptions {
/ * *
2020-06-10 22:28:59 +08:00
* Modules that should be provided as shared module s to the share scope . When provided , property name is used to match module s , otherwise this is automatically inferred from share key .
2020-05-25 16:50:37 +08:00
* /
provides : Provides ;
/ * *
* Share scope name used for all provided module s ( defaults to 'default' ) .
* /
shareScope? : string ;
}
type Provides = ( string | ProvidesObject ) [ ] | ProvidesObject ;
/ * *
* Advanced configuration for module s that should be provided as shared module s to the share scope .
* /
declare interface ProvidesConfig {
2020-05-26 23:11:21 +08:00
/ * *
* Include the provided module directly instead behind an async request . This allows to use this shared module in initial load too . All possible shared module s need to be eager too .
* /
eager? : boolean ;
2020-05-25 16:50:37 +08:00
/ * *
2020-06-10 22:28:59 +08:00
* Key in the share scope under which the shared module s should be stored .
2020-05-25 16:50:37 +08:00
* /
2020-06-10 22:28:59 +08:00
shareKey? : string ;
2020-05-25 16:50:37 +08:00
/ * *
* Share scope name .
* /
shareScope? : string ;
2020-05-26 23:17:44 +08:00
/ * *
* Version of the provided module . Will replace lower matching versions , but not higher .
* /
2020-12-17 01:26:46 +08:00
version? : string | false ;
2020-05-25 16:50:37 +08:00
}
/ * *
* Modules that should be provided as shared module s to the share scope . Property names are used as share keys .
* /
declare interface ProvidesObject {
[ index : string ] : string | ProvidesConfig ;
}
2020-06-10 19:31:01 +08:00
declare interface RawChunkGroupOptions {
preloadOrder? : number ;
prefetchOrder? : number ;
}
2020-08-20 02:05:47 +08:00
declare class RawSource extends Source {
2020-11-26 17:48:16 +08:00
constructor ( source : string | Buffer , convertToString? : boolean ) ;
2020-08-20 02:05:47 +08:00
isBuffer ( ) : boolean ;
}
2020-04-21 14:45:35 +08:00
declare class ReadFileCompileWasmPlugin {
constructor ( options? : any ) ;
options : any ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
2020-11-09 18:58:18 +08:00
declare class RealContentHashPlugin {
constructor ( __0 : { hashFunction : any ; hashDigest : any } ) ;
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
static getCompilationHooks (
compilation : Compilation
) : CompilationHooksRealContentHashPlugin ;
}
2020-04-21 14:45:35 +08:00
declare interface RealDependencyLocation {
start : SourcePosition ;
end? : SourcePosition ;
index? : number ;
}
2020-11-26 17:48:16 +08:00
type RecursiveArrayOrRecord < T > =
| { [ index : string ] : RecursiveArrayOrRecord < T > }
| RecursiveArrayOrRecord < T > [ ]
| T ;
2020-06-10 19:31:01 +08:00
declare interface ReferencedExport {
2020-05-28 02:34:55 +08:00
/ * *
* name of the referenced export
* /
2020-06-10 19:31:01 +08:00
name : string [ ] ;
2020-05-28 02:34:55 +08:00
/ * *
2020-06-10 19:31:01 +08:00
* when false , referenced export can not be mangled , defaults to true
2020-05-28 02:34:55 +08:00
* /
canMangle? : boolean ;
}
2020-05-14 21:50:35 +08:00
type Remotes = ( string | RemotesObject ) [ ] | RemotesObject ;
/ * *
* Advanced configuration for container locations from which module s should be resolved and loaded at runtime .
* /
declare interface RemotesConfig {
/ * *
* Container locations from which module s should be resolved and loaded at runtime .
* /
external : string | string [ ] ;
2020-05-26 23:11:21 +08:00
/ * *
* The name of the share scope shared with this remote .
* /
shareScope? : string ;
2020-05-14 21:50:35 +08:00
}
/ * *
* Container locations from which module s should be resolved and loaded at runtime . Property names are used as request scopes .
* /
declare interface RemotesObject {
[ index : string ] : string | RemotesConfig | string [ ] ;
}
2020-04-21 14:45:35 +08:00
declare interface RenderBootstrapContext {
/ * *
* the chunk
* /
chunk : Chunk ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* the runtime template
* /
runtimeTemplate : RuntimeTemplate ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* the module graph
* /
module Graph : ModuleGraph ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* the chunk graph
* /
chunkGraph : ChunkGraph ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* hash to be used for render call
* /
hash : string ;
}
2020-05-08 05:29:42 +08:00
declare interface RenderContextModuleTemplate {
2020-04-21 14:45:35 +08:00
/ * *
* the chunk
* /
chunk : Chunk ;
/ * *
* the dependency templates
* /
dependencyTemplates : DependencyTemplates ;
/ * *
* the runtime template
* /
runtimeTemplate : RuntimeTemplate ;
/ * *
* the module graph
* /
module Graph : ModuleGraph ;
/ * *
* the chunk graph
* /
chunkGraph : ChunkGraph ;
}
2020-05-08 05:29:42 +08:00
declare interface RenderContextObject {
2020-04-21 14:45:35 +08:00
/ * *
* the chunk
* /
chunk : Chunk ;
/ * *
* the dependency templates
* /
dependencyTemplates : DependencyTemplates ;
/ * *
* the runtime template
* /
runtimeTemplate : RuntimeTemplate ;
/ * *
* the module graph
* /
module Graph : ModuleGraph ;
/ * *
* the chunk graph
* /
chunkGraph : ChunkGraph ;
2020-05-08 05:29:42 +08:00
/ * *
* results of code generation
* /
2020-07-28 00:09:48 +08:00
codeGenerationResults : CodeGenerationResults ;
2020-04-21 14:45:35 +08:00
}
2020-11-26 17:49:59 +08:00
type RenderManifestEntry =
| RenderManifestEntryTemplated
| RenderManifestEntryStatic ;
2020-07-17 20:57:11 +08:00
declare interface RenderManifestEntryStatic {
render : ( ) = > Source ;
filename : string ;
info : AssetInfo ;
identifier : string ;
hash? : string ;
auxiliary? : boolean ;
}
declare interface RenderManifestEntryTemplated {
2020-04-21 14:45:35 +08:00
render : ( ) = > Source ;
2020-12-17 01:26:46 +08:00
filenameTemplate : string | ( ( arg0 : PathData , arg1? : AssetInfo ) = > string ) ;
2020-04-21 14:45:35 +08:00
pathOptions? : PathData ;
2020-10-22 15:35:14 +08:00
info? : AssetInfo ;
2020-04-21 14:45:35 +08:00
identifier : string ;
hash? : string ;
auxiliary? : boolean ;
}
declare interface RenderManifestOptions {
/ * *
* the chunk used to render
* /
chunk : Chunk ;
hash : string ;
fullHash : string ;
2020-08-03 02:09:36 +08:00
outputOptions : Output ;
2020-07-28 00:09:48 +08:00
codeGenerationResults : CodeGenerationResults ;
2020-04-21 14:45:35 +08:00
module Templates : { javascript : ModuleTemplate } ;
dependencyTemplates : DependencyTemplates ;
runtimeTemplate : RuntimeTemplate ;
module Graph : ModuleGraph ;
chunkGraph : ChunkGraph ;
}
2020-08-20 02:05:47 +08:00
declare class ReplaceSource extends Source {
2020-11-26 17:48:16 +08:00
constructor ( source : Source , name? : string ) ;
replace ( start : number , end : number , newValue : string , name? : string ) : void ;
insert ( pos : number , newValue : string , name? : string ) : void ;
2020-04-21 14:45:35 +08:00
getName ( ) : string ;
original ( ) : string ;
2020-04-23 17:43:38 +08:00
getReplacements ( ) : {
2020-04-21 14:45:35 +08:00
start : number ;
end : number ;
content : string ;
insertIndex : number ;
name : string ;
2020-04-23 17:43:38 +08:00
} [ ] ;
2020-04-21 14:45:35 +08:00
}
declare abstract class RequestShortener {
contextify : ( arg0 : string ) = > string ;
2020-12-17 01:26:46 +08:00
shorten ( request? : null | string ) : undefined | null | string ;
2020-04-21 14:45:35 +08:00
}
declare interface ResolveBuildDependenciesResult {
/ * *
* list of files
* /
files : Set < string > ;
/ * *
* list of directories
* /
directories : Set < string > ;
/ * *
* list of missing entries
* /
missing : Set < string > ;
/ * *
* stored resolve results
* /
resolveResults : Map < string , string > ;
/ * *
* dependencies of the resolving
* /
resolveDependencies : {
/ * *
* list of files
* /
files : Set < string > ;
/ * *
* list of directories
* /
directories : Set < string > ;
/ * *
* list of missing entries
* /
missing : Set < string > ;
} ;
}
2020-06-17 19:22:37 +08:00
/ * *
* Resolve context
* /
2020-04-21 14:45:35 +08:00
declare interface ResolveContext {
2020-06-17 19:22:37 +08:00
contextDependencies ? : { add : ( T? : any ) = > void } ;
/ * *
* files that was found on file system
* /
fileDependencies ? : { add : ( T? : any ) = > void } ;
/ * *
* dependencies that was not found on file system
* /
missingDependencies ? : { add : ( T? : any ) = > void } ;
/ * *
* set of hooks ' calls . For instance , ` resolve → parsedResolve → describedResolve ` ,
* /
2020-04-21 14:45:35 +08:00
stack? : Set < string > ;
2020-06-17 19:22:37 +08:00
/ * *
* log function
* /
log ? : ( arg0 : string ) = > void ;
2020-04-21 14:45:35 +08:00
}
declare interface ResolveData {
contextInfo : ModuleFactoryCreateDataContextInfo ;
2020-12-17 01:26:46 +08:00
resolveOptions? : ResolveOptionsWebpackOptions ;
2020-04-21 14:45:35 +08:00
context : string ;
request : string ;
2020-04-23 17:43:38 +08:00
dependencies : ModuleDependency [ ] ;
2020-12-17 01:26:46 +08:00
createData : Object ;
2020-04-21 14:45:35 +08:00
fileDependencies : LazySet < string > ;
missingDependencies : LazySet < string > ;
contextDependencies : LazySet < string > ;
2020-06-24 20:09:10 +08:00
/ * *
* allow to use the unsafe cache
* /
cacheable : boolean ;
2020-04-21 14:45:35 +08:00
}
2020-06-17 19:22:37 +08:00
declare interface ResolveOptionsTypes {
alias : {
/ * *
* New request .
* /
2020-10-29 03:51:08 +08:00
alias : Target ;
2020-06-17 19:22:37 +08:00
/ * *
* Request to be redirected .
* /
name : string ;
/ * *
* Redirect only exact matching request .
* /
onlyModule? : boolean ;
} [ ] ;
2020-09-16 12:58:59 +08:00
fallback : {
/ * *
* New request .
* /
2020-10-29 03:51:08 +08:00
alias : Target ;
2020-09-16 12:58:59 +08:00
/ * *
* Request to be redirected .
* /
name : string ;
/ * *
* Redirect only exact matching request .
* /
onlyModule? : boolean ;
} [ ] ;
2020-10-29 03:51:08 +08:00
aliasFields : Set < EntryItem > ;
2020-06-17 19:22:37 +08:00
cachePredicate : ( arg0 : ResolveRequest ) = > boolean ;
cacheWithContext : boolean ;
/ * *
* A list of exports field condition names .
* /
conditionNames : Set < string > ;
descriptionFiles : string [ ] ;
enforceExtension : boolean ;
2020-10-29 03:51:08 +08:00
exportsFields : Set < EntryItem > ;
importsFields : Set < EntryItem > ;
2020-06-17 19:22:37 +08:00
extensions : Set < string > ;
fileSystem : FileSystem ;
unsafeCache : any ;
symlinks : boolean ;
resolver? : Resolver ;
2020-10-29 03:51:08 +08:00
module s : EntryItem [ ] ;
2020-06-17 19:22:37 +08:00
mainFields : { name : string [ ] ; forceRelative : boolean } [ ] ;
mainFiles : Set < string > ;
plugins : (
| { apply : ( arg0 : Resolver ) = > void }
| ( ( this : Resolver , arg1 : Resolver ) = > void )
) [ ] ;
2020-12-17 01:26:46 +08:00
pnpApi : null | PnpApiImpl ;
2020-07-09 05:12:45 +08:00
roots : Set < string > ;
2020-07-17 16:27:48 +08:00
fullySpecified : boolean ;
2020-06-17 19:22:37 +08:00
resolveToContext : boolean ;
restrictions : Set < string | RegExp > ;
2020-09-29 02:43:03 +08:00
preferRelative : boolean ;
2020-06-17 19:22:37 +08:00
}
2020-04-21 14:45:35 +08:00
/ * *
* Options object for resolving requests .
* /
2020-06-17 19:22:37 +08:00
declare interface ResolveOptionsWebpackOptions {
2020-04-21 14:45:35 +08:00
/ * *
* Redirect module requests.
* /
2020-12-17 01:26:46 +08:00
alias ? :
| {
/ * *
* New request .
* /
alias : Target ;
/ * *
* Request to be redirected .
* /
name : string ;
/ * *
* Redirect only exact matching request .
* /
onlyModule? : boolean ;
} [ ]
| { [ index : string ] : Target } ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Fields in the description file ( usually package . json ) which are used to redirect requests inside the module .
* /
2020-10-29 03:51:08 +08:00
aliasFields? : EntryItem [ ] ;
2020-03-21 21:01:38 +08:00
2020-05-28 06:59:23 +08:00
/ * *
* Extra resolve options per dependency category . Typical categories are "commonjs" , "amd" , "esm" .
* /
2020-06-17 19:22:37 +08:00
byDependency ? : { [ index : string ] : ResolveOptionsWebpackOptions } ;
2020-05-28 06:59:23 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Enable caching of successfully resolved requests ( cache entries are revalidated ) .
* /
cache? : boolean ;
/ * *
* Predicate function to decide which requests should be cached .
* /
2020-06-18 04:17:14 +08:00
cachePredicate ? : ( request : ResolveRequest ) = > boolean ;
2020-04-21 14:45:35 +08:00
/ * *
* Include the context information in the cache identifier when caching .
* /
cacheWithContext? : boolean ;
2020-05-25 18:58:59 +08:00
/ * *
* Condition names for exports field entry point .
* /
conditionNames? : string [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* Filenames used to find a description file ( like a package . json ) .
* /
2020-04-23 17:43:38 +08:00
descriptionFiles? : string [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
2020-07-17 16:27:48 +08:00
* Enforce the resolver to use one of the extensions from the extensions option ( User must specify requests without extension ) .
2020-04-21 14:45:35 +08:00
* /
enforceExtension? : boolean ;
2020-05-25 18:58:59 +08:00
/ * *
2020-05-28 03:47:37 +08:00
* Field names from the description file ( usually package . json ) which are used to provide entry points of a package .
2020-05-25 18:58:59 +08:00
* /
exportsFields? : string [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* Extensions added to the request when trying to find the file .
* /
2020-04-23 17:43:38 +08:00
extensions? : string [ ] ;
2020-04-21 14:45:35 +08:00
2020-09-16 12:58:59 +08:00
/ * *
* Redirect module requests when normal resolving fails .
* /
2020-12-17 01:26:46 +08:00
fallback ? :
| {
/ * *
* New request .
* /
alias : Target ;
/ * *
* Request to be redirected .
* /
name : string ;
/ * *
* Redirect only exact matching request .
* /
onlyModule? : boolean ;
} [ ]
| { [ index : string ] : Target } ;
2020-09-16 12:58:59 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Filesystem for the resolver .
* /
2020-06-18 04:17:14 +08:00
fileSystem? : InputFileSystem ;
2020-04-21 14:45:35 +08:00
2020-07-17 16:27:48 +08:00
/ * *
* Treats the request specified by the user as fully specified , meaning no extensions are added and the mainFiles in directories are not resolved ( This doesn ' t affect requests from mainFields , aliasFields or aliases ) .
* /
fullySpecified? : boolean ;
2020-09-16 12:58:59 +08:00
/ * *
* Field names from the description file ( usually package . json ) which are used to provide internal request of a package ( requests starting with # are considered as internal ) .
* /
importsFields? : string [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* Field names from the description file ( package . json ) which are used to find the default entry point .
* /
2020-10-29 03:51:08 +08:00
mainFields? : EntryItem [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* Filenames used to find the default entry point if there is no description file or main field .
* /
2020-04-23 17:43:38 +08:00
mainFiles? : string [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* Folder names or directory paths where to find module s.
* /
2020-04-23 17:43:38 +08:00
module s? : string [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* Plugins for the resolver .
* /
2020-07-11 16:30:18 +08:00
plugins ? : ( "..." | ResolvePluginInstance ) [ ] ;
2020-04-21 14:45:35 +08:00
2020-09-29 02:43:03 +08:00
/ * *
* Prefer to resolve module requests as relative request and fallback to resolving as module .
* /
preferRelative? : boolean ;
2020-04-21 14:45:35 +08:00
/ * *
* Custom resolver .
* /
2020-06-18 04:17:14 +08:00
resolver? : Resolver ;
2020-04-21 14:45:35 +08:00
2020-06-09 04:54:59 +08:00
/ * *
2020-07-09 14:55:52 +08:00
* A list of resolve restrictions . Resolve results must fulfill all of these restrictions to resolve successfully . Other resolve paths are taken when restrictions are not met .
2020-06-09 04:54:59 +08:00
* /
restrictions ? : ( string | RegExp ) [ ] ;
2020-07-09 05:12:45 +08:00
/ * *
2020-07-09 14:55:52 +08:00
* A list of directories in which requests that are server - relative URLs ( starting with '/' ) are resolved . On non - windows system these requests are tried to resolve as absolute path first .
2020-07-09 05:12:45 +08:00
* /
roots? : string [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* Enable resolving symlinks to the original location .
* /
symlinks? : boolean ;
/ * *
* Enable caching of successfully resolved requests ( cache entries are not revalidated ) .
* /
unsafeCache? : boolean | { [ index : string ] : any } ;
/ * *
* Use synchronous filesystem calls for the resolver .
* /
useSyncFileSystemCalls? : boolean ;
}
2020-11-26 17:49:59 +08:00
/ * *
* Options object for resolving requests .
* /
declare interface ResolveOptionsWithDependencyType {
/ * *
* Redirect module requests.
* /
2020-12-17 01:26:46 +08:00
alias ? :
| {
/ * *
* New request .
* /
alias : Target ;
/ * *
* Request to be redirected .
* /
name : string ;
/ * *
* Redirect only exact matching request .
* /
onlyModule? : boolean ;
} [ ]
| { [ index : string ] : Target } ;
2020-11-26 17:49:59 +08:00
/ * *
* Fields in the description file ( usually package . json ) which are used to redirect requests inside the module .
* /
aliasFields? : EntryItem [ ] ;
/ * *
* Extra resolve options per dependency category . Typical categories are "commonjs" , "amd" , "esm" .
* /
byDependency ? : { [ index : string ] : ResolveOptionsWebpackOptions } ;
/ * *
* Enable caching of successfully resolved requests ( cache entries are revalidated ) .
* /
cache? : boolean ;
/ * *
* Predicate function to decide which requests should be cached .
* /
cachePredicate ? : ( request : ResolveRequest ) = > boolean ;
/ * *
* Include the context information in the cache identifier when caching .
* /
cacheWithContext? : boolean ;
/ * *
* Condition names for exports field entry point .
* /
conditionNames? : string [ ] ;
/ * *
* Filenames used to find a description file ( like a package . json ) .
* /
descriptionFiles? : string [ ] ;
/ * *
* Enforce the resolver to use one of the extensions from the extensions option ( User must specify requests without extension ) .
* /
enforceExtension? : boolean ;
/ * *
* Field names from the description file ( usually package . json ) which are used to provide entry points of a package .
* /
exportsFields? : string [ ] ;
/ * *
* Extensions added to the request when trying to find the file .
* /
extensions? : string [ ] ;
/ * *
* Redirect module requests when normal resolving fails .
* /
2020-12-17 01:26:46 +08:00
fallback ? :
| {
/ * *
* New request .
* /
alias : Target ;
/ * *
* Request to be redirected .
* /
name : string ;
/ * *
* Redirect only exact matching request .
* /
onlyModule? : boolean ;
} [ ]
| { [ index : string ] : Target } ;
2020-11-26 17:49:59 +08:00
/ * *
* Filesystem for the resolver .
* /
fileSystem? : InputFileSystem ;
/ * *
* Treats the request specified by the user as fully specified , meaning no extensions are added and the mainFiles in directories are not resolved ( This doesn ' t affect requests from mainFields , aliasFields or aliases ) .
* /
fullySpecified? : boolean ;
/ * *
* Field names from the description file ( usually package . json ) which are used to provide internal request of a package ( requests starting with # are considered as internal ) .
* /
importsFields? : string [ ] ;
/ * *
* Field names from the description file ( package . json ) which are used to find the default entry point .
* /
mainFields? : EntryItem [ ] ;
/ * *
* Filenames used to find the default entry point if there is no description file or main field .
* /
mainFiles? : string [ ] ;
/ * *
* Folder names or directory paths where to find module s.
* /
module s? : string [ ] ;
/ * *
* Plugins for the resolver .
* /
plugins ? : ( "..." | ResolvePluginInstance ) [ ] ;
/ * *
* Prefer to resolve module requests as relative request and fallback to resolving as module .
* /
preferRelative? : boolean ;
/ * *
* Custom resolver .
* /
resolver? : Resolver ;
/ * *
* A list of resolve restrictions . Resolve results must fulfill all of these restrictions to resolve successfully . Other resolve paths are taken when restrictions are not met .
* /
restrictions ? : ( string | RegExp ) [ ] ;
/ * *
* A list of directories in which requests that are server - relative URLs ( starting with '/' ) are resolved . On non - windows system these requests are tried to resolve as absolute path first .
* /
roots? : string [ ] ;
/ * *
* Enable resolving symlinks to the original location .
* /
symlinks? : boolean ;
/ * *
* Enable caching of successfully resolved requests ( cache entries are not revalidated ) .
* /
unsafeCache? : boolean | { [ index : string ] : any } ;
/ * *
* Use synchronous filesystem calls for the resolver .
* /
useSyncFileSystemCalls? : boolean ;
dependencyType? : string ;
resolveToContext? : boolean ;
}
2020-04-21 14:45:35 +08:00
/ * *
* Plugin instance .
* /
declare interface ResolvePluginInstance {
[ index : string ] : any ;
/ * *
* The run point of the plugin , required method .
* /
2020-12-18 20:52:15 +08:00
apply : ( resolver : Resolver ) = > void ;
2020-04-21 14:45:35 +08:00
}
2020-09-16 12:58:59 +08:00
type ResolveRequest = BaseResolveRequest & Partial < ParsedIdentifier > ;
2020-04-21 14:45:35 +08:00
declare abstract class Resolver {
2020-06-17 19:22:37 +08:00
fileSystem : FileSystem ;
options : ResolveOptionsTypes ;
hooks : {
2020-06-17 21:53:14 +08:00
resolveStep : SyncHook <
2020-06-17 19:22:37 +08:00
[
2020-12-17 01:26:46 +08:00
AsyncSeriesBailHook <
[ ResolveRequest , ResolveContext ] ,
null | ResolveRequest
> ,
2020-06-17 19:22:37 +08:00
ResolveRequest
2020-11-26 17:48:16 +08:00
]
2020-06-17 19:22:37 +08:00
> ;
2020-11-26 17:48:16 +08:00
noResolve : SyncHook < [ ResolveRequest , Error ] > ;
2020-06-17 21:53:14 +08:00
resolve : AsyncSeriesBailHook <
2020-06-17 19:22:37 +08:00
[ ResolveRequest , ResolveContext ] ,
2020-12-17 01:26:46 +08:00
null | ResolveRequest
2020-06-17 19:22:37 +08:00
> ;
2020-06-17 21:53:14 +08:00
result : AsyncSeriesHook < [ ResolveRequest , ResolveContext ] > ;
2020-06-17 19:22:37 +08:00
} ;
ensureHook (
name :
| string
2020-12-17 01:26:46 +08:00
| AsyncSeriesBailHook <
[ ResolveRequest , ResolveContext ] ,
null | ResolveRequest
>
) : AsyncSeriesBailHook <
[ ResolveRequest , ResolveContext ] ,
null | ResolveRequest
> ;
2020-06-17 19:22:37 +08:00
getHook (
name :
| string
2020-12-17 01:26:46 +08:00
| AsyncSeriesBailHook <
[ ResolveRequest , ResolveContext ] ,
null | ResolveRequest
>
) : AsyncSeriesBailHook <
[ ResolveRequest , ResolveContext ] ,
null | ResolveRequest
> ;
2020-06-17 19:22:37 +08:00
resolveSync ( context : any , path : string , request : string ) : DevTool ;
2020-04-21 14:45:35 +08:00
resolve (
2020-06-17 19:22:37 +08:00
context : any ,
2020-04-21 14:45:35 +08:00
path : string ,
request : string ,
resolveContext : ResolveContext ,
2020-12-17 01:26:46 +08:00
callback : (
arg0 : null | Error ,
arg1? : string | false ,
arg2? : ResolveRequest
) = > void
2020-04-21 14:45:35 +08:00
) : void ;
2020-06-17 19:22:37 +08:00
doResolve (
hook? : any ,
request? : any ,
message? : any ,
resolveContext? : any ,
callback? : any
) : any ;
parse ( identifier : string ) : ParsedIdentifier ;
isModule ( path? : any ) : boolean ;
2020-09-16 12:58:59 +08:00
isPrivate ( path? : any ) : boolean ;
2020-06-17 19:22:37 +08:00
isDirectory ( path : string ) : boolean ;
join ( path? : any , request? : any ) : string ;
normalize ( path? : any ) : string ;
2020-04-21 14:45:35 +08:00
}
declare interface ResolverCache {
2020-12-17 01:26:46 +08:00
direct : WeakMap < Object , ResolverWithOptions > ;
2020-11-26 17:49:59 +08:00
stringified : Map < string , ResolverWithOptions > ;
2020-04-21 14:45:35 +08:00
}
declare abstract class ResolverFactory {
hooks : Readonly < {
2020-06-09 06:32:24 +08:00
resolveOptions : HookMap <
2020-11-26 17:49:59 +08:00
SyncWaterfallHook < [ ResolveOptionsWithDependencyType ] >
2020-06-09 06:32:24 +08:00
> ;
resolver : HookMap <
2020-11-26 17:49:59 +08:00
SyncHook < [ Resolver , UserResolveOptions , ResolveOptionsWithDependencyType ] >
2020-06-09 06:32:24 +08:00
> ;
2020-04-21 14:45:35 +08:00
} > ;
cache : Map < string , ResolverCache > ;
2020-05-28 06:59:23 +08:00
get (
type : string ,
2020-11-26 17:49:59 +08:00
resolveOptions? : ResolveOptionsWithDependencyType
) : ResolverWithOptions ;
}
type ResolverWithOptions = Resolver & WithOptions ;
declare interface ResourceDataWithData {
resource : string ;
path : string ;
query : string ;
fragment : string ;
data : Record < string , any > ;
2020-04-21 14:45:35 +08:00
}
declare interface RuleSet {
/ * *
* map of references in the rule set ( may grow over time )
* /
references : Map < string , any > ;
/ * *
* execute the rule set
* /
2020-12-18 20:52:15 +08:00
exec : ( arg0 : object ) = > Effect [ ] ;
2020-04-21 14:45:35 +08:00
}
type RuleSetCondition =
| string
| RegExp
| {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Logical AND .
2020-03-21 21:01:38 +08:00
* /
2020-04-23 17:43:38 +08:00
and? : RuleSetCondition [ ] ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Logical NOT .
2020-03-21 21:01:38 +08:00
* /
2020-04-23 17:43:38 +08:00
not? : RuleSetCondition [ ] ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Logical OR .
2020-03-21 21:01:38 +08:00
* /
2020-04-23 17:43:38 +08:00
or? : RuleSetCondition [ ] ;
2020-04-21 14:45:35 +08:00
}
2020-12-17 18:00:24 +08:00
| ( ( value : string ) = > boolean )
2020-04-23 17:43:38 +08:00
| RuleSetCondition [ ] ;
2020-04-21 14:45:35 +08:00
type RuleSetConditionAbsolute =
| string
| RegExp
| {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Logical AND .
2020-03-21 21:01:38 +08:00
* /
2020-04-23 17:43:38 +08:00
and? : RuleSetConditionAbsolute [ ] ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Logical NOT .
2020-03-21 21:01:38 +08:00
* /
2020-04-23 17:43:38 +08:00
not? : RuleSetConditionAbsolute [ ] ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Logical OR .
2020-03-21 21:01:38 +08:00
* /
2020-04-23 17:43:38 +08:00
or? : RuleSetConditionAbsolute [ ] ;
2020-04-21 14:45:35 +08:00
}
2020-12-17 18:00:24 +08:00
| ( ( value : string ) = > boolean )
2020-04-23 17:43:38 +08:00
| RuleSetConditionAbsolute [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* A rule description with conditions and effects for module s.
* /
declare interface RuleSetRule {
/ * *
* Match the child compiler name .
* /
2020-12-17 01:26:46 +08:00
compiler ? :
| string
| RegExp
| {
/ * *
* Logical AND .
* /
and? : RuleSetCondition [ ] ;
/ * *
* Logical NOT .
* /
not? : RuleSetCondition [ ] ;
/ * *
* Logical OR .
* /
or? : RuleSetCondition [ ] ;
}
2020-12-17 18:00:24 +08:00
| ( ( value : string ) = > boolean )
2020-12-17 01:26:46 +08:00
| RuleSetCondition [ ] ;
2020-04-21 14:45:35 +08:00
2020-08-05 05:42:29 +08:00
/ * *
* Match dependency type .
* /
2020-12-17 01:26:46 +08:00
dependency ? :
| string
| RegExp
| {
/ * *
* Logical AND .
* /
and? : RuleSetCondition [ ] ;
/ * *
* Logical NOT .
* /
not? : RuleSetCondition [ ] ;
/ * *
* Logical OR .
* /
or? : RuleSetCondition [ ] ;
}
2020-12-17 18:00:24 +08:00
| ( ( value : string ) = > boolean )
2020-12-17 01:26:46 +08:00
| RuleSetCondition [ ] ;
2020-08-05 05:42:29 +08:00
2020-07-17 16:27:48 +08:00
/ * *
* Match values of properties in the description file ( usually package . json ) .
* /
descriptionData ? : { [ index : string ] : RuleSetCondition } ;
2020-04-21 14:45:35 +08:00
/ * *
* Enforce this rule as pre or post step .
* /
enforce ? : "pre" | "post" ;
/ * *
* Shortcut for resource . exclude .
* /
2020-12-17 01:26:46 +08:00
exclude ? :
| string
| RegExp
| {
/ * *
* Logical AND .
* /
and? : RuleSetConditionAbsolute [ ] ;
/ * *
* Logical NOT .
* /
not? : RuleSetConditionAbsolute [ ] ;
/ * *
* Logical OR .
* /
or? : RuleSetConditionAbsolute [ ] ;
}
2020-12-17 18:00:24 +08:00
| ( ( value : string ) = > boolean )
2020-12-17 01:26:46 +08:00
| RuleSetConditionAbsolute [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* The options for the module generator.
* /
generator ? : { [ index : string ] : any } ;
/ * *
* Shortcut for resource . include .
* /
2020-12-17 01:26:46 +08:00
include ? :
| string
| RegExp
| {
/ * *
* Logical AND .
* /
and? : RuleSetConditionAbsolute [ ] ;
/ * *
* Logical NOT .
* /
not? : RuleSetConditionAbsolute [ ] ;
/ * *
* Logical OR .
* /
or? : RuleSetConditionAbsolute [ ] ;
}
2020-12-17 18:00:24 +08:00
| ( ( value : string ) = > boolean )
2020-12-17 01:26:46 +08:00
| RuleSetConditionAbsolute [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* Match the issuer of the module ( The module pointing to this module ) .
* /
2020-12-17 01:26:46 +08:00
issuer ? :
| string
| RegExp
| {
/ * *
* Logical AND .
* /
and? : RuleSetConditionAbsolute [ ] ;
/ * *
* Logical NOT .
* /
not? : RuleSetConditionAbsolute [ ] ;
/ * *
* Logical OR .
* /
or? : RuleSetConditionAbsolute [ ] ;
}
2020-12-17 18:00:24 +08:00
| ( ( value : string ) = > boolean )
2020-12-17 01:26:46 +08:00
| RuleSetConditionAbsolute [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* Shortcut for use . loader .
* /
loader? : string ;
2020-05-18 15:00:28 +08:00
/ * *
2020-06-05 19:41:25 +08:00
* Match module mimetype when load from Data URI .
2020-05-18 15:00:28 +08:00
* /
2020-12-17 01:26:46 +08:00
mimetype ? :
| string
| RegExp
| {
/ * *
* Logical AND .
* /
and? : RuleSetCondition [ ] ;
/ * *
* Logical NOT .
* /
not? : RuleSetCondition [ ] ;
/ * *
* Logical OR .
* /
or? : RuleSetCondition [ ] ;
}
2020-12-17 18:00:24 +08:00
| ( ( value : string ) = > boolean )
2020-12-17 01:26:46 +08:00
| RuleSetCondition [ ] ;
2020-05-18 15:00:28 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Only execute the first matching rule in this array .
* /
2020-04-23 17:43:38 +08:00
oneOf? : RuleSetRule [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* Shortcut for use . options .
* /
2020-12-17 01:26:46 +08:00
options? : string | { [ index : string ] : any } ;
2020-04-21 14:45:35 +08:00
/ * *
* Options for parsing .
* /
parser ? : { [ index : string ] : any } ;
/ * *
* Match the real resource path of the module .
* /
2020-12-17 01:26:46 +08:00
realResource ? :
| string
| RegExp
| {
/ * *
* Logical AND .
* /
and? : RuleSetConditionAbsolute [ ] ;
/ * *
* Logical NOT .
* /
not? : RuleSetConditionAbsolute [ ] ;
/ * *
* Logical OR .
* /
or? : RuleSetConditionAbsolute [ ] ;
}
2020-12-17 18:00:24 +08:00
| ( ( value : string ) = > boolean )
2020-12-17 01:26:46 +08:00
| RuleSetConditionAbsolute [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* Options for the resolver .
* /
2020-06-17 19:22:37 +08:00
resolve? : ResolveOptionsWebpackOptions ;
2020-04-21 14:45:35 +08:00
/ * *
* Match the resource path of the module .
* /
2020-12-17 01:26:46 +08:00
resource ? :
| string
| RegExp
| {
/ * *
* Logical AND .
* /
and? : RuleSetConditionAbsolute [ ] ;
/ * *
* Logical NOT .
* /
not? : RuleSetConditionAbsolute [ ] ;
/ * *
* Logical OR .
* /
or? : RuleSetConditionAbsolute [ ] ;
}
2020-12-17 18:00:24 +08:00
| ( ( value : string ) = > boolean )
2020-12-17 01:26:46 +08:00
| RuleSetConditionAbsolute [ ] ;
2020-04-21 14:45:35 +08:00
2020-07-03 23:03:15 +08:00
/ * *
* Match the resource fragment of the module .
* /
2020-12-17 01:26:46 +08:00
resourceFragment ? :
| string
| RegExp
| {
/ * *
* Logical AND .
* /
and? : RuleSetCondition [ ] ;
/ * *
* Logical NOT .
* /
not? : RuleSetCondition [ ] ;
/ * *
* Logical OR .
* /
or? : RuleSetCondition [ ] ;
}
2020-12-17 18:00:24 +08:00
| ( ( value : string ) = > boolean )
2020-12-17 01:26:46 +08:00
| RuleSetCondition [ ] ;
2020-07-03 23:03:15 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Match the resource query of the module .
* /
2020-12-17 01:26:46 +08:00
resourceQuery ? :
| string
| RegExp
| {
/ * *
* Logical AND .
* /
and? : RuleSetCondition [ ] ;
/ * *
* Logical NOT .
* /
not? : RuleSetCondition [ ] ;
/ * *
* Logical OR .
* /
or? : RuleSetCondition [ ] ;
}
2020-12-17 18:00:24 +08:00
| ( ( value : string ) = > boolean )
2020-12-17 01:26:46 +08:00
| RuleSetCondition [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* Match and execute these rules when this rule is matched .
* /
2020-04-23 17:43:38 +08:00
rules? : RuleSetRule [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* Flags a module as with or without side effects .
* /
sideEffects? : boolean ;
/ * *
* Shortcut for resource . test .
* /
2020-12-17 01:26:46 +08:00
test ? :
| string
| RegExp
| {
/ * *
* Logical AND .
* /
and? : RuleSetConditionAbsolute [ ] ;
/ * *
* Logical NOT .
* /
not? : RuleSetConditionAbsolute [ ] ;
/ * *
* Logical OR .
* /
or? : RuleSetConditionAbsolute [ ] ;
}
2020-12-17 18:00:24 +08:00
| ( ( value : string ) = > boolean )
2020-12-17 01:26:46 +08:00
| RuleSetConditionAbsolute [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* Module type to use for the module .
* /
type ? : string ;
/ * *
* Modifiers applied to the module when rule is matched .
* /
2020-12-17 01:26:46 +08:00
use ? :
| string
| RuleSetUseItem [ ]
| ( ( data : {
resource : string ;
realResource : string ;
resourceQuery : string ;
issuer : string ;
compiler : string ;
} ) = > RuleSetUseItem [ ] )
| {
/ * *
* Unique loader options identifier .
* /
ident? : string ;
/ * *
* Loader name .
* /
loader? : string ;
/ * *
* Loader options .
* /
options? : string | { [ index : string ] : any } ;
}
2020-12-18 20:52:15 +08:00
| ( (
data : object
) = >
2020-12-17 01:26:46 +08:00
| string
| {
/ * *
* Unique loader options identifier .
* /
ident? : string ;
/ * *
* Loader name .
* /
loader? : string ;
/ * *
* Loader options .
* /
options? : string | { [ index : string ] : any } ;
}
| __TypeWebpackOptions
| RuleSetUseItem [ ] ) ;
2020-04-21 14:45:35 +08:00
}
type RuleSetUse =
| string
2020-04-23 17:43:38 +08:00
| RuleSetUseItem [ ]
2020-04-21 14:45:35 +08:00
| ( ( data : {
resource : string ;
realResource : string ;
resourceQuery : string ;
issuer : string ;
compiler : string ;
2020-04-23 17:43:38 +08:00
} ) = > RuleSetUseItem [ ] )
2020-04-21 14:45:35 +08:00
| {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Unique loader options identifier .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
ident? : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Loader name .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
loader? : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Loader options .
2020-03-21 21:01:38 +08:00
* /
2020-12-17 01:26:46 +08:00
options? : string | { [ index : string ] : any } ;
2020-04-21 14:45:35 +08:00
}
2020-12-17 01:26:46 +08:00
| __TypeWebpackOptions ;
2020-04-21 14:45:35 +08:00
type RuleSetUseItem =
| string
| {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Unique loader options identifier .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
ident? : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Loader name .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
loader? : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Loader options .
2020-03-21 21:01:38 +08:00
* /
2020-12-17 01:26:46 +08:00
options? : string | { [ index : string ] : any } ;
2020-04-21 14:45:35 +08:00
}
| __TypeWebpackOptions ;
declare class RuntimeChunkPlugin {
constructor ( options? : any ) ;
options : any ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Apply the plugin
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
apply ( compiler : Compiler ) : void ;
}
declare class RuntimeModule extends Module {
constructor ( name : string , stage? : number ) ;
name : string ;
stage : number ;
compilation : Compilation ;
chunk : Chunk ;
2020-09-02 00:08:09 +08:00
fullHash : boolean ;
2020-04-21 14:45:35 +08:00
attach ( compilation : Compilation , chunk : Chunk ) : void ;
generate ( ) : string ;
getGeneratedCode ( ) : string ;
2020-07-02 23:02:48 +08:00
shouldIsolate ( ) : boolean ;
2020-12-11 21:32:42 +08:00
/ * *
* Runtime module s without any dependencies to other runtime module s
* /
static STAGE_NORMAL : number ;
/ * *
* Runtime module s with simple dependencies on other runtime module s
* /
static STAGE_BASIC : number ;
/ * *
* Runtime module s which attach to handlers of other runtime module s
* /
static STAGE_ATTACH : number ;
/ * *
* Runtime module s which trigger actions on bootstrap
* /
static STAGE_TRIGGER : number ;
2020-04-21 14:45:35 +08:00
}
2020-12-17 01:26:46 +08:00
type RuntimeSpec = undefined | string | SortableSet < string > ;
2020-07-28 00:09:48 +08:00
declare abstract class RuntimeSpecMap < T > {
2020-11-26 17:49:59 +08:00
get ( runtime : RuntimeSpec ) : T ;
has ( runtime : RuntimeSpec ) : boolean ;
2020-07-28 00:09:48 +08:00
set ( runtime? : any , value? : any ) : void ;
delete ( runtime? : any ) : void ;
update ( runtime? : any , fn? : any ) : void ;
2020-11-26 17:49:59 +08:00
keys ( ) : RuntimeSpec [ ] ;
2020-07-28 00:09:48 +08:00
values ( ) : IterableIterator < T > ;
}
declare abstract class RuntimeSpecSet {
add ( runtime? : any ) : void ;
2020-11-28 19:42:03 +08:00
has ( runtime? : any ) : boolean ;
2020-11-26 17:49:59 +08:00
[ Symbol . iterator ] ( ) : IterableIterator < RuntimeSpec > ;
2020-07-28 00:09:48 +08:00
readonly size : number ;
}
2020-04-21 14:45:35 +08:00
declare abstract class RuntimeTemplate {
2020-05-15 22:24:11 +08:00
outputOptions : OutputNormalized ;
2020-04-21 14:45:35 +08:00
requestShortener : RequestShortener ;
2020-12-17 01:26:46 +08:00
isIIFE ( ) : undefined | boolean ;
isModule ( ) : undefined | boolean ;
supportsConst ( ) : undefined | boolean ;
supportsArrowFunction ( ) : undefined | boolean ;
supportsForOf ( ) : undefined | boolean ;
supportsDestructuring ( ) : undefined | boolean ;
supportsBigIntLiteral ( ) : undefined | boolean ;
supportsDynamicImport ( ) : undefined | boolean ;
supportsEcmaScriptModuleSyntax ( ) : undefined | boolean ;
2020-09-17 04:07:06 +08:00
supportTemplateLiteral ( ) : boolean ;
2020-04-21 14:45:35 +08:00
returningFunction ( returnValue? : any , args? : string ) : string ;
basicFunction ( args? : any , body? : any ) : string ;
2020-12-11 21:32:42 +08:00
emptyFunction ( ) : "x => {}" | "function() {}" ;
2020-08-28 07:44:56 +08:00
destructureArray ( items? : any , value? : any ) : string ;
2020-04-21 14:45:35 +08:00
iife ( args? : any , body? : any ) : string ;
forEach ( variable? : any , array? : any , body? : any ) : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Add a comment
* /
comment ( __0 : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* request string used originally
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
request? : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* name of the chunk referenced
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
chunkName? : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* reason information of the chunk
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
chunkReason? : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* additional message
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
message? : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* name of the export
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
exportName? : string ;
} ) : string ;
throwMissingModuleErrorBlock ( __0 : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* request string used originally
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
request? : string ;
} ) : string ;
throwMissingModuleErrorFunction ( __0 : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* request string used originally
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
request? : string ;
} ) : string ;
missingModule ( __0 : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* request string used originally
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
request? : string ;
} ) : string ;
missingModuleStatement ( __0 : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* request string used originally
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
request? : string ;
} ) : string ;
missingModulePromise ( __0 : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* request string used originally
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
request? : string ;
} ) : string ;
weakError ( __0 : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the chunk graph
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
chunkGraph : ChunkGraph ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the module
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
module : Module ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the request that should be printed as comment
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
request : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* expression to use as id expression
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
idExpr? : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* which kind of code should be returned
2020-03-21 21:01:38 +08:00
* /
2020-05-15 22:24:11 +08:00
type : "promise" | "expression" | "statements" ;
2020-04-21 14:45:35 +08:00
} ) : string ;
module Id ( __0 : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the module
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
module : Module ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the chunk graph
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
chunkGraph : ChunkGraph ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the request that should be printed as comment
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
request : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* if the dependency is weak ( will create a nice error message )
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
weak? : boolean ;
} ) : string ;
module Raw ( __0 : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the module
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
module : Module ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the chunk graph
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
chunkGraph : ChunkGraph ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the request that should be printed as comment
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
request : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* if the dependency is weak ( will create a nice error message )
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
weak? : boolean ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* if set , will be filled with runtime requirements
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
runtimeRequirements : Set < string > ;
} ) : string ;
module Exports ( __0 : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the module
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
module : Module ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the chunk graph
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
chunkGraph : ChunkGraph ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the request that should be printed as comment
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
request : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* if the dependency is weak ( will create a nice error message )
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
weak? : boolean ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* if set , will be filled with runtime requirements
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
runtimeRequirements : Set < string > ;
} ) : string ;
module Namespace ( __0 : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the module
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
module : Module ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the chunk graph
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
chunkGraph : ChunkGraph ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the request that should be printed as comment
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
request : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* if the current module is in strict esm mode
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
strict? : boolean ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* if the dependency is weak ( will create a nice error message )
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
weak? : boolean ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* if set , will be filled with runtime requirements
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
runtimeRequirements : Set < string > ;
} ) : string ;
module NamespacePromise ( __0 : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the chunk graph
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
chunkGraph : ChunkGraph ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the current dependencies block
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
block? : AsyncDependenciesBlock ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the module
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
module : Module ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the request that should be printed as comment
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
request : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* a message for the comment
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
message : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* if the current module is in strict esm mode
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
strict? : boolean ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* if the dependency is weak ( will create a nice error message )
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
weak? : boolean ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* if set , will be filled with runtime requirements
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
runtimeRequirements : Set < string > ;
} ) : string ;
2020-10-23 20:52:23 +08:00
runtimeConditionExpression ( __0 : {
/ * *
* the chunk graph
* /
chunkGraph : ChunkGraph ;
/ * *
* runtime for which this code will be generated
* /
2020-11-26 17:49:59 +08:00
runtime? : RuntimeSpec ;
2020-10-23 20:52:23 +08:00
/ * *
* only execute the statement in some runtimes
* /
runtimeCondition? : string | boolean | SortableSet < string > ;
/ * *
* if set , will be filled with runtime requirements
* /
runtimeRequirements : Set < string > ;
} ) : string ;
2020-04-21 14:45:35 +08:00
importStatement ( __0 : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* whether a new variable should be created or the existing one updated
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
update? : boolean ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the module
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
module : Module ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the chunk graph
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
chunkGraph : ChunkGraph ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the request that should be printed as comment
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
request : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* name of the import variable
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
importVar : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* module in which the statement is emitted
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
originModule : Module ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* true , if this is a weak dependency
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
weak? : boolean ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* if set , will be filled with runtime requirements
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
runtimeRequirements : Set < string > ;
2020-05-15 22:24:11 +08:00
} ) : [ string , string ] ;
2020-04-21 14:45:35 +08:00
exportFromImport ( __0 : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the module graph
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
module Graph : ModuleGraph ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the module
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
module : Module ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the request
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
request : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the export name
2020-03-21 21:01:38 +08:00
* /
2020-10-29 03:51:08 +08:00
exportName : EntryItem ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the origin module
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
originModule : Module ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* true , if location is safe for ASI , a bracket can be emitted
2020-03-21 21:01:38 +08:00
* /
2020-12-17 01:26:46 +08:00
asiSafe? : boolean ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* true , if expression will be called
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
isCall : boolean ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* when false , call context will not be preserved
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
callContext : boolean ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* when true and accessing the default exports , interop code will be generated
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
defaultInterop : boolean ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the identifier name of the import variable
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
importVar : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* init fragments will be added here
2020-03-21 21:01:38 +08:00
* /
2020-04-23 17:43:38 +08:00
initFragments : InitFragment [ ] ;
2020-07-28 00:09:48 +08:00
/ * *
* runtime for which this code will be generated
* /
2020-11-26 17:49:59 +08:00
runtime : RuntimeSpec ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* if set , will be filled with runtime requirements
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
runtimeRequirements : Set < string > ;
} ) : string ;
blockPromise ( __0 : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the async block
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
block : AsyncDependenciesBlock ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the message
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
message : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the chunk graph
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
chunkGraph : ChunkGraph ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* if set , will be filled with runtime requirements
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
runtimeRequirements : Set < string > ;
} ) : string ;
2020-05-25 16:50:37 +08:00
asyncModuleFactory ( __0 : {
/ * *
* the async block
* /
block : AsyncDependenciesBlock ;
/ * *
* the chunk graph
* /
chunkGraph : ChunkGraph ;
/ * *
* if set , will be filled with runtime requirements
* /
runtimeRequirements : Set < string > ;
/ * *
* request string used originally
* /
request? : string ;
} ) : string ;
2020-05-26 23:11:21 +08:00
syncModuleFactory ( __0 : {
/ * *
* the dependency
* /
dependency : Dependency ;
/ * *
* the chunk graph
* /
chunkGraph : ChunkGraph ;
/ * *
* if set , will be filled with runtime requirements
* /
runtimeRequirements : Set < string > ;
/ * *
* request string used originally
* /
request? : string ;
} ) : string ;
2020-04-21 14:45:35 +08:00
defineEsModuleFlagStatement ( __0 : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* the name of the exports object
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
exportsArgument : string ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* if set , will be filled with runtime requirements
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
runtimeRequirements : Set < string > ;
} ) : string ;
}
declare abstract class RuntimeValue {
fn : any ;
fileDependencies : any ;
exec ( parser? : any ) : any ;
}
2020-12-17 17:41:28 +08:00
type Schema =
| ( JSONSchema4 & Extend )
| ( JSONSchema6 & Extend )
| ( JSONSchema7 & Extend ) ;
2020-04-21 14:45:35 +08:00
declare interface ScopeInfo {
definitions : StackedMap < string , ScopeInfo | VariableInfo > ;
topLevelScope : boolean | "arrow" ;
inShorthand : boolean ;
isStrict : boolean ;
isAsmJs : boolean ;
inTry : boolean ;
}
2020-11-26 17:49:59 +08:00
declare interface Selector < A , B > {
( input : A ) : B ;
}
2020-04-21 14:45:35 +08:00
declare abstract class Serializer {
serializeMiddlewares : any ;
deserializeMiddlewares : any ;
context : any ;
serialize ( obj? : any , context? : any ) : any ;
deserialize ( value? : any , context? : any ) : any ;
}
2020-05-26 23:11:21 +08:00
declare class SharePlugin {
constructor ( options : SharePluginOptions ) ;
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
/ * *
* Options for shared module s.
* /
declare interface SharePluginOptions {
/ * *
* Share scope name used for all shared module s ( defaults to 'default' ) .
* /
shareScope? : string ;
/ * *
* Modules that should be shared in the share scope . When provided , property names are used to match requested module s in this compilation .
* /
shared : Shared ;
}
2020-05-14 21:50:35 +08:00
type Shared = ( string | SharedObject ) [ ] | SharedObject ;
/ * *
2020-05-26 23:11:21 +08:00
* Advanced configuration for module s that should be shared in the share scope .
2020-05-14 21:50:35 +08:00
* /
declare interface SharedConfig {
/ * *
2020-05-26 23:11:21 +08:00
* Include the provided and fallback module directly instead behind an async request . This allows to use this shared module in initial load too . All possible shared module s need to be eager too .
2020-05-14 21:50:35 +08:00
* /
2020-05-26 23:11:21 +08:00
eager? : boolean ;
/ * *
* Provided module that should be provided to share scope . Also acts as fallback module if no shared module is found in share scope or version isn ' t valid . Defaults to the property name .
* /
2020-12-17 01:26:46 +08:00
import ? : string | false ;
2020-05-26 23:11:21 +08:00
2020-06-13 20:45:37 +08:00
/ * *
* 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 ;
2020-05-26 23:11:21 +08:00
/ * *
* Version requirement from module in share scope .
* /
2020-12-17 01:26:46 +08:00
requiredVersion? : string | false ;
2020-05-26 23:11:21 +08:00
/ * *
* Module is looked up under this key from the share scope .
* /
shareKey? : string ;
/ * *
* Share scope name .
* /
shareScope? : string ;
2020-05-27 21:10:57 +08:00
/ * *
* Allow only a single version of the shared module in share scope ( disabled by default ) .
* /
singleton? : boolean ;
2020-05-26 23:11:21 +08:00
/ * *
2020-05-27 22:02:41 +08:00
* 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 ) .
2020-05-26 23:11:21 +08:00
* /
strictVersion? : boolean ;
/ * *
2020-05-27 17:53:59 +08:00
* Version of the provided module . Will replace lower matching versions , but not higher .
2020-05-26 23:11:21 +08:00
* /
2020-12-17 01:26:46 +08:00
version? : string | false ;
2020-05-14 21:50:35 +08:00
}
/ * *
2020-05-26 23:11:21 +08:00
* Modules that should be shared in the share scope . Property names are used to match requested module s 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 .
2020-05-14 21:50:35 +08:00
* /
declare interface SharedObject {
[ index : string ] : string | SharedConfig ;
}
2020-04-21 14:45:35 +08:00
declare class SideEffectsFlagPlugin {
2020-10-26 22:32:34 +08:00
constructor ( analyseSource? : boolean ) ;
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
static module HasSideEffects (
module Name? : any ,
flagValue? : any ,
cache? : any
) : any ;
}
2020-08-20 02:05:47 +08:00
declare class SizeOnlySource extends Source {
constructor ( size : number ) ;
}
2020-08-22 18:01:28 +08:00
declare abstract class Snapshot {
2020-12-17 01:26:46 +08:00
startTime? : number ;
fileTimestamps? : Map < string , FileSystemInfoEntry > ;
fileHashes? : Map < string , string > ;
fileTshs? : Map < string , string | TimestampAndHash > ;
contextTimestamps? : Map < string , FileSystemInfoEntry > ;
contextHashes? : Map < string , string > ;
contextTshs? : Map < string , string | TimestampAndHash > ;
missingExistence? : Map < string , boolean > ;
managedItemInfo? : Map < string , string > ;
managedFiles? : Set < string > ;
managedContexts? : Set < string > ;
managedMissing? : Set < string > ;
children? : Set < Snapshot > ;
2020-08-22 18:01:28 +08:00
hasStartTime ( ) : boolean ;
setStartTime ( value? : any ) : void ;
setMergedStartTime ( value? : any , snapshot? : any ) : void ;
hasFileTimestamps ( ) : boolean ;
setFileTimestamps ( value? : any ) : void ;
hasFileHashes ( ) : boolean ;
setFileHashes ( value? : any ) : void ;
2020-08-26 06:36:16 +08:00
hasFileTshs ( ) : boolean ;
setFileTshs ( value? : any ) : void ;
2020-08-22 18:01:28 +08:00
hasContextTimestamps ( ) : boolean ;
setContextTimestamps ( value? : any ) : void ;
hasContextHashes ( ) : boolean ;
setContextHashes ( value? : any ) : void ;
2020-08-26 06:36:16 +08:00
hasContextTshs ( ) : boolean ;
setContextTshs ( value? : any ) : void ;
2020-08-22 18:01:28 +08:00
hasMissingExistence ( ) : boolean ;
setMissingExistence ( value? : any ) : void ;
hasManagedItemInfo ( ) : boolean ;
setManagedItemInfo ( value? : any ) : void ;
2020-08-23 03:54:34 +08:00
hasManagedFiles ( ) : boolean ;
setManagedFiles ( value? : any ) : void ;
hasManagedContexts ( ) : boolean ;
setManagedContexts ( value? : any ) : void ;
hasManagedMissing ( ) : boolean ;
setManagedMissing ( value? : any ) : void ;
2020-08-22 18:01:28 +08:00
hasChildren ( ) : boolean ;
setChildren ( value? : any ) : void ;
addChild ( child? : any ) : void ;
serialize ( __0 : { write : any } ) : void ;
deserialize ( __0 : { read : any } ) : void ;
2020-08-23 03:54:34 +08:00
getFileIterable ( ) : Iterable < string > ;
getContextIterable ( ) : Iterable < string > ;
getMissingIterable ( ) : Iterable < string > ;
2020-04-21 14:45:35 +08:00
}
2020-08-26 06:36:16 +08:00
/ * *
* Options affecting how file system snapshots are created and validated .
* /
declare interface SnapshotOptions {
/ * *
* Options for snapshotting build dependencies to determine if the whole cache need to be invalidated .
* /
buildDependencies ? : {
/ * *
* Use hashes of the content of the files / directories to determine invalidation .
* /
hash? : boolean ;
/ * *
* Use timestamps of the files / directories to determine invalidation .
* /
timestamp? : boolean ;
} ;
/ * *
* 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 [ ] ;
/ * *
* List of paths that are managed by a package manager and can be trusted to not be modified otherwise .
* /
managedPaths? : string [ ] ;
/ * *
* Options for snapshotting dependencies of module s to determine if they need to be built again .
* /
module ? : {
/ * *
* Use hashes of the content of the files / directories to determine invalidation .
* /
hash? : boolean ;
/ * *
* Use timestamps of the files / directories to determine invalidation .
* /
timestamp? : boolean ;
} ;
/ * *
* Options for snapshotting dependencies of request resolving to determine if requests need to be re - resolved .
* /
resolve ? : {
/ * *
* Use hashes of the content of the files / directories to determine invalidation .
* /
hash? : boolean ;
/ * *
* Use timestamps of the files / directories to determine invalidation .
* /
timestamp? : boolean ;
} ;
/ * *
* Options for snapshotting the resolving of build dependencies to determine if the build dependencies need to be re - resolved .
* /
resolveBuildDependencies ? : {
/ * *
* Use hashes of the content of the files / directories to determine invalidation .
* /
hash? : boolean ;
/ * *
* Use timestamps of the files / directories to determine invalidation .
* /
timestamp? : boolean ;
} ;
2020-04-21 14:45:35 +08:00
}
declare abstract class SortableSet < T > extends Set < T > {
/ * *
* Sort with a comparer function
* /
sortWith ( sortFn : ( arg0 : T , arg1 : T ) = > number ) : void ;
2020-07-28 00:09:48 +08:00
sort ( ) : SortableSet < T > ;
2020-04-21 14:45:35 +08:00
/ * *
* Get data from cache
* /
getFromCache < R > ( fn : ( arg0 : SortableSet < T > ) = > R ) : R ;
/ * *
* Get data from cache ( ignoring sorting )
* /
getFromUnorderedCache < R > ( fn : ( arg0 : SortableSet < T > ) = > R ) : R ;
2020-04-23 17:43:38 +08:00
toJSON ( ) : T [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* Iterates over values in the set .
* /
[ Symbol . iterator ] ( ) : IterableIterator < T > ;
readonly [ Symbol . toStringTag ] : string ;
}
2020-08-20 02:05:47 +08:00
declare class Source {
constructor ( ) ;
2020-04-21 14:45:35 +08:00
size ( ) : number ;
2020-11-26 17:48:16 +08:00
map ( options? : MapOptions ) : Object ;
sourceAndMap ( options? : MapOptions ) : { source : string | Buffer ; map : Object } ;
2020-04-21 14:45:35 +08:00
updateHash ( hash : Hash ) : void ;
source ( ) : string | Buffer ;
buffer ( ) : Buffer ;
}
2020-09-15 16:07:04 +08:00
declare interface SourceData {
iife? : boolean ;
init? : string ;
expression : string ;
}
2020-08-20 15:54:02 +08:00
declare interface SourceLike {
source ( ) : string | Buffer ;
}
2020-04-21 14:45:35 +08:00
declare class SourceMapDevToolPlugin {
constructor ( options? : SourceMapDevToolPluginOptions ) ;
sourceMapFilename : DevTool ;
sourceMappingURLComment : DevTool ;
module FilenameTemplate : DevtoolFallbackModuleFilenameTemplate ;
fallbackModuleFilenameTemplate : DevtoolFallbackModuleFilenameTemplate ;
namespace : string ;
options : SourceMapDevToolPluginOptions ;
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare interface SourceMapDevToolPluginOptions {
/ * *
* Appends the given value to the original asset . Usually the # sourceMappingURL comment . [ url ] is replaced with a URL to the source map file . false disables the appending .
* /
2020-12-17 01:26:46 +08:00
append? : null | string | false ;
2020-04-21 14:45:35 +08:00
/ * *
* Indicates whether column mappings should be used ( defaults to true ) .
* /
columns? : boolean ;
/ * *
* Exclude module s that match the given value from source map generation .
* /
2020-12-17 01:26:46 +08:00
exclude? : string | RegExp | ( string | RegExp ) [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* Generator string or function to create identifiers of module s for the 'sources' array in the SourceMap used only if 'moduleFilenameTemplate' would result in a conflict .
* /
2020-12-17 01:26:46 +08:00
fallbackModuleFilenameTemplate? : string | Function ;
2020-04-21 14:45:35 +08:00
/ * *
* Path prefix to which the [ file ] placeholder is relative to .
* /
fileContext? : string ;
/ * *
* Defines the output filename of the SourceMap ( will be inlined if no value is provided ) .
* /
2020-12-17 01:26:46 +08:00
filename? : null | string | false ;
2020-04-21 14:45:35 +08:00
/ * *
* Include source maps for module paths that match the given value .
* /
2020-12-17 01:26:46 +08:00
include? : string | RegExp | ( string | RegExp ) [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* Indicates whether SourceMaps from loaders should be used ( defaults to true ) .
* /
module ? : boolean ;
/ * *
* Generator string or function to create identifiers of module s for the 'sources' array in the SourceMap .
* /
2020-12-17 01:26:46 +08:00
module FilenameTemplate? : string | Function ;
2020-04-21 14:45:35 +08:00
/ * *
* Namespace prefix to allow multiple webpack roots in the devtools .
* /
namespace ? : string ;
/ * *
* Omit the 'sourceContents' array from the SourceMap .
* /
noSources? : boolean ;
/ * *
* Provide a custom public path for the SourceMapping comment .
* /
publicPath? : string ;
/ * *
* Provide a custom value for the 'sourceRoot' property in the SourceMap .
* /
sourceRoot? : string ;
/ * *
* Include source maps for module s based on their extension ( defaults to . js and . css ) .
* /
2020-12-17 01:26:46 +08:00
test? : string | RegExp | ( string | RegExp ) [ ] ;
2020-04-21 14:45:35 +08:00
}
2020-08-20 02:05:47 +08:00
declare class SourceMapSource extends Source {
constructor (
source : string | Buffer ,
name : string ,
sourceMap : string | Object | Buffer ,
2020-11-26 17:48:16 +08:00
originalSource? : string | Buffer ,
2020-12-17 17:08:47 +08:00
innerSourceMap? : string | Object | Buffer ,
removeOriginalSource? : boolean
2020-08-20 02:05:47 +08:00
) ;
2020-12-17 01:26:46 +08:00
getArgsAsBuffers ( ) : [
Buffer ,
string ,
Buffer ,
undefined | Buffer ,
2020-12-17 17:08:47 +08:00
undefined | Buffer ,
boolean
2020-12-17 01:26:46 +08:00
] ;
2020-08-20 02:05:47 +08:00
}
2020-04-21 14:45:35 +08:00
declare interface SourcePosition {
line : number ;
column? : number ;
}
declare interface SplitChunksOptions {
chunksFilter : ( chunk : Chunk ) = > boolean ;
2020-09-29 17:16:24 +08:00
defaultSizeTypes : string [ ] ;
2020-04-21 14:45:35 +08:00
minSize : Record < string , number > ;
minRemainingSize : Record < string , number > ;
2020-07-13 16:12:17 +08:00
enforceSizeThreshold : Record < string , number > ;
2020-04-21 14:45:35 +08:00
maxInitialSize : Record < string , number > ;
maxAsyncSize : Record < string , number > ;
minChunks : number ;
maxAsyncRequests : number ;
maxInitialRequests : number ;
hidePathInfo : boolean ;
2020-12-17 01:26:46 +08:00
filename : string | ( ( arg0 : PathData , arg1? : AssetInfo ) = > string ) ;
2020-04-21 14:45:35 +08:00
automaticNameDelimiter : string ;
getCacheGroups : (
module : Module ,
context : CacheGroupsContext
2020-04-23 17:43:38 +08:00
) = > CacheGroupSource [ ] ;
2020-12-17 01:26:46 +08:00
getName : (
module ? : Module ,
chunks? : Chunk [ ] ,
key? : string
) = > undefined | string ;
2020-07-28 00:09:48 +08:00
usedExports : boolean ;
2020-04-21 14:45:35 +08:00
fallbackCacheGroup : FallbackCacheGroup ;
}
declare class SplitChunksPlugin {
constructor ( options? : OptimizationSplitChunksOptions ) ;
options : SplitChunksOptions ;
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare abstract class StackedMap < K , V > {
2020-11-26 17:49:59 +08:00
map : Map < K , InternalCell < V > > ;
stack : Map < K , InternalCell < V > > [ ] ;
2020-04-21 14:45:35 +08:00
set ( item : K , value : V ) : void ;
delete ( item : K ) : void ;
has ( item : K ) : boolean ;
2020-12-17 01:26:46 +08:00
get ( item : K ) : Cell < V > ;
2020-04-23 17:43:38 +08:00
asArray ( ) : K [ ] ;
2020-04-21 14:45:35 +08:00
asSet ( ) : Set < K > ;
2020-12-17 01:26:46 +08:00
asPairArray ( ) : [ K , Cell < V > ] [ ] ;
asMap ( ) : Map < K , Cell < V > > ;
2020-04-21 14:45:35 +08:00
readonly size : number ;
createChild ( ) : StackedMap < K , V > ;
}
type Statement =
2020-10-05 22:57:31 +08:00
| FunctionDeclaration
| VariableDeclaration
| ClassDeclaration
2020-04-21 14:45:35 +08:00
| ExpressionStatement
| BlockStatement
| EmptyStatement
| DebuggerStatement
| WithStatement
| ReturnStatement
| LabeledStatement
| BreakStatement
| ContinueStatement
| IfStatement
| SwitchStatement
| ThrowStatement
| TryStatement
| WhileStatement
| DoWhileStatement
| ForStatement
| ForInStatement
2020-10-05 22:57:31 +08:00
| ForOfStatement ;
2020-04-21 14:45:35 +08:00
declare class Stats {
constructor ( compilation : Compilation ) ;
compilation : Compilation ;
2020-12-17 01:26:46 +08:00
readonly hash? : string ;
2020-09-04 04:01:25 +08:00
readonly startTime : any ;
readonly endTime : any ;
2020-04-21 14:45:35 +08:00
hasWarnings ( ) : boolean ;
hasErrors ( ) : boolean ;
toJson ( options? : any ) : any ;
2020-05-08 05:29:42 +08:00
toString ( options? : any ) : string ;
2020-04-21 14:45:35 +08:00
}
declare abstract class StatsFactory {
hooks : Readonly < {
2020-12-18 01:51:55 +08:00
extract : HookMap < SyncBailHook < [ Object , any , StatsFactoryContext ] , any > > ;
filter : HookMap <
SyncBailHook < [ any , StatsFactoryContext , number , number ] , any >
> ;
2020-04-21 14:45:35 +08:00
sort : HookMap <
2020-12-18 01:51:55 +08:00
SyncBailHook <
[ ( ( arg0? : any , arg1? : any ) = > number ) [ ] , StatsFactoryContext ] ,
any
>
> ;
filterSorted : HookMap <
SyncBailHook < [ any , StatsFactoryContext , number , number ] , any >
> ;
groupResults : HookMap <
2020-12-18 20:52:15 +08:00
SyncBailHook < [ GroupConfig < any , object > [ ] , StatsFactoryContext ] , any >
2020-04-21 14:45:35 +08:00
> ;
sortResults : HookMap <
2020-12-18 01:51:55 +08:00
SyncBailHook <
[ ( ( arg0? : any , arg1? : any ) = > number ) [ ] , StatsFactoryContext ] ,
any
>
2020-04-21 14:45:35 +08:00
> ;
2020-12-18 01:51:55 +08:00
filterResults : HookMap <
SyncBailHook < [ any , StatsFactoryContext , number , number ] , any >
> ;
merge : HookMap < SyncBailHook < [ any [ ] , StatsFactoryContext ] , any > > ;
result : HookMap < SyncBailHook < [ any [ ] , StatsFactoryContext ] , any > > ;
getItemName : HookMap < SyncBailHook < [ any , StatsFactoryContext ] , any > > ;
getItemFactory : HookMap < SyncBailHook < [ any , StatsFactoryContext ] , any > > ;
2020-04-21 14:45:35 +08:00
} > ;
2020-12-18 01:51:55 +08:00
create (
type : string ,
data : any ,
baseContext : Pick < StatsFactoryContext , string >
) : any ;
2020-04-21 14:45:35 +08:00
}
2020-12-18 01:51:55 +08:00
type StatsFactoryContext = KnownStatsFactoryContext & Record < string , any > ;
2020-04-21 14:45:35 +08:00
/ * *
* Stats options object .
* /
declare interface StatsOptions {
/ * *
* Fallback value for stats options when an option is not defined ( has precedence over local webpack defaults ) .
* /
all? : boolean ;
/ * *
* Add assets information .
* /
assets? : boolean ;
/ * *
* Sort the assets by that field .
* /
assetsSort? : string ;
2020-08-27 15:59:12 +08:00
/ * *
* Space to display assets ( groups will be collapsed to fit this space ) .
* /
assetsSpace? : number ;
2020-04-21 14:45:35 +08:00
/ * *
* Add built at time information .
* /
builtAt? : boolean ;
/ * *
2020-12-18 01:51:55 +08:00
* Add information about cached ( not built ) module s ( deprecated : use 'cachedModules' instead ) .
2020-04-21 14:45:35 +08:00
* /
cached? : boolean ;
/ * *
* Show cached assets ( setting this to ` false ` only shows emitted files ) .
* /
cachedAssets? : boolean ;
2020-09-02 00:08:09 +08:00
/ * *
* Add information about cached ( not built ) module s.
* /
cachedModules? : boolean ;
2020-04-21 14:45:35 +08:00
/ * *
* Add children information .
* /
children? : boolean ;
2020-09-03 17:38:38 +08:00
/ * *
* Display auxiliary assets in chunk groups .
* /
chunkGroupAuxiliary? : boolean ;
/ * *
* Display children of chunk groups .
* /
chunkGroupChildren? : boolean ;
/ * *
* Limit of assets displayed in chunk groups .
* /
chunkGroupMaxAssets? : number ;
2020-04-21 14:45:35 +08:00
/ * *
* Display all chunk groups with the corresponding bundles .
* /
chunkGroups? : boolean ;
/ * *
* Add built module s information to chunk information .
* /
chunkModules? : boolean ;
/ * *
* Add the origins of chunks and chunk merging info .
* /
chunkOrigins? : boolean ;
/ * *
* Add information about parent , children and sibling chunks to chunk information .
* /
chunkRelations? : boolean ;
/ * *
* Add chunk information .
* /
chunks? : boolean ;
/ * *
* Sort the chunks by that field .
* /
chunksSort? : string ;
/ * *
* Enables / Disables colorful output .
* /
colors ? :
| boolean
| {
/ * *
* Custom color for bold text .
* /
bold? : string ;
/ * *
* Custom color for cyan text .
* /
cyan? : string ;
/ * *
* Custom color for green text .
* /
green? : string ;
/ * *
* Custom color for magenta text .
* /
magenta? : string ;
/ * *
* Custom color for red text .
* /
red? : string ;
/ * *
* Custom color for yellow text .
* /
yellow? : string ;
} ;
/ * *
* Context directory for request shortening .
* /
context? : string ;
2020-09-02 00:08:09 +08:00
/ * *
* Show chunk module s that are dependencies of other module s of the chunk .
* /
dependentModules? : boolean ;
2020-04-21 14:45:35 +08:00
/ * *
* Add module depth in module graph.
* /
depth? : boolean ;
/ * *
* Display the entry points with the corresponding bundles .
* /
2020-09-03 17:38:38 +08:00
entrypoints? : boolean | "auto" ;
2020-04-21 14:45:35 +08:00
/ * *
* Add -- env information .
* /
env? : boolean ;
/ * *
* Add details to errors ( like resolving log ) .
* /
errorDetails? : boolean ;
/ * *
* Add internal stack trace to errors .
* /
errorStack? : boolean ;
/ * *
* Add errors .
* /
errors? : boolean ;
2020-09-04 04:09:43 +08:00
/ * *
* Add errors count .
* /
errorsCount? : boolean ;
2020-04-21 14:45:35 +08:00
/ * *
* Please use excludeModules instead .
* /
exclude ? :
| string
| boolean
| RegExp
2020-04-23 17:43:38 +08:00
| FilterItemTypes [ ]
2020-04-21 14:45:35 +08:00
| ( ( value : string ) = > boolean ) ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Suppress assets that match the specified filters . Filters can be Strings , RegExps or Functions .
2020-03-21 21:01:38 +08:00
* /
2020-12-17 01:26:46 +08:00
excludeAssets ? :
| string
| RegExp
| FilterItemTypes [ ]
| ( ( value : string ) = > boolean ) ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Suppress module s that match the specified filters . Filters can be Strings , RegExps , Booleans or Functions .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
excludeModules ? :
| string
| boolean
| RegExp
2020-04-23 17:43:38 +08:00
| FilterItemTypes [ ]
2020-04-21 14:45:35 +08:00
| ( ( value : string ) = > boolean ) ;
2020-03-21 21:01:38 +08:00
2020-08-27 15:59:12 +08:00
/ * *
* Group assets by how their are related to chunks .
* /
groupAssetsByChunk? : boolean ;
2020-09-02 00:39:57 +08:00
/ * *
* Group assets by their status ( emitted , compared for emit or cached ) .
* /
groupAssetsByEmitStatus? : boolean ;
2020-08-27 15:59:12 +08:00
/ * *
* Group assets by their extension .
* /
groupAssetsByExtension? : boolean ;
/ * *
* Group assets by their asset info ( immutable , development , hotModuleReplacement , etc ) .
* /
groupAssetsByInfo? : boolean ;
/ * *
* Group assets by their path .
* /
groupAssetsByPath? : boolean ;
2020-09-02 00:08:09 +08:00
/ * *
2020-09-02 02:46:45 +08:00
* Group module s by their attributes ( errors , warnings , assets , optional , orphan , or dependent ) .
2020-09-02 00:08:09 +08:00
* /
groupModulesByAttributes? : boolean ;
/ * *
* Group module s by their status ( cached or built and cacheable ) .
* /
groupModulesByCacheStatus? : boolean ;
/ * *
* Group module s by their extension .
* /
groupModulesByExtension? : boolean ;
/ * *
* Group module s by their path .
* /
groupModulesByPath? : boolean ;
2020-04-21 14:45:35 +08:00
/ * *
* Add the hash of the compilation .
* /
hash? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Add ids .
* /
ids? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Add logging output .
* /
logging? : boolean | "none" | "verbose" | "error" | "warn" | "info" | "log" ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Include debug logging of specified loggers ( i . e . for plugins or loaders ) . Filters can be Strings , RegExps or Functions .
* /
loggingDebug ? :
| string
| boolean
| RegExp
2020-04-23 17:43:38 +08:00
| FilterItemTypes [ ]
2020-04-21 14:45:35 +08:00
| ( ( value : string ) = > boolean ) ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Add stack traces to logging output .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
loggingTrace? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Add information about assets inside module s.
* /
module Assets? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Add dependencies and origin of warnings / errors .
* /
module Trace? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Add built module s information .
* /
module s? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Sort the module s by that field .
* /
module sSort? : string ;
2020-03-21 21:01:38 +08:00
2020-09-02 00:08:09 +08:00
/ * *
* Space to display module s ( groups will be collapsed to fit this space , values is in number of module s / g r o u p s ) .
* /
module sSpace? : number ;
2020-04-21 14:45:35 +08:00
/ * *
* Add information about module s nested in other module s ( like with module concatenation ) .
* /
nestedModules? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Show reasons why optimization bailed out for module s.
* /
optimizationBailout? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Add information about orphan module s.
* /
orphanModules? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Add output path information .
* /
outputPath? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Add performance hint flags .
* /
performance? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Preset for the default values .
* /
preset? : string | boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Show exports provided by module s.
* /
providedExports? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Add public path information .
* /
publicPath? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Add information about the reasons why module s are included .
* /
reasons? : boolean ;
2020-03-21 21:01:38 +08:00
2020-08-01 12:21:29 +08:00
/ * *
* Add information about assets that are related to other assets ( like SourceMaps for assets ) .
* /
relatedAssets? : boolean ;
2020-12-18 01:51:55 +08:00
/ * *
* Add information about runtime module s ( deprecated : use 'runtimeModules' instead ) .
* /
runtime? : boolean ;
2020-04-21 14:45:35 +08:00
/ * *
* Add information about runtime module s.
* /
2020-09-02 16:51:10 +08:00
runtimeModules? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Add the source code of module s.
* /
source? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Add timing information .
* /
timings? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Show exports used by module s.
* /
usedExports? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Add webpack version information .
* /
version? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Add warnings .
* /
warnings? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
2020-09-04 04:09:43 +08:00
* Add warnings count .
* /
warningsCount? : boolean ;
/ * *
* Suppress listing warnings that match the specified filters ( they will still be counted ) . Filters can be Strings , RegExps or Functions .
2020-04-21 14:45:35 +08:00
* /
2020-12-17 01:26:46 +08:00
warningsFilter ? :
| string
| RegExp
| FilterItemTypes [ ]
| ( ( value : string ) = > boolean ) ;
2020-04-21 14:45:35 +08:00
}
declare abstract class StatsPrinter {
hooks : Readonly < {
2020-12-18 01:51:55 +08:00
sortElements : HookMap < SyncBailHook < [ string [ ] , StatsPrinterContext ] , true > > ;
printElements : HookMap <
SyncBailHook < [ PrintedElement [ ] , StatsPrinterContext ] , string >
> ;
sortItems : HookMap < SyncBailHook < [ any [ ] , StatsPrinterContext ] , true > > ;
getItemName : HookMap < SyncBailHook < [ any , StatsPrinterContext ] , string > > ;
printItems : HookMap < SyncBailHook < [ string [ ] , StatsPrinterContext ] , string > > ;
print : HookMap < SyncBailHook < [ {} , StatsPrinterContext ] , string > > ;
result : HookMap < SyncWaterfallHook < [ string , StatsPrinterContext ] > > ;
2020-04-21 14:45:35 +08:00
} > ;
2020-12-17 01:26:46 +08:00
print ( type : string , object : Object , baseContext? : Object ) : string ;
2020-04-21 14:45:35 +08:00
}
2020-12-18 01:51:55 +08:00
type StatsPrinterContext = KnownStatsPrinterContext & Record < string , any > ;
2020-04-21 14:45:35 +08:00
type StatsValue =
| boolean
| "none"
2020-09-04 04:09:43 +08:00
| "summary"
2020-04-21 14:45:35 +08:00
| "errors-only"
2020-09-04 04:09:43 +08:00
| "errors-warnings"
2020-04-21 14:45:35 +08:00
| "minimal"
| "normal"
| "detailed"
| "verbose"
| StatsOptions ;
declare interface SyntheticDependencyLocation {
name : string ;
index? : number ;
}
declare const TOMBSTONE : unique symbol ;
2020-10-05 22:57:31 +08:00
declare const TRANSITIVE_ONLY : unique symbol ;
2020-04-21 14:45:35 +08:00
declare interface TagInfo {
tag : any ;
data : any ;
2020-12-17 01:26:46 +08:00
next? : TagInfo ;
2020-04-21 14:45:35 +08:00
}
2020-10-29 03:51:08 +08:00
type Target = string | false | string [ ] ;
2020-04-21 14:45:35 +08:00
declare class Template {
constructor ( ) ;
static getFunctionContent ( fn : Function ) : string ;
static toIdentifier ( str : string ) : string ;
static toComment ( str : string ) : string ;
static toNormalComment ( str : string ) : string ;
static toPath ( str : string ) : string ;
static numberToIdentifier ( n : number ) : string ;
static numberToIdentifierContinuation ( n : number ) : string ;
2020-10-29 03:51:08 +08:00
static indent ( s : EntryItem ) : string ;
static prefix ( s : EntryItem , prefix : string ) : string ;
static asString ( str : EntryItem ) : string ;
2020-04-23 17:43:38 +08:00
static getModulesArrayBounds ( module s : WithId [ ] ) : false | [ number , number ] ;
2020-04-21 14:45:35 +08:00
static renderChunkModules (
renderContext : RenderContextModuleTemplate ,
2020-04-23 17:43:38 +08:00
module s : Module [ ] ,
2020-04-21 14:45:35 +08:00
renderModule : ( arg0 : Module ) = > Source ,
prefix? : string
) : Source ;
static renderRuntimeModules (
2020-04-23 17:43:38 +08:00
runtimeModules : RuntimeModule [ ] ,
2020-04-21 14:45:35 +08:00
renderContext : RenderContextModuleTemplate
) : Source ;
static renderChunkRuntimeModules (
2020-04-23 17:43:38 +08:00
runtimeModules : RuntimeModule [ ] ,
2020-04-21 14:45:35 +08:00
renderContext : RenderContextModuleTemplate
) : Source ;
static NUMBER_OF_IDENTIFIER_START_CHARS : number ;
static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS : number ;
}
2020-08-26 06:36:16 +08:00
declare interface TimestampAndHash {
safeTime : number ;
timestamp? : number ;
timestampHash? : string ;
hash : string ;
}
2020-04-21 14:45:35 +08:00
declare const UNDEFINED_MARKER : unique symbol ;
2020-07-28 00:09:48 +08:00
declare interface UpdateHashContextDependency {
chunkGraph : ChunkGraph ;
2020-11-26 17:49:59 +08:00
runtime : RuntimeSpec ;
2020-10-26 21:00:11 +08:00
runtimeTemplate? : RuntimeTemplate ;
2020-07-28 00:09:48 +08:00
}
declare interface UpdateHashContextGenerator {
2020-04-21 14:45:35 +08:00
/ * *
* the module
* /
module : NormalModule ;
2020-07-28 01:36:06 +08:00
chunkGraph : ChunkGraph ;
2020-11-26 17:49:59 +08:00
runtime : RuntimeSpec ;
2020-04-21 14:45:35 +08:00
}
2020-12-17 17:41:28 +08:00
type UsageStateType = 0 | 2 | 3 | 1 | 4 ;
2020-06-17 19:22:37 +08:00
declare interface UserResolveOptions {
/ * *
* A list of module alias configurations or an object which maps key to value
* /
alias ? :
2020-10-29 03:51:08 +08:00
| { [ index : string ] : Target }
2020-06-17 19:22:37 +08:00
| {
/ * *
* New request .
* /
2020-10-29 03:51:08 +08:00
alias : Target ;
2020-06-17 19:22:37 +08:00
/ * *
* Request to be redirected .
* /
name : string ;
/ * *
* Redirect only exact matching request .
* /
onlyModule? : boolean ;
} [ ] ;
2020-09-16 12:58:59 +08:00
/ * *
* A list of module alias configurations or an object which maps key to value , applied only after module s option
* /
fallback ? :
2020-10-29 03:51:08 +08:00
| { [ index : string ] : Target }
2020-09-16 12:58:59 +08:00
| {
/ * *
* New request .
* /
2020-10-29 03:51:08 +08:00
alias : Target ;
2020-09-16 12:58:59 +08:00
/ * *
* Request to be redirected .
* /
name : string ;
/ * *
* Redirect only exact matching request .
* /
onlyModule? : boolean ;
} [ ] ;
2020-06-17 19:22:37 +08:00
/ * *
* A list of alias fields in description files
* /
2020-10-29 03:51:08 +08:00
aliasFields? : EntryItem [ ] ;
2020-06-17 19:22:37 +08:00
/ * *
* A function which decides whether a request should be cached or not . An object is passed with at least ` path ` and ` request ` properties .
* /
cachePredicate ? : ( arg0 : ResolveRequest ) = > boolean ;
/ * *
* Whether or not the unsafeCache should include request context as part of the cache key .
* /
cacheWithContext? : boolean ;
/ * *
* A list of description files to read from
* /
descriptionFiles? : string [ ] ;
/ * *
* A list of exports field condition names .
* /
conditionNames? : string [ ] ;
/ * *
* Enforce that a extension from extensions must be used
* /
enforceExtension? : boolean ;
/ * *
* A list of exports fields in description files
* /
2020-10-29 03:51:08 +08:00
exportsFields? : EntryItem [ ] ;
2020-06-17 19:22:37 +08:00
2020-09-16 12:58:59 +08:00
/ * *
* A list of imports fields in description files
* /
2020-10-29 03:51:08 +08:00
importsFields? : EntryItem [ ] ;
2020-09-16 12:58:59 +08:00
2020-06-17 19:22:37 +08:00
/ * *
* A list of extensions which should be tried for files
* /
extensions? : string [ ] ;
/ * *
* The file system which should be used
* /
fileSystem : FileSystem ;
/ * *
* Use this cache object to unsafely cache the successful requests
* /
unsafeCache? : any ;
/ * *
* Resolve symlinks to their symlinked location
* /
symlinks? : boolean ;
/ * *
* A prepared Resolver to which the plugins are attached
* /
resolver? : Resolver ;
/ * *
* A list of directories to resolve module s from , can be absolute path or folder name
* /
2020-12-17 01:26:46 +08:00
module s? : string | string [ ] ;
2020-06-17 19:22:37 +08:00
/ * *
* A list of main fields in description files
* /
mainFields ? : (
| string
| string [ ]
2020-10-29 03:51:08 +08:00
| { name : EntryItem ; forceRelative : boolean }
2020-06-17 19:22:37 +08:00
) [ ] ;
/ * *
* A list of main files in directories
* /
mainFiles? : string [ ] ;
/ * *
* A list of additional resolve plugins which should be applied
* /
plugins ? : (
| { apply : ( arg0 : Resolver ) = > void }
| ( ( this : Resolver , arg1 : Resolver ) = > void )
) [ ] ;
/ * *
* A PnP API that should be used - null is "never" , undefined is "auto"
* /
2020-12-17 01:26:46 +08:00
pnpApi? : null | PnpApiImpl ;
2020-06-17 19:22:37 +08:00
2020-07-09 05:12:45 +08:00
/ * *
* A list of root paths
* /
roots? : string [ ] ;
2020-07-17 16:27:48 +08:00
/ * *
* The request is already fully specified and no extensions or directories are resolved for it
* /
fullySpecified? : boolean ;
2020-06-17 19:22:37 +08:00
/ * *
* Resolve to a context instead of a file
* /
resolveToContext? : boolean ;
/ * *
* A list of resolve restrictions
* /
restrictions ? : ( string | RegExp ) [ ] ;
/ * *
* Use only the sync constiants of the file system calls
* /
useSyncFileSystemCalls? : boolean ;
2020-09-29 02:43:03 +08:00
/ * *
* Prefer to resolve module requests as relative requests before falling back to module s
* /
preferRelative? : boolean ;
2020-06-17 19:22:37 +08:00
}
2020-04-21 14:45:35 +08:00
declare abstract class VariableInfo {
declaredScope : ScopeInfo ;
freeName : string | true ;
2020-12-17 01:26:46 +08:00
tagInfo? : TagInfo ;
2020-04-21 14:45:35 +08:00
}
2020-11-26 17:49:59 +08:00
declare interface VariableInfoInterface {
declaredScope : ScopeInfo ;
freeName : string | true ;
2020-12-17 01:26:46 +08:00
tagInfo? : TagInfo ;
2020-11-26 17:49:59 +08:00
}
2020-07-08 16:21:31 +08:00
declare interface WatchFileSystem {
watch : (
files : Iterable < string > ,
directories : Iterable < string > ,
missing : Iterable < string > ,
startTime : number ,
2020-08-03 02:09:36 +08:00
options : WatchOptions ,
2020-07-08 16:21:31 +08:00
callback : (
2020-12-17 01:26:46 +08:00
arg0 : undefined | Error ,
2020-07-08 16:21:31 +08:00
arg1 : Map < string , FileSystemInfoEntry > ,
arg2 : Map < string , FileSystemInfoEntry > ,
arg3 : Set < string > ,
arg4 : Set < string >
) = > void ,
callbackUndelayed : ( arg0 : string , arg1 : number ) = > void
) = > Watcher ;
}
2020-04-21 14:45:35 +08:00
declare class WatchIgnorePlugin {
constructor ( options : WatchIgnorePluginOptions ) ;
2020-10-29 03:51:08 +08:00
paths : ( string | RegExp ) [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Apply the plugin
* /
apply ( compiler : Compiler ) : void ;
}
declare interface WatchIgnorePluginOptions {
/ * *
* A list of RegExps or absolute paths to directories or files that should be ignored .
* /
2020-10-29 03:51:08 +08:00
paths : ( string | RegExp ) [ ] ;
2020-04-21 14:45:35 +08:00
}
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options for the watcher .
* /
declare interface WatchOptions {
/ * *
* Delay the rebuilt after the first change . Value is a time in ms .
* /
aggregateTimeout? : number ;
2020-03-21 21:01:38 +08:00
2020-10-21 20:33:34 +08:00
/ * *
2020-10-23 00:54:31 +08:00
* Resolve symlinks and watch symlink and real file . This is usually not needed as webpack already resolves symlinks ( 'resolve.symlinks' ) .
2020-10-21 20:33:34 +08:00
* /
followSymlinks? : boolean ;
2020-04-21 14:45:35 +08:00
/ * *
2020-09-21 09:44:42 +08:00
* Ignore some files from watching ( glob pattern or regexp ) .
2020-04-21 14:45:35 +08:00
* /
2020-09-21 09:44:42 +08:00
ignored? : string | RegExp | string [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Enable polling mode for watching .
* /
poll? : number | boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Stop watching when stdin stream has ended .
* /
stdin? : boolean ;
}
2020-07-08 16:21:31 +08:00
declare interface Watcher {
/ * *
* closes the watcher and all underlying file watchers
* /
close : ( ) = > void ;
/ * *
* closes the watcher , but keeps underlying file watchers alive until the next watch call
* /
pause : ( ) = > void ;
/ * *
* get info about files
* /
getFileTimeInfoEntries : ( ) = > Map < string , FileSystemInfoEntry > ;
/ * *
* get info about directories
* /
getContextTimeInfoEntries : ( ) = > Map < string , FileSystemInfoEntry > ;
}
2020-04-21 14:45:35 +08:00
declare abstract class Watching {
2020-12-17 01:26:46 +08:00
startTime : null | number ;
2020-04-21 14:45:35 +08:00
invalid : boolean ;
handler : CallbackFunction < Stats > ;
2020-04-23 17:43:38 +08:00
callbacks : CallbackFunction < void > [ ] ;
2020-04-21 14:45:35 +08:00
closed : boolean ;
suspended : boolean ;
watchOptions : {
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Delay the rebuilt after the first change . Value is a time in ms .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
aggregateTimeout? : number ;
2020-10-21 20:33:34 +08:00
/ * *
2020-10-23 00:54:31 +08:00
* Resolve symlinks and watch symlink and real file . This is usually not needed as webpack already resolves symlinks ( 'resolve.symlinks' ) .
2020-10-21 20:33:34 +08:00
* /
followSymlinks? : boolean ;
2020-03-21 21:01:38 +08:00
/ * *
2020-09-21 09:44:42 +08:00
* Ignore some files from watching ( glob pattern or regexp ) .
2020-03-21 21:01:38 +08:00
* /
2020-09-21 09:44:42 +08:00
ignored? : string | RegExp | string [ ] ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Enable polling mode for watching .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
poll? : number | boolean ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Stop watching when stdin stream has ended .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
stdin? : boolean ;
} ;
compiler : Compiler ;
running : boolean ;
watcher : any ;
pausedWatcher : any ;
watch (
files : Iterable < string > ,
dirs : Iterable < string > ,
missing : Iterable < string >
) : void ;
invalidate ( callback? : CallbackFunction < void > ) : void ;
suspend ( ) : void ;
resume ( ) : void ;
close ( callback : CallbackFunction < void > ) : void ;
}
declare class WebWorkerTemplatePlugin {
constructor ( ) ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Apply the plugin
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
apply ( compiler : Compiler ) : void ;
}
2020-12-17 17:08:27 +08:00
declare class WebpackError extends Error {
/ * *
* Creates an instance of WebpackError .
* /
constructor ( message? : string ) ;
2020-04-21 14:45:35 +08:00
details : any ;
module : Module ;
2020-11-26 17:49:59 +08:00
loc : DependencyLocation ;
2020-04-21 14:45:35 +08:00
hideStack : boolean ;
chunk : Chunk ;
file : string ;
serialize ( __0 : { write : any } ) : void ;
deserialize ( __0 : { read : any } ) : void ;
2020-12-17 17:08:27 +08:00
/ * *
* Create . stack property on a target object
* /
2020-12-18 20:52:15 +08:00
static captureStackTrace (
targetObject : object ,
constructorOpt? : Function
) : void ;
2020-12-17 17:08:27 +08:00
/ * *
* Optional override for formatting stack traces
* /
static prepareStackTrace ? : (
err : Error ,
stackTraces : NodeJS.CallSite [ ]
) = > any ;
static stackTraceLimit : number ;
2020-04-21 14:45:35 +08:00
}
declare abstract class WebpackLogger {
getChildLogger : ( arg0 : string | ( ( ) = > string ) ) = > WebpackLogger ;
2020-04-23 17:43:38 +08:00
error ( . . . args : any [ ] ) : void ;
warn ( . . . args : any [ ] ) : void ;
info ( . . . args : any [ ] ) : void ;
log ( . . . args : any [ ] ) : void ;
debug ( . . . args : any [ ] ) : void ;
assert ( assertion : any , . . . args : any [ ] ) : void ;
2020-04-21 14:45:35 +08:00
trace ( ) : void ;
clear ( ) : void ;
2020-04-23 17:43:38 +08:00
status ( . . . args : any [ ] ) : void ;
group ( . . . args : any [ ] ) : void ;
groupCollapsed ( . . . args : any [ ] ) : void ;
groupEnd ( . . . args : any [ ] ) : void ;
2020-04-21 14:45:35 +08:00
profile ( label? : any ) : void ;
profileEnd ( label? : any ) : void ;
time ( label? : any ) : void ;
timeLog ( label? : any ) : void ;
timeEnd ( label? : any ) : void ;
timeAggregate ( label? : any ) : void ;
timeAggregateEnd ( label? : any ) : void ;
}
declare class WebpackOptionsApply extends OptionsApply {
constructor ( ) ;
}
declare class WebpackOptionsDefaulter {
constructor ( ) ;
process ( options? : any ) : any ;
}
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Normalized webpack options object .
* /
declare interface WebpackOptionsNormalized {
/ * *
* Set the value of ` require.amd ` and ` define.amd ` . Or disable AMD support .
* /
2020-12-17 01:26:46 +08:00
amd? : false | { [ index : string ] : any } ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Report the first error as a hard error instead of tolerating it .
* /
bail? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Cache generated module s and chunks to improve performance for multiple incremental builds .
* /
cache : CacheOptionsNormalized ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* 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 ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* References to other configurations to depend on .
* /
2020-04-23 17:43:38 +08:00
dependencies? : string [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options for the webpack - dev - server .
* /
devServer? : DevServer ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* A developer tool to enhance debugging ( false | eval | [ inline - | hidden - | eval - ] [ nosources - ] [ cheap - [ module - ] ] source - map ) .
* /
2020-12-17 01:26:46 +08:00
devtool? : string | false ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The entry point ( s ) of the compilation .
* /
entry : EntryNormalized ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Enables / Disables experiments ( experimental features with relax SemVer compatibility ) .
* /
experiments : Experiments ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* 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 : Externals ;
2020-03-21 21:01:38 +08:00
2020-09-09 21:16:53 +08:00
/ * *
* Enable presets of externals for specific targets .
* /
externalsPresets : ExternalsPresets ;
2020-04-21 14:45:35 +08:00
/ * *
* Specifies the default type of externals ( 'amd*' , 'umd*' , 'system' and 'jsonp' depend on output . libraryTarget set to the same value ) .
* /
2020-12-17 01:26:46 +08:00
externalsType ? :
| "var"
| "module"
| "assign"
| "this"
| "window"
| "self"
| "global"
| "commonjs"
| "commonjs2"
| "commonjs-module"
| "amd"
| "amd-require"
| "umd"
| "umd2"
| "jsonp"
| "system"
| "promise"
| "import"
| "script" ;
2020-03-21 21:01:38 +08:00
2020-09-21 04:08:38 +08:00
/ * *
* Ignore specific warnings .
* /
ignoreWarnings ? : ( (
warning : WebpackError ,
compilation : Compilation
) = > boolean ) [ ] ;
2020-04-21 14:45:35 +08:00
/ * *
* Options for infrastructure level logging .
* /
infrastructureLogging : InfrastructureLogging ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Custom values available in the loader context .
* /
loader? : Loader ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Enable production optimizations or development hints .
* /
2020-12-17 01:26:46 +08:00
mode ? : "development" | "production" | "none" ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options affecting the normal module s ( ` NormalModuleFactory ` ) .
* /
module : ModuleOptions ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Name of the configuration . Used when loading multiple configurations .
* /
name? : string ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Include polyfills or mocks for various node stuff .
* /
2020-07-23 04:05:26 +08:00
node : NodeWebpackOptions ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Enables / Disables integrated optimizations .
* /
optimization : Optimization ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Normalized options affecting the output of the compilation . ` output ` options tell webpack how to write the compiled files to disk .
* /
output : OutputNormalized ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* The number of parallel processed module s in the compilation .
* /
parallelism? : number ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Configuration for web performance recommendations .
* /
2020-12-17 01:26:46 +08:00
performance? : false | PerformanceOptions ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Add additional plugins to the compiler .
* /
2020-04-23 17:43:38 +08:00
plugins : (
| ( ( this : Compiler , compiler : Compiler ) = > void )
| WebpackPluginInstance
) [ ] ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Capture timing information for each module .
* /
profile? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Store compiler state to a json file .
* /
2020-12-17 01:26:46 +08:00
recordsInputPath? : string | false ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Load compiler state from a json file .
* /
2020-12-17 01:26:46 +08:00
recordsOutputPath? : string | false ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options for the resolver .
* /
2020-06-17 19:22:37 +08:00
resolve : ResolveOptionsWebpackOptions ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options for the resolver when resolving loaders .
* /
2020-06-17 19:22:37 +08:00
resolveLoader : ResolveOptionsWebpackOptions ;
2020-03-21 21:01:38 +08:00
2020-08-26 06:36:16 +08:00
/ * *
* Options affecting how file system snapshots are created and validated .
* /
snapshot : SnapshotOptions ;
2020-04-21 14:45:35 +08:00
/ * *
* Stats options object or preset name .
* /
stats : StatsValue ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
2020-09-10 16:42:29 +08:00
* Environment to build for . An array of environments to build for all of them when possible .
2020-04-21 14:45:35 +08:00
* /
2020-12-17 01:26:46 +08:00
target? : string | false | string [ ] ;
2020-03-21 21:01:38 +08:00
/ * *
2020-04-21 14:45:35 +08:00
* Enter watch mode , which rebuilds on file change .
2020-03-21 21:01:38 +08:00
* /
2020-04-21 14:45:35 +08:00
watch? : boolean ;
2020-03-21 21:01:38 +08:00
2020-04-21 14:45:35 +08:00
/ * *
* Options for the watcher .
* /
watchOptions : WatchOptions ;
}
/ * *
* Plugin instance .
* /
declare interface WebpackPluginInstance {
[ index : string ] : any ;
/ * *
* The run point of the plugin , required method .
* /
apply : ( compiler : Compiler ) = > void ;
}
declare interface WithId {
id : string | number ;
}
declare interface WithOptions {
/ * *
* create a resolver with additional / different options
* /
2020-06-18 04:17:14 +08:00
withOptions : (
2020-11-26 17:49:59 +08:00
arg0 : Partial < ResolveOptionsWithDependencyType >
) = > ResolverWithOptions ;
2020-04-21 14:45:35 +08:00
}
2020-12-18 20:52:15 +08:00
type __TypeWebpackOptions = (
data : object
) = >
2020-04-21 14:45:35 +08:00
| string
| {
/ * *
* Unique loader options identifier .
* /
ident? : string ;
/ * *
* Loader name .
* /
loader? : string ;
/ * *
* Loader options .
* /
2020-12-17 01:26:46 +08:00
options? : string | { [ index : string ] : any } ;
2020-04-21 14:45:35 +08:00
}
| __TypeWebpackOptions
2020-04-23 17:43:38 +08:00
| RuleSetUseItem [ ] ;
2020-04-21 14:45:35 +08:00
declare function exports (
2020-04-21 14:54:59 +08:00
options : Configuration ,
callback? : CallbackWebpack < Stats >
) : Compiler ;
declare function exports (
2020-04-23 17:43:38 +08:00
options : Configuration [ ] ,
2020-04-21 14:54:59 +08:00
callback? : CallbackWebpack < MultiStats >
) : MultiCompiler ;
2020-04-21 14:45:35 +08:00
declare namespace exports {
2020-04-21 14:54:59 +08:00
export const webpack : {
( options : Configuration , callback? : CallbackWebpack < Stats > ) : Compiler ;
(
2020-04-23 17:43:38 +08:00
options : Configuration [ ] ,
2020-04-21 14:54:59 +08:00
callback? : CallbackWebpack < MultiStats >
) : MultiCompiler ;
} ;
export const validate : ( options? : any ) = > void ;
2020-12-17 17:41:28 +08:00
export const validateSchema : (
schema : Schema ,
2020-12-18 20:52:15 +08:00
options : object | object [ ] ,
2020-12-17 17:41:28 +08:00
validationConfiguration? : ValidationErrorConfiguration
) = > void ;
2020-04-21 14:54:59 +08:00
export const version : string ;
2020-04-21 14:45:35 +08:00
export namespace cli {
export let getArguments : ( schema? : any ) = > Record < string , Argument > ;
export let processArguments : (
args : Record < string , Argument > ,
config : any ,
values : Record <
string ,
| string
| number
| boolean
| RegExp
2020-04-23 17:43:38 +08:00
| ( string | number | boolean | RegExp ) [ ]
2020-04-21 14:45:35 +08:00
>
2020-12-17 01:26:46 +08:00
) = > null | Problem [ ] ;
2020-03-21 21:01:38 +08:00
}
2020-04-21 14:45:35 +08:00
export namespace ModuleFilenameHelpers {
export let ALL_LOADERS_RESOURCE : string ;
export let REGEXP_ALL_LOADERS_RESOURCE : RegExp ;
export let LOADERS_RESOURCE : string ;
export let REGEXP_LOADERS_RESOURCE : RegExp ;
export let RESOURCE : string ;
export let REGEXP_RESOURCE : RegExp ;
export let ABSOLUTE_RESOURCE_PATH : string ;
export let REGEXP_ABSOLUTE_RESOURCE_PATH : RegExp ;
export let RESOURCE_PATH : string ;
export let REGEXP_RESOURCE_PATH : RegExp ;
export let ALL_LOADERS : string ;
export let REGEXP_ALL_LOADERS : RegExp ;
export let LOADERS : string ;
export let REGEXP_LOADERS : RegExp ;
export let QUERY : string ;
export let REGEXP_QUERY : RegExp ;
export let ID : string ;
export let REGEXP_ID : RegExp ;
export let HASH : string ;
export let REGEXP_HASH : RegExp ;
export let NAMESPACE : string ;
export let REGEXP_NAMESPACE : RegExp ;
export let createFilename : (
module : any ,
options : any ,
__2 : { requestShortener : any ; chunkGraph : any }
) = > any ;
export let replaceDuplicates : (
array? : any ,
fn? : any ,
comparator? : any
) = > any ;
export let matchPart : ( str? : any , test? : any ) = > any ;
export let matchObject : ( obj? : any , str? : any ) = > boolean ;
2020-03-21 21:01:38 +08:00
}
2020-04-21 14:45:35 +08:00
export namespace RuntimeGlobals {
export let require : string ;
export let requireScope : string ;
export let exports : string ;
export let thisAsExports : string ;
export let returnExportsFromRuntime : string ;
export let module : string ;
export let module Id : string ;
export let module Loaded : string ;
export let publicPath : string ;
export let entryModuleId : string ;
export let module Cache : string ;
export let module Factories : string ;
export let module FactoriesAddOnly : string ;
export let ensureChunk : string ;
export let ensureChunkHandlers : string ;
export let ensureChunkIncludeEntries : string ;
export let prefetchChunk : string ;
export let prefetchChunkHandlers : string ;
export let preloadChunk : string ;
export let preloadChunkHandlers : string ;
export let definePropertyGetters : string ;
export let makeNamespaceObject : string ;
export let createFakeNamespaceObject : string ;
export let compatGetDefaultExport : string ;
export let harmonyModuleDecorator : string ;
export let nodeModuleDecorator : string ;
export let getFullHash : string ;
export let wasmInstances : string ;
export let instantiateWasm : string ;
export let uncaughtErrorHandler : string ;
export let scriptNonce : string ;
2020-06-04 08:06:57 +08:00
export let loadScript : string ;
2020-04-21 14:45:35 +08:00
export let chunkName : string ;
2020-10-23 20:52:23 +08:00
export let runtimeId : string ;
2020-04-21 14:45:35 +08:00
export let getChunkScriptFilename : string ;
export let getChunkUpdateScriptFilename : string ;
export let startup : string ;
export let startupNoDefault : string ;
2020-12-11 21:32:42 +08:00
export let startupOnlyAfter : string ;
export let startupOnlyBefore : string ;
2020-06-29 17:46:16 +08:00
export let startupEntrypoint : string ;
export let externalInstallChunk : string ;
2020-04-21 14:45:35 +08:00
export let interceptModuleExecution : string ;
export let global : string ;
2020-05-25 16:50:37 +08:00
export let shareScopeMap : string ;
export let initializeSharing : string ;
2020-09-16 16:42:50 +08:00
export let currentRemoteGetScope : string ;
2020-04-21 14:45:35 +08:00
export let getUpdateManifestFilename : string ;
export let hmrDownloadManifest : string ;
export let hmrDownloadUpdateHandlers : string ;
export let hmrModuleData : string ;
export let hmrInvalidateModuleHandlers : string ;
export let amdDefine : string ;
export let amdOptions : string ;
export let system : string ;
export let hasOwnProperty : string ;
export let systemContext : string ;
2020-08-05 05:42:29 +08:00
export let baseURI : string ;
2020-03-21 21:01:38 +08:00
}
2020-07-28 01:36:06 +08:00
export const UsageState : Readonly < {
Unused : 0 ;
OnlyPropertiesUsed : 1 ;
NoInfo : 2 ;
Unknown : 3 ;
Used : 4 ;
} > ;
2020-04-21 14:45:35 +08:00
export const WebpackOptionsValidationError : ValidationError ;
export const ValidationError : ValidationError ;
export namespace cache {
export { MemoryCachePlugin } ;
2020-03-21 21:01:38 +08:00
}
2020-04-21 14:45:35 +08:00
export namespace config {
2020-03-21 21:01:38 +08:00
export const getNormalizedWebpackOptions : (
2020-04-21 14:45:35 +08:00
config : Configuration
) = > WebpackOptionsNormalized ;
2020-03-21 21:01:38 +08:00
export const applyWebpackOptionsDefaults : (
2020-04-21 14:45:35 +08:00
options : WebpackOptionsNormalized
2020-03-21 21:01:38 +08:00
) = > void ;
}
2020-04-21 14:45:35 +08:00
export namespace ids {
2020-03-21 21:01:38 +08:00
export {
ChunkModuleIdRangePlugin ,
NaturalModuleIdsPlugin ,
OccurrenceModuleIdsPlugin ,
NamedModuleIdsPlugin ,
2020-03-26 20:50:16 +08:00
DeterministicChunkIdsPlugin ,
2020-03-21 21:01:38 +08:00
DeterministicModuleIdsPlugin ,
NamedChunkIdsPlugin ,
OccurrenceChunkIdsPlugin ,
HashedModuleIdsPlugin
} ;
}
2020-04-21 14:45:35 +08:00
export namespace javascript {
2020-08-26 03:45:56 +08:00
export {
EnableChunkLoadingPlugin ,
JavascriptModulesPlugin ,
JavascriptParser
} ;
2020-03-21 21:01:38 +08:00
}
2020-04-21 14:45:35 +08:00
export namespace optimize {
2020-03-21 21:01:38 +08:00
export {
AggressiveMergingPlugin ,
AggressiveSplittingPlugin ,
LimitChunkCountPlugin ,
MinChunkSizePlugin ,
ModuleConcatenationPlugin ,
2020-11-09 18:58:18 +08:00
RealContentHashPlugin ,
2020-03-21 21:01:38 +08:00
RuntimeChunkPlugin ,
SideEffectsFlagPlugin ,
SplitChunksPlugin
} ;
}
2020-08-19 21:05:49 +08:00
export namespace runtime {
2020-09-25 02:29:08 +08:00
export { GetChunkFilenameRuntimeModule , LoadScriptRuntimeModule } ;
2020-08-19 21:05:49 +08:00
}
2020-08-20 05:17:33 +08:00
export namespace prefetch {
export { ChunkPrefetchPreloadPlugin } ;
}
2020-04-21 14:45:35 +08:00
export namespace web {
2020-08-20 05:17:33 +08:00
export {
FetchCompileAsyncWasmPlugin ,
FetchCompileWasmPlugin ,
2020-08-25 19:20:29 +08:00
JsonpChunkLoadingRuntimeModule ,
2020-08-20 05:17:33 +08:00
JsonpTemplatePlugin
} ;
2020-03-21 21:01:38 +08:00
}
2020-04-21 14:45:35 +08:00
export namespace webworker {
2020-03-21 21:01:38 +08:00
export { WebWorkerTemplatePlugin } ;
}
2020-04-21 14:45:35 +08:00
export namespace node {
2020-03-21 21:01:38 +08:00
export {
NodeEnvironmentPlugin ,
2020-08-20 05:17:33 +08:00
NodeSourcePlugin ,
NodeTargetPlugin ,
2020-03-21 21:01:38 +08:00
NodeTemplatePlugin ,
ReadFileCompileWasmPlugin
} ;
}
2020-08-20 05:17:33 +08:00
export namespace electron {
export { ElectronTargetPlugin } ;
}
2020-04-21 14:45:35 +08:00
export namespace wasm {
2020-03-21 21:01:38 +08:00
export { AsyncWebAssemblyModulesPlugin } ;
}
2020-04-21 14:45:35 +08:00
export namespace library {
2020-03-21 21:01:38 +08:00
export { AbstractLibraryPlugin , EnableLibraryPlugin } ;
}
2020-04-22 18:09:11 +08:00
export namespace container {
2020-05-14 21:50:35 +08:00
export const scope : < T > (
scope : string ,
2020-11-26 17:49:59 +08:00
options : ContainerOptionsFormat < T >
2020-05-14 21:50:35 +08:00
) = > Record < string , string | string [ ] | T > ;
2020-04-22 18:09:11 +08:00
export {
ContainerPlugin ,
ContainerReferencePlugin ,
2020-05-26 23:26:28 +08:00
ModuleFederationPlugin
2020-04-22 18:09:11 +08:00
} ;
}
2020-05-25 16:50:37 +08:00
export namespace sharing {
export const scope : < T > (
scope : string ,
2020-11-26 17:49:59 +08:00
options : ContainerOptionsFormat < T >
2020-05-25 16:50:37 +08:00
) = > Record < string , string | string [ ] | T > ;
2020-05-26 23:11:21 +08:00
export { ConsumeSharedPlugin , ProvideSharedPlugin , SharePlugin } ;
2020-05-25 16:50:37 +08:00
}
2020-04-21 14:45:35 +08:00
export namespace debug {
export { ProfilingPlugin } ;
2020-03-21 21:01:38 +08:00
}
2020-04-21 14:45:35 +08:00
export namespace util {
export const createHash : ( algorithm : HashFunction ) = > Hash ;
export namespace comparators {
export let compareChunksById : ( a : Chunk , b : Chunk ) = > 0 | 1 | - 1 ;
export let compareModulesByIdentifier : (
a : Module ,
b : Module
) = > 0 | 1 | - 1 ;
2020-11-26 17:49:59 +08:00
export let compareModulesById : ParameterizedComparator <
ChunkGraph ,
Module
> ;
2020-04-21 14:45:35 +08:00
export let compareNumbers : ( a : number , b : number ) = > 0 | 1 | - 1 ;
export let compareStringsNumeric : ( a : string , b : string ) = > 0 | 1 | - 1 ;
2020-11-26 17:49:59 +08:00
export let compareModulesByPostOrderIndexOrIdentifier : ParameterizedComparator <
ModuleGraph ,
Module
> ;
export let compareModulesByPreOrderIndexOrIdentifier : ParameterizedComparator <
ModuleGraph ,
Module
> ;
export let compareModulesByIdOrIdentifier : ParameterizedComparator <
ChunkGraph ,
Module
> ;
export let compareChunks : ParameterizedComparator < ChunkGraph , Chunk > ;
2020-04-21 14:45:35 +08:00
export let compareIds : (
a : string | number ,
b : string | number
) = > 0 | 1 | - 1 ;
2020-07-02 19:13:13 +08:00
export let compareStrings : ( a : string , b : string ) = > 0 | 1 | - 1 ;
2020-04-21 14:45:35 +08:00
export let compareChunkGroupsByIndex : (
a : ChunkGroup ,
b : ChunkGroup
) = > 0 | 1 | - 1 ;
export let concatComparators : < T > (
2020-11-26 17:49:59 +08:00
c1 : Comparator < T > ,
c2 : Comparator < T > ,
. . . cRest : Comparator < T > [ ]
) = > Comparator < T > ;
2020-04-21 14:45:35 +08:00
export let compareSelect : < T , R > (
2020-11-26 17:49:59 +08:00
getter : Selector < T , R > ,
comparator : Comparator < R >
) = > Comparator < T > ;
2020-04-21 14:45:35 +08:00
export let compareIterables : < T > (
2020-11-26 17:49:59 +08:00
elementComparator : Comparator < T >
) = > Comparator < Iterable < T > > ;
export let keepOriginalOrder : < T > ( iterable : Iterable < T > ) = > Comparator < T > ;
2020-04-21 14:45:35 +08:00
export let compareChunksNatural : (
chunkGraph : ChunkGraph
2020-11-26 17:49:59 +08:00
) = > Comparator < Chunk > ;
2020-04-21 14:45:35 +08:00
export let compareLocations : (
2020-11-26 17:49:59 +08:00
a : DependencyLocation ,
b : DependencyLocation
2020-04-21 14:45:35 +08:00
) = > 0 | 1 | - 1 ;
}
export namespace serialization {
export let register : (
2020-11-26 17:49:59 +08:00
Constructor : Constructor ,
2020-04-21 14:45:35 +08:00
request : string ,
name : string ,
serializer : ObjectSerializer
) = > void ;
export let registerLoader : (
regExp : RegExp ,
loader : ( arg0 : string ) = > boolean
) = > void ;
2020-11-26 17:49:59 +08:00
export let registerNotSerializable : ( Constructor : Constructor ) = > void ;
2020-12-18 20:52:15 +08:00
export let NOT_SERIALIZABLE : object ;
2020-04-21 14:45:35 +08:00
export let buffersSerializer : Serializer ;
export let createFileSerializer : ( fs? : any ) = > Serializer ;
export { MEASURE_START_OPERATION , MEASURE_END_OPERATION } ;
}
2020-10-13 02:16:58 +08:00
export const cleverMerge : < T , O > ( first : T , second : O ) = > T & O ;
2020-04-21 14:45:35 +08:00
}
2020-08-20 02:05:47 +08:00
export namespace sources {
export {
Source ,
RawSource ,
OriginalSource ,
ReplaceSource ,
SourceMapSource ,
ConcatSource ,
PrefixSource ,
CachedSource ,
2020-08-20 15:54:02 +08:00
SizeOnlySource ,
CompatSource
2020-08-20 02:05:47 +08:00
} ;
}
2020-07-03 20:45:49 +08:00
export namespace experiments {
export namespace schemes {
2020-07-06 23:45:09 +08:00
export { HttpUriPlugin , HttpsUriPlugin } ;
2020-07-03 20:45:49 +08:00
}
}
2020-04-21 14:45:35 +08:00
export type WebpackPluginFunction = (
this : Compiler ,
compiler : Compiler
) = > void ;
export {
AutomaticPrefetchPlugin ,
BannerPlugin ,
Cache ,
Chunk ,
ChunkGraph ,
Compilation ,
Compiler ,
2020-09-15 16:56:06 +08:00
ConcatenationScope ,
2020-04-21 14:45:35 +08:00
ContextExclusionPlugin ,
ContextReplacementPlugin ,
DefinePlugin ,
DelegatedPlugin ,
Dependency ,
DllPlugin ,
DllReferencePlugin ,
2020-10-12 15:39:43 +08:00
DynamicEntryPlugin ,
2020-10-12 15:37:07 +08:00
EntryOptionPlugin ,
2020-04-21 14:45:35 +08:00
EntryPlugin ,
EnvironmentPlugin ,
EvalDevToolModulePlugin ,
EvalSourceMapDevToolPlugin ,
ExternalModule ,
ExternalsPlugin ,
Generator ,
2020-09-25 02:29:08 +08:00
HotUpdateChunk ,
2020-04-21 14:45:35 +08:00
HotModuleReplacementPlugin ,
IgnorePlugin ,
JavascriptModulesPlugin ,
LibManifestPlugin ,
LibraryTemplatePlugin ,
LoaderOptionsPlugin ,
LoaderTargetPlugin ,
Module ,
ModuleGraph ,
2020-10-05 22:57:31 +08:00
ModuleGraphConnection ,
2020-04-21 14:45:35 +08:00
NoEmitOnErrorsPlugin ,
NormalModule ,
NormalModuleReplacementPlugin ,
MultiCompiler ,
Parser ,
PrefetchPlugin ,
ProgressPlugin ,
ProvidePlugin ,
RuntimeModule ,
EntryPlugin as SingleEntryPlugin ,
SourceMapDevToolPlugin ,
Stats ,
Template ,
WatchIgnorePlugin ,
2020-12-17 17:08:27 +08:00
WebpackError ,
2020-04-21 14:45:35 +08:00
WebpackOptionsApply ,
WebpackOptionsDefaulter ,
2020-04-23 03:21:30 +08:00
Entry ,
EntryNormalized ,
LibraryOptions ,
ModuleOptions ,
2020-06-17 19:22:37 +08:00
ResolveOptionsWebpackOptions as ResolveOptions ,
2020-10-08 16:35:58 +08:00
RuleSetCondition ,
2020-10-08 16:37:46 +08:00
RuleSetConditionAbsolute ,
2020-04-23 03:21:30 +08:00
RuleSetRule ,
2020-10-08 16:39:05 +08:00
RuleSetUse ,
2020-10-08 16:40:00 +08:00
RuleSetUseItem ,
2020-04-21 14:45:35 +08:00
Configuration ,
2020-04-23 03:21:30 +08:00
WebpackOptionsNormalized ,
2020-11-26 17:49:59 +08:00
WebpackPluginInstance ,
2020-12-17 17:07:29 +08:00
Asset ,
AssetInfo ,
2020-11-26 17:49:59 +08:00
ParserState
2020-04-21 14:45:35 +08:00
} ;
2020-03-21 21:01:38 +08:00
}
2020-04-21 14:45:35 +08:00
export = exports ;