Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: graceful exit terminal #3075

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
chore: rebase
  • Loading branch information
rishabh3112 committed Feb 22, 2022
commit 22e92c4b40d92f87d9b97fc8d9e6f02228aa6da3
18 changes: 11 additions & 7 deletions packages/webpack-cli/src/webpack-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2496,9 +2496,11 @@ class WebpackCLI implements IWebpackCLI {
return;
}

const isCacheEnabled = compiler.compilers
? compiler.compilers.some((compiler) => compiler.options.cache)
: compiler.options.cache;
const isCacheEnabled = Boolean(
this.isMultipleCompiler(compiler)
? compiler.compilers.some((compiler) => compiler.options.cache)
: compiler.options.cache,
);

let needForceShutdown = false;

Expand Down Expand Up @@ -2526,10 +2528,12 @@ class WebpackCLI implements IWebpackCLI {
});
}

const isWatch = (compiler) =>
compiler.compilers
? compiler.compilers.some((compiler) => compiler.options.watch)
: compiler.options.watch;
const isWatch = (compiler: WebpackCompiler): boolean =>
Boolean(
this.isMultipleCompiler(compiler)
? compiler.compilers.some((compiler) => compiler.options.watch)
: compiler.options.watch,
);

if (isWatch(compiler) && this.needWatchStdin(compiler)) {
process.stdin.on("end", () => {
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.