From 1b6b741b96991eb00e475de3ffde618777e7e826 Mon Sep 17 00:00:00 2001 From: Sean Larkin Date: Tue, 16 May 2023 22:34:18 +0000 Subject: [PATCH] docs(types): Add docs for compilation.afterChunks hook --- lib/Compilation.js | 7 ++++++- types.d.ts | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/Compilation.js b/lib/Compilation.js index 23d61065b33..5c6a363ec75 100644 --- a/lib/Compilation.js +++ b/lib/Compilation.js @@ -647,7 +647,12 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si /** @type {SyncHook<[]>} */ beforeChunks: new SyncHook([]), - /** @type {SyncHook<[Iterable]>} */ + /** + * The `afterChunks` hook is called directly after the chunks and module graph have + * been created and before the chunks and modules have been optimized. This hook is useful to + * inspect, analyze, and/or modify the chunk graph. + * @type {SyncHook<[Iterable]>} + */ afterChunks: new SyncHook(["chunks"]), /** @type {SyncBailHook<[Iterable]>} */ diff --git a/types.d.ts b/types.d.ts index 1a31f032470..0009c9bf054 100644 --- a/types.d.ts +++ b/types.d.ts @@ -1452,6 +1452,11 @@ declare class Compilation { unseal: SyncHook<[]>; seal: SyncHook<[]>; beforeChunks: SyncHook<[]>; + /** + * The `afterChunks` hook is called directly after the chunks and module graph have + * been created and before the chunks and modules have been optimized. This hook is useful to + * inspect, analyze, and/or modify the chunk graph. + */ afterChunks: SyncHook<[Iterable]>; optimizeDependencies: SyncBailHook<[Iterable], any>; afterOptimizeDependencies: SyncHook<[Iterable]>;