fix: handle SIGTERM in build command (#5813)

This commit is contained in:
Sébastien Lorber 2021-10-28 19:20:07 +02:00 committed by GitHub
parent 96da25e422
commit 768600e5d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -36,6 +36,10 @@ export default async function build(
// TODO what's the purpose of this arg ?
forceTerminate: boolean = true,
): Promise<string> {
['SIGINT', 'SIGTERM'].forEach((sig) => {
process.on(sig, () => process.exit());
});
async function tryToBuildLocale({
locale,
isLastLocale,

View file

@ -232,7 +232,7 @@ export default async function start(
});
['SIGINT', 'SIGTERM'].forEach((sig) => {
process.on(sig as NodeJS.Signals, () => {
process.on(sig, () => {
devServer.close();
process.exit();
});