On this page

new Compiler(context, options?): Compiler
Attributes
context:string
the compilation path
Returns:Compiler

Creates an instance of Compiler.

Attributes
cache:Cache
compilerPath:string
context:string
fsStartTime:number
idle:boolean
immutablePaths:Set<string | RegExp>
infrastructureLogger:(value: string, type: LogTypeEnum, args?: any[]) => void
inputFileSystem:InputFileSystem | null
intermediateFileSystem:IntermediateFileSystem | null
managedPaths:Set<string | RegExp>
modifiedFiles:ReadonlySet<string>
moduleMemCaches:Map<Module, ModuleMemCachesItem>
name:string
outputFileSystem:OutputFileSystem | null
outputPath:string
parentCompilation:Compilation
platform:Readonly<PlatformTargetProperties>
records:Records
recordsInputPath:string | null
recordsOutputPath:string | null
removedFiles:ReadonlySet<string>
requestShortener:RequestShortener
resolverFactory:ResolverFactory
running:boolean
unmanagedPaths:Set<string | RegExp>
watchFileSystem:WatchFileSystem | null
watching:Watching
watchMode:boolean
webpack:typeof export=
close(callback): void
Attributes
callback:(err: Error | null, result?: void) => void
signals when the compiler closes
Returns:void

Processes the provided error callback.


compile(callback): void
Attributes
signals when the compilation finishes
Returns:void

Processes the provided compilation.


createChildCompiler(compilation, compilerName, compilerIndex, outputOptions?, plugins?): Compiler
Attributes
compilation:Compilation
the compilation
compilerName:string
the compiler's name
compilerIndex:number
the compiler's index
outputOptions:Partial<OutputNormalized>
the output options
plugins:(false | "" | 0 | WebpackPluginInstance | ((this: Compiler, compiler: Compiler) => void) | null | undefined)[]
the plugins to apply
Returns:Compiler
a child compiler

Creates a child compiler.


createCompilation(params): Compilation
Attributes
the compilation parameters
Returns:Compilation
compilation

Creates a compilation.


createContextModuleFactory(): ContextModuleFactory

createNormalModuleFactory(): NormalModuleFactory

emitAssets(compilation, callback): void
Attributes
compilation:Compilation
the compilation
callback:(err: Error | null, result?: void) => void
signals when the assets are emitted
Returns:void

Processes the provided compilation.


emitRecords(callback): void
Attributes
callback:(err: Error | null, result?: void) => void
signals when the call finishes
Returns:void

Processes the provided error callback.


getCache(name): CacheFacade
Attributes
name:string
cache name
Returns:CacheFacade
the cache facade instance

Returns the cache facade instance.


getInfrastructureLogger(name): WebpackLogger
Attributes
name:string | (() => string)
name of the logger, or function called once to get the logger name
a logger with that name

Gets infrastructure logger.


isChild(): boolean
Returns:boolean

Compilation(params): Compilation
Attributes
the compilation parameters
Returns:Compilation
the created compilation

Returns the created compilation.


CompilationParams(): { contextModuleFactory: ContextModuleFactory; normalModuleFactory: NormalModuleFactory }
Returns:{ contextModuleFactory: ContextModuleFactory; normalModuleFactory: NormalModuleFactory }

purgeInputFileSystem(): void
Returns:void

readRecords(callback): void
Attributes
callback:(err: Error | null, result?: void) => void
signals when the call finishes
Returns:void

Processes the provided error callback.


run(callback): void
Attributes
signals when the call finishes
Returns:void

Processes the provided stat.


runAsChild(callback): void
Attributes
callback:(err: Error | null, entries?: Chunk[], compilation?: Compilation) => void
signals when the call finishes
Returns:void

Processes the provided run as child callback.


validate(schema, value, options?, check?): void
Attributes
schema:JSONSchema4 & ExtendedSchema | JSONSchema6 & ExtendedSchema | JSONSchema7 & ExtendedSchema | (() => Schema)
schema
value:T
value
options:ValidationErrorConfiguration
options
check:(value: T) => boolean
options
Returns:void

Schema validation function with optional pre-compiled check


watch(watchOptions, handler): Watching | undefined
Attributes
watchOptions:WatchOptions
the watcher's options
signals when the call finishes
a compiler watcher

Returns a compiler watcher.

additionalPass(): void
Returns:void
afterCompile(compilation): void
Attributes
compilation:Compilation
Returns:void
afterDone(stats): void
Attributes
stats:Stats
Returns:void
afterEmit(compilation): void
Attributes
compilation:Compilation
Returns:void
afterEnvironment(): void
Returns:void
afterPlugins(compiler): void
Attributes
compiler:Compiler
Returns:void
afterResolvers(compiler): void
Attributes
compiler:Compiler
Returns:void
assetEmitted(string, assetEmittedInfo): void
Attributes
string:string
assetEmittedInfo:AssetEmittedInfo
Returns:void
beforeCompile(compilationParams): void
Attributes
compilationParams:CompilationParams
Returns:void
beforeRun(compiler): void
Attributes
compiler:Compiler
Returns:void
compilation(compilation, compilationParams): void
Attributes
compilation:Compilation
compilationParams:CompilationParams
Returns:void
compile(compilationParams): void
Attributes
compilationParams:CompilationParams
Returns:void
contextModuleFactory(contextModuleFactory): void
Attributes
contextModuleFactory:ContextModuleFactory
Returns:void
done(stats): void
Attributes
stats:Stats
Returns:void
emit(compilation): void
Attributes
compilation:Compilation
Returns:void
emitRecords(): void
Returns:void
entryOption(string, entryNormalized): boolean | void
Attributes
string:string
entryNormalized:EntryNormalized
Returns:boolean | void
environment(): void
Returns:void
failed(error): void
Attributes
error:Error
Returns:void
finishMake(compilation): void
Attributes
compilation:Compilation
Returns:void
infrastructureLog(string, string, arg2): true | void
Attributes
string:string
string:string
arg2:undefined | any[]
Returns:true | void
initialize(): void
Returns:void
invalid(arg0, number): void
Attributes
arg0:null | string
number:number
Returns:void
make(compilation): void
Attributes
compilation:Compilation
Returns:void
normalModuleFactory(normalModuleFactory): void
Attributes
normalModuleFactory:NormalModuleFactory
Returns:void
readRecords(): void
Returns:void
run(compiler): void
Attributes
compiler:Compiler
Returns:void
shouldEmit(compilation): boolean | void
Attributes
compilation:Compilation
Returns:boolean | void
shutdown(): void
Returns:void
thisCompilation(compilation, compilationParams): void
Attributes
compilation:Compilation
compilationParams:CompilationParams
Returns:void
validate(): void
Returns:void
watchClose(): void
Returns:void
watchRun(compiler): void
Attributes
compiler:Compiler
Returns:void

Checks whether this object is sorted.

Attributes
compilation:Compilation
content:Buffer
outputPath:string
source:Source
targetPath:string

Type:"error" | "warn" | "info" | "log" | "debug" | "clear" | "profile" | "trace" | "group" | "groupCollapsed" | "groupEnd" | "profileEnd" | "time" | "status"

Attributes
buildInfo:BuildInfo
memCache:WeakTupleMap<any[], any>