Skip to content

Commit 0bb96d6

Browse files
committed
fix(dts): gracefully shutdown when panic
1 parent bc07f4d commit 0bb96d6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/plugin-dts/src/dts.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,11 @@ export async function generateDts(data: DtsGenOptions): Promise<void> {
286286
}
287287
}
288288

289+
// Graceful shutdown on disconnect when panic
290+
process.on('disconnect', () => {
291+
process.exit();
292+
});
293+
289294
process.on('message', async (data: DtsGenOptions) => {
290295
if (!data.cwd) {
291296
return;

0 commit comments

Comments
 (0)