Skip to content

Commit 301a8a9

Browse files
committed
Remove hot file on Node signal interrupt
1 parent b42adba commit 301a8a9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

vite.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ 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-
server.httpServer?.on('close', () => {
20-
fs.unlinkSync(path.resolve(process.cwd(), 'app/storage/framework/cache/vite.hot'));
19+
process.on('SIGINT', () => {
20+
fs.rmSync(path.resolve(process.cwd(), 'app/storage/framework/cache/vite.hot'));
21+
process.exit();
2122
});
2223

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

0 commit comments

Comments
 (0)