Skip to main content
webpack / Compiler

Class: Compiler

Defined in: webpack/types.d.ts:2876

Constructors

Constructor

new Compiler(context, options?): Compiler
Defined in: webpack/types.d.ts:2877

Parameters

context
string
options?
WebpackOptionsNormalized

Returns

Compiler

Properties

cache

cache: Cache
Defined in: webpack/types.d.ts:2961

compilerPath

compilerPath: string
Defined in: webpack/types.d.ts:2963

context

context: string
Defined in: webpack/types.d.ts:2959

contextTimestamps?

optional contextTimestamps: Map<string, "ignore" | EntryTypesIndex | OnlySafeTimeEntry | ExistenceOnlyTimeEntryTypesIndex>
Defined in: webpack/types.d.ts:2942

fileTimestamps?

optional fileTimestamps: Map<string, "ignore" | EntryTypesIndex | OnlySafeTimeEntry | ExistenceOnlyTimeEntryTypesIndex>
Defined in: webpack/types.d.ts:2934

fsStartTime?

optional fsStartTime: number
Defined in: webpack/types.d.ts:2950

hooks

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]>; }>
Defined in: webpack/types.d.ts:2878

idle

idle: boolean
Defined in: webpack/types.d.ts:2965

immutablePaths

immutablePaths: Set<string | RegExp>
Defined in: webpack/types.d.ts:2931

infrastructureLogger()?

optional infrastructureLogger: (value, type, args?) => void
Defined in: webpack/types.d.ts:2952

Parameters

value
string
type
LogTypeEnum
args?
any[]

Returns

void

inputFileSystem

inputFileSystem: InputFileSystem
Defined in: webpack/types.d.ts:2924

intermediateFileSystem

intermediateFileSystem: IntermediateFileSystem
Defined in: webpack/types.d.ts:2923

managedPaths

managedPaths: Set<string | RegExp>
Defined in: webpack/types.d.ts:2929

modifiedFiles?

optional modifiedFiles: ReadonlySet<string>
Defined in: webpack/types.d.ts:2932

moduleMemCaches?

optional moduleMemCaches: Map<Module, ModuleMemCachesItem>
Defined in: webpack/types.d.ts:2962

name?

optional name: string
Defined in: webpack/types.d.ts:2917

options

options: WebpackOptionsNormalized
Defined in: webpack/types.d.ts:2958

outputFileSystem

outputFileSystem: OutputFileSystem
Defined in: webpack/types.d.ts:2922

outputPath

outputPath: string
Defined in: webpack/types.d.ts:2920

parentCompilation?

optional parentCompilation: Compilation
Defined in: webpack/types.d.ts:2918

platform

platform: Readonly<PlatformTargetProperties>
Defined in: webpack/types.d.ts:2957

records

records: Records
Defined in: webpack/types.d.ts:2928

recordsInputPath

recordsInputPath: string
Defined in: webpack/types.d.ts:2926

recordsOutputPath

recordsOutputPath: string
Defined in: webpack/types.d.ts:2927

removedFiles?

optional removedFiles: ReadonlySet<string>
Defined in: webpack/types.d.ts:2933

requestShortener

requestShortener: RequestShortener
Defined in: webpack/types.d.ts:2960

resolverFactory

resolverFactory: ResolverFactory
Defined in: webpack/types.d.ts:2951

root

root: Compiler
Defined in: webpack/types.d.ts:2919

running

running: boolean
Defined in: webpack/types.d.ts:2964

unmanagedPaths

unmanagedPaths: Set<string | RegExp>
Defined in: webpack/types.d.ts:2930

watchFileSystem

watchFileSystem: WatchFileSystem
Defined in: webpack/types.d.ts:2925

watching?

optional watching: Watching
Defined in: webpack/types.d.ts:2921

watchMode

watchMode: boolean
Defined in: webpack/types.d.ts:2966

webpack

webpack: typeof export=
Defined in: webpack/types.d.ts:2916

Methods

close()

close(callback): void
Defined in: webpack/types.d.ts:3013

Parameters

callback
(err, result?) => void

Returns

void

compile()

compile(callback): void
Defined in: webpack/types.d.ts:3012

Parameters

callback
CallbackWebpackFunction_2<Compilation, void>

Returns

void

createChildCompiler()

createChildCompiler(compilation, compilerName, compilerIndex, outputOptions?, plugins?): Compiler
Defined in: webpack/types.d.ts:2988

Parameters

compilation
Compilation
compilerName
string
compilerIndex
number
outputOptions?
Partial<OutputNormalized>
plugins?
(false | "" | 0 | WebpackPluginInstance | (this, compiler) => void)[]

Returns

Compiler

createCompilation()

createCompilation(params): Compilation
Defined in: webpack/types.d.ts:3004

Parameters

params
CompilationParams

Returns

Compilation

createContextModuleFactory()

createContextModuleFactory(): ContextModuleFactory
Defined in: webpack/types.d.ts:3007

Returns

ContextModuleFactory

createNormalModuleFactory()

createNormalModuleFactory(): NormalModuleFactory
Defined in: webpack/types.d.ts:3006

Returns

NormalModuleFactory

emitAssets()

emitAssets(compilation, callback): void
Defined in: webpack/types.d.ts:2982

Parameters

compilation
Compilation
callback
(err, result?) => void

Returns

void

emitRecords()

emitRecords(callback): void
Defined in: webpack/types.d.ts:2986

Parameters

callback
(err, result?) => void

Returns

void

getCache()

getCache(name): CacheFacade
Defined in: webpack/types.d.ts:2967

Parameters

name
string

Returns

CacheFacade

getInfrastructureLogger()

getInfrastructureLogger(name): WebpackLogger
Defined in: webpack/types.d.ts:2968

Parameters

name
string | () => string

Returns

WebpackLogger

isChild()

isChild(): boolean
Defined in: webpack/types.d.ts:3003

Returns

boolean

newCompilation()

newCompilation(params): Compilation
Defined in: webpack/types.d.ts:3005

Parameters

params
CompilationParams

Returns

Compilation

newCompilationParams()

newCompilationParams(): object
Defined in: webpack/types.d.ts:3008

Returns

object
contextModuleFactory
contextModuleFactory: ContextModuleFactory
normalModuleFactory
normalModuleFactory: NormalModuleFactory

purgeInputFileSystem()

purgeInputFileSystem(): void
Defined in: webpack/types.d.ts:2981

Returns

void

readRecords()

readRecords(callback): void
Defined in: webpack/types.d.ts:2987

Parameters

callback
(err, result?) => void

Returns

void

run()

run(callback): void
Defined in: webpack/types.d.ts:2973

Parameters

callback
CallbackWebpackFunction_2<Stats, void>

Returns

void

runAsChild()

runAsChild(callback): void
Defined in: webpack/types.d.ts:2974

Parameters

callback
(err, entries?, compilation?) => void

Returns

void

validate()

validate<T>(schema, value, options?, check?): void
Defined in: webpack/types.d.ts:3018 Schema validation function with optional pre-compiled check

Type Parameters

T
T extends object | object[] = object

Parameters

schema
JSONSchema4 & ExtendedSchema | JSONSchema6 & ExtendedSchema | JSONSchema7 & ExtendedSchema | () => Schema
value
T
options?
ValidationErrorConfiguration
check?
(value) => boolean

Returns

void

watch()

watch(watchOptions, handler): Watching
Defined in: webpack/types.d.ts:2969

Parameters

watchOptions
WatchOptions
handler
CallbackWebpackFunction_2<Stats, void>

Returns

Watching