Skip to content

Commit c455b66

Browse files
kinfuykinfuy
authored andcommitted
fix: ctrl+c no longer kills processes(#2)
1 parent 11766e9 commit c455b66

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@
3535
"open": "^8.4.0",
3636
"cross-spawn": "^7.0.3"
3737
},
38-
"version": "0.0.5"
38+
"version": "0.0.6"
3939
}

package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vite-plugin-shortcuts",
3-
"version": "0.0.5",
3+
"version": "0.0.6",
44
"description": "plugin shortcuts into Vite dev server",
55
"keywords": [
66
"vite",

package/shortcuts.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,8 @@ export function bindShortcuts(
2929
const onInput = async (input: string) => {
3030
// ctrl+c or ctrl+d
3131
if (input === '\x03' || input === '\x04') {
32-
// TODO npm run all ctrl c need double
33-
// server.config.logger.warn(
34-
// colors.yellow(
35-
// 'starts vite dev server with the JS API ctrl c or ctrl d need double'
36-
// )
37-
// );
38-
process.emit('SIGTERM');
32+
// from https://github.com/vitejs/vite/pull/11563
33+
await server.close().finally(() => process.exit(1));
3934
return;
4035
}
4136

0 commit comments

Comments
 (0)