Compiler Hooks

environment

SyncHook<[]>

Called while preparing the compiler environment, right after initializing the plugins in the configuration file.

afterEnvironment

SyncHook<[]>

Called right after the environment hook, when the compiler environment setup is complete.

afterPlugins

SyncHook<[Compiler]>

Called after setting up initial set of internal plugins.

afterResolvers

SyncHook<[Compiler]>

Triggered after resolver setup is complete.

entryOption

SyncBailHook<[string, EntryNormalized]>

Called after the entry configuration has been processed.

initialize

SyncHook<[]>

Called when a compiler object is initialized.

beforeRun

AsyncSeriesHook<[Compiler]>

Adds a hook right before running the compiler.

run

AsyncSeriesHook<[Compiler]>

Called at the beginning of a build execution.

childCompiler

SyncHook[Compiler, string, number]

where the version of the function type is >=0.4.1.

Executed after created a childCompiler.

watchRun

AsyncSeriesHook<[Compiler]>

Executes a plugin during watch mode after a new compilation is triggered but before the compilation is actually started.

compile

SyncHook<[]>

Called right after beforeCompile, before a new compilation is created.

beforeCompile

AsyncSeriesHook<[]>

Executes a plugin after compilation parameters are created.

afterCompile

AsyncSeriesHook<[Compilation]>

Called after finishing and sealing the compilation.

thisCompilation

SyncHook<[Compilation]>

Executed while initializing the compilation, right before emitting the compilation event.

compilation

SyncHook<[Compilation]>

Runs a plugin after a compilation has been created.

make

AsyncParallelHook<[Compilation]>

Executed before the make stage.

shouldEmit

SyncBailHook<[Compilation]>

where the version of the function type is >=0.4.1.

Return a boolean telling whether to emit.

emit

AsyncSeriesHook<[Compilation]>

Executed right before emitting assets to output directory.

afterEmit

AsyncSeriesHook<[Compilation]>

Called after emitting assets to output directory.

done

AsyncSeriesHook<Stats>

Executed when the compilation has completed.

afterDone

AsyncSeriesHook<Stats>

Executed after done hook.

watchClose

SyncHook<[]>

Called when a watching compilation has stopped.

failed

SyncHook<[Error]>

Called if the compilation fails.