refactor(@angular-devkit/build-webpack): adjust callback type to support webpack 5

This commit is contained in:
Charles Lyding 2020-09-01 14:24:02 -04:00 committed by Minko Gechev
parent b5560ebebe
commit f6d9e858e5

View File

@ -52,11 +52,15 @@ export function runWebpack(
return createWebpack(config).pipe(
switchMap(webpackCompiler => new Observable<BuildResult>(obs => {
const callback = (err: Error | undefined, stats: webpack.Stats) => {
const callback = (err?: Error, stats?: webpack.Stats) => {
if (err) {
return obs.error(err);
}
if (!stats) {
return;
}
// Log stats.
log(stats, config);