Skip to content

Commit

Permalink
fixup! Allow --experimental-local to cleanly exit on x/CTRL-C
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbbot committed Dec 15, 2022
1 parent 4c90039 commit b3540d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/wrangler/src/dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -520,10 +520,12 @@ export async function startDev(args: StartDevOptions) {
// following line disconnects from the IPC channel when we press `x` or
// CTRL-C in interactive mode, ensuring no open handles, and allowing for a
// clean exit. Note, if we called `stop()` using the dev API, we don't want
// to disconnect here, as the user may still need IPC.
// to disconnect here, as the user may still need IPC. We also don't want
// to disconnect if this file was imported in Jest (not the case with E2E
// tests), as that would stop communication with the test runner.
let apiStopped = false;
void devReactElement.waitUntilExit().then(() => {
if (!apiStopped) process.disconnect?.();
if (!apiStopped && typeof jest === "undefined") process.disconnect?.();
});

rerender = devReactElement.rerender;
Expand Down

0 comments on commit b3540d5

Please sign in to comment.