vite-plugin-electron
Advanced tools
Comparing version 0.28.1 to 0.28.2
@@ -126,6 +126,6 @@ "use strict"; | ||
} else { | ||
killTree(pidTree()); | ||
killTree(pidTree({ pid, ppid: process.pid })); | ||
} | ||
} | ||
function pidTree(tree = { pid: process.pid, ppid: process.ppid }) { | ||
function pidTree(tree) { | ||
var _a; | ||
@@ -231,6 +231,3 @@ const command = process.platform === "darwin" ? `pgrep -P ${tree.pid}` : `ps -o pid --no-headers --ppid ${tree.ppid}`; | ||
startup.hookedProcessExit = true; | ||
process.once("exit", () => { | ||
startup.exit(); | ||
treeKillSync(process.electronApp.pid); | ||
}); | ||
process.once("exit", startup.exit); | ||
} | ||
@@ -242,17 +239,3 @@ } | ||
process.electronApp.removeAllListeners(); | ||
await import("tree-kill").then((m) => m.default( | ||
process.electronApp.pid, | ||
"SIGKILL", | ||
(error) => error && process.electronApp.kill() | ||
)).catch((e) => { | ||
process.electronApp.kill(); | ||
if (e.code === "ERR_MODULE_NOT_FOUND") { | ||
console.log( | ||
"[vite-plugin-electron]", | ||
'Please install tree-kill to exit all associated processes, run "npm i tree-kill -D".' | ||
); | ||
} else { | ||
console.error(e); | ||
} | ||
}); | ||
treeKillSync(process.electronApp.pid); | ||
} | ||
@@ -259,0 +242,0 @@ }; |
{ | ||
"name": "vite-plugin-electron", | ||
"version": "0.28.1", | ||
"version": "0.28.2", | ||
"description": "Electron ๐ Vite", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -361,8 +361,1 @@ <p align="center"> | ||
``` | ||
## FAQ | ||
- `electron` does not exit correctly | ไฝฟ็จctrl + c ๅๆญขไปฃ็ ๏ผelectronๅๅฐไธๅ ณ้ญ | [#122](https://github.com/electron-vite/vite-plugin-electron/pull/122), [#168](https://github.com/electron-vite/vite-plugin-electron/issues/168) | ||
* Add `tree-kill` into you dependencies, `npm i -D tree-kill`. | ||
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52130
902
361