[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 ccc7db79ba/lib/Compiler.js (L50-L51)

* Changed run hook from taking `Compilation` parameter to taking `Compiler` parameter.
This commit is contained in:
Cameron Martin 2019-01-16 13:53:34 +00:00 committed by John Reilly
parent 5f012ded23
commit abb32ebad4
2 changed files with 5 additions and 2 deletions

View File

@ -988,8 +988,8 @@ declare namespace webpack {
shouldEmit: SyncBailHook<Compilation>;
done: AsyncSeriesHook<Stats>;
additionalPass: AsyncSeriesHook;
beforeRun: AsyncSeriesHook<Compilation>;
run: AsyncSeriesHook<Compilation>;
beforeRun: AsyncSeriesHook<Compiler>;
run: AsyncSeriesHook<Compiler>;
emit: AsyncSeriesHook<Compilation>;
afterEmit: AsyncSeriesHook<Compilation>;
thisCompilation: SyncHook<Compilation, { normalModuleFactory: NormalModuleFactory }>;

View File

@ -284,6 +284,9 @@ configuration = {
callback
);
});
this.hooks.beforeRun.tap("SomePlugin", (compiler: webpack.Compiler) => {});
this.hooks.run.tap("SomePlugin", (compiler: webpack.Compiler) => {});
}
]
};