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
hooks:Readonly<{ additionalPass: AsyncSeriesHook<[]>; afterCompile: AsyncSeriesHook<[Compilation]>; afterDone: SyncHook<[Stats]>; afterEmit: AsyncSeriesHook<[Compilation]>; afterEnvironment: SyncHook<[]>; afterPlugins: SyncHook<[Compiler]>; afterResolvers: SyncHook<[Compiler]>; assetEmitted: AsyncSeriesHook<[string, AssetEmittedInfo]>; beforeCompile: AsyncSeriesHook<[CompilationParams]>; beforeRun: AsyncSeriesHook<[Compiler]>; compilation: SyncHook<[Compilation, CompilationParams]>; compile: SyncHook<[CompilationParams]>; contextModuleFactory: SyncHook<[ContextModuleFactory]>; done: AsyncSeriesHook<[Stats]>; emit: AsyncSeriesHook<[Compilation]>; emitRecords: AsyncSeriesHook<[]>; entryOption: SyncBailHook<[string, EntryNormalized], boolean | void>; environment: SyncHook<[]>; failed: SyncHook<[Error]>; finishMake: AsyncParallelHook<[Compilation]>; infrastructureLog: SyncBailHook<[string, string, undefined | any[]], true | void>; initialize: SyncHook<[]>; invalid: SyncHook<[null | string, number]>; make: AsyncParallelHook<[Compilation]>; normalModuleFactory: SyncHook<[NormalModuleFactory]>; readRecords: AsyncSeriesHook<[]>; run: AsyncSeriesHook<[Compiler]>; shouldEmit: SyncBailHook<[Compilation], boolean | void>; shutdown: AsyncSeriesHook<[]>; thisCompilation: SyncHook<[Compilation, CompilationParams]>; validate: SyncHook<[]>; watchClose: SyncHook<[]>; watchRun: AsyncSeriesHook<[Compiler]> }>
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.

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>