diff --git a/packages/rspack/src/Compilation.ts b/packages/rspack/src/Compilation.ts index b6f66699897..14289ef7b8b 100644 --- a/packages/rspack/src/Compilation.ts +++ b/packages/rspack/src/Compilation.ts @@ -101,6 +101,7 @@ export class Compilation { hooks: { processAssets: ReturnType; + childCompiler: tapable.SyncHook<[Compiler, string, number]>; log: tapable.SyncBailHook<[string, LogEntry], true>; additionalAssets: any; optimizeModules: tapable.SyncBailHook, undefined>; @@ -159,6 +160,11 @@ export class Compilation { Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL, () => [] ), + childCompiler: new tapable.SyncHook([ + "childCompiler", + "compilerName", + "compilerIndex" + ]), log: new tapable.SyncBailHook(["origin", "logEntry"]), optimizeModules: new tapable.SyncBailHook(["modules"]), optimizeTree: new tapable.AsyncSeriesBailHook(["chunks", "modules"]), diff --git a/packages/rspack/src/Compiler.ts b/packages/rspack/src/Compiler.ts index 7997e9bf146..8eafd94f8ef 100644 --- a/packages/rspack/src/Compiler.ts +++ b/packages/rspack/src/Compiler.ts @@ -426,11 +426,11 @@ class Compiler { } } - // compilation.hooks.childCompiler.call( - // childCompiler, - // compilerName, - // compilerIndex - // ); + compilation.hooks.childCompiler.call( + childCompiler, + compilerName, + compilerIndex + ); return childCompiler; }