From 59ca35b44b7dde4b077e5aa4aedecfb3a27e1acd Mon Sep 17 00:00:00 2001 From: Samuel Schultze Date: Tue, 8 Nov 2022 18:08:49 -0300 Subject: [PATCH] fix(webpack): close compiler after run (#10080) --- packages/webpack5/src/bin/index.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/webpack5/src/bin/index.ts b/packages/webpack5/src/bin/index.ts index 1793c87eb..5fa8b394e 100644 --- a/packages/webpack5/src/bin/index.ts +++ b/packages/webpack5/src/bin/index.ts @@ -150,7 +150,14 @@ program webpackCompilationCallback ); } else { - compiler.run(webpackCompilationCallback); + compiler.run((err, status) => { + compiler.close((err2) => + webpackCompilationCallback( + (err || err2) as webpack.WebpackError, + status + ) + ); + }); } });