Skip to content

Commit 18ccd6b

Browse files
committed
Listen for signal termination as well
1 parent 301a8a9 commit 18ccd6b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

vite.config.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ const hydeVitePlugin = () => ({
1616
fs.writeFileSync(path.resolve(process.cwd(), 'app/storage/framework/cache/vite.hot'), '');
1717

1818
// Remove hot file when Vite server closes
19-
process.on('SIGINT', () => {
20-
fs.rmSync(path.resolve(process.cwd(), 'app/storage/framework/cache/vite.hot'));
21-
process.exit();
19+
['SIGINT', 'SIGTERM'].forEach(signal => {
20+
process.on(signal, () => {
21+
fs.rmSync(path.resolve(process.cwd(), 'app/storage/framework/cache/vite.hot'));
22+
process.exit();
23+
});
2224
});
2325

2426
// Render the Vite index page when the root URL is requested

0 commit comments

Comments
 (0)