From abb32ebad468dc1ebf6a52f9c19dfa7e91572b66 Mon Sep 17 00:00:00 2001 From: Cameron Martin Date: Wed, 16 Jan 2019 13:53:34 +0000 Subject: [PATCH] [webpack]: Fixed type of beforeRun hook. (#32208) * [webpack]: Fixed type of beforeRun hook. Previously this took a `Compilation` parameter, but actually takes a `Compiler`. See https://github.com/webpack/webpack/blob/ccc7db79bab25ed3ef49435abc8866b63721b8b6/lib/Compiler.js#L50-L51 * Changed run hook from taking `Compilation` parameter to taking `Compiler` parameter. --- types/webpack/index.d.ts | 4 ++-- types/webpack/webpack-tests.ts | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index 469fd67076..64aa5fe546 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -988,8 +988,8 @@ declare namespace webpack { shouldEmit: SyncBailHook; done: AsyncSeriesHook; additionalPass: AsyncSeriesHook; - beforeRun: AsyncSeriesHook; - run: AsyncSeriesHook; + beforeRun: AsyncSeriesHook; + run: AsyncSeriesHook; emit: AsyncSeriesHook; afterEmit: AsyncSeriesHook; thisCompilation: SyncHook; diff --git a/types/webpack/webpack-tests.ts b/types/webpack/webpack-tests.ts index 49b827d934..4d9c01ecb7 100644 --- a/types/webpack/webpack-tests.ts +++ b/types/webpack/webpack-tests.ts @@ -284,6 +284,9 @@ configuration = { callback ); }); + + this.hooks.beforeRun.tap("SomePlugin", (compiler: webpack.Compiler) => {}); + this.hooks.run.tap("SomePlugin", (compiler: webpack.Compiler) => {}); } ] };