Skip to content

Commit af33801

Browse files
committed
fix: close compiler on SIGINT
1 parent 8378740 commit af33801

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/webpack-cli/lib/webpack-cli.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,13 +2125,18 @@ class WebpackCLI {
21252125
return;
21262126
}
21272127

2128+
process.on("SIGINT", () => {
2129+
compiler.close();
2130+
});
2131+
21282132
const isWatch = (compiler) =>
21292133
compiler.compilers
21302134
? compiler.compilers.some((compiler) => compiler.options.watch)
21312135
: compiler.options.watch;
21322136

21332137
if (isWatch(compiler) && this.needWatchStdin(compiler)) {
21342138
process.stdin.on("end", () => {
2139+
compiler.close();
21352140
process.exit(0);
21362141
});
21372142
process.stdin.resume();

0 commit comments

Comments
 (0)