From 7cbd852fe5a2d1ef84049c48c30f51f1170cc5de Mon Sep 17 00:00:00 2001
From: tamaina <tamaina@hotmail.co.jp>
Date: Mon, 29 May 2023 06:37:13 +0900
Subject: [PATCH] =?UTF-8?q?pnpm=20dev=E3=81=A7Ctrl+C=E3=81=A7=E7=B5=82?=
 =?UTF-8?q?=E4=BA=86=E3=81=95=E3=81=9B=E3=81=A6=E3=82=82=E3=83=97=E3=83=AD?=
 =?UTF-8?q?=E3=82=BB=E3=82=B9=E3=81=8C=E5=AE=8C=E5=85=A8=E3=81=AB=E6=AE=BA?=
 =?UTF-8?q?=E3=81=9B=E3=81=AA=E3=81=84=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?=
 =?UTF-8?q?=20(#10914)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 scripts/dev.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/scripts/dev.js b/scripts/dev.js
index db7bc11feb..2f20d8f07c 100644
--- a/scripts/dev.js
+++ b/scripts/dev.js
@@ -44,11 +44,17 @@ const fs = require('fs');
 			if (!stat) throw new Error('not exist yet');
 			if (stat.size === 0) throw new Error('not built yet');
 
-			await execa('pnpm', ['start'], {
+			const subprocess = await execa('pnpm', ['start'], {
 				cwd: __dirname + '/../',
 				stdout: process.stdout,
 				stderr: process.stderr,
 			});
+
+			// なぜかworkerだけが終了してmasterが残るのでその対策
+			process.on('SIGINT', () => {
+				subprocess.kill('SIGINT');
+				process.exit(0);
+			});
 		} catch (e) {
 			await new Promise(resolve => setTimeout(resolve, 3000));
 			start();
-- 
GitLab