Skip to content

Commit

Permalink
fix(dev): keep using taskkill on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori committed May 3, 2023
1 parent 8b182d3 commit 0004c51
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/remix-dev/devServer_unstable/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,15 @@ let relativePath = (file: string) => path.relative(process.cwd(), file);

let kill = async (p?: execa.ExecaChildProcess) => {
if (p === undefined) return;

let channel = Channel.create<void>();
p.kill("SIGTERM", { forceKillAfterTimeout: 1_000 });
p.on("exit", channel.ok);

// https://github.com/nodejs/node/issues/12378
if (process.platform === "win32") {
await execa("taskkill", ["/pid", String(p.pid), "/f", "/t"]);
} else {
p.kill("SIGTERM", { forceKillAfterTimeout: 1_000 });
}

await channel.result;
};

0 comments on commit 0004c51

Please sign in to comment.