Skip to content

Commit f81b32f

Browse files
committed
fix: add vite.config.js.timestamp files to default ignored
1 parent 58f2aad commit f81b32f

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hot-hook": patch
3+
---
4+
5+
[Vite has a bug](https://github.com/vitejs/vite/issues/13267) that causes a `vite.config.js.timestamp-*` file to be created and persisted under certain conditions. When Hot-Hook is used with Vite, this bug can sometimes cause the server to restart indefinitely. Consequently, this commit adds these files by default to Hot-Hook's `ignore` config.

packages/hot_hook/src/hot.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,16 @@ class Hot {
4545
async init(options: InitOptions) {
4646
this.#options = Object.assign(
4747
{
48-
ignore: ['**/node_modules/**'],
48+
ignore: [
49+
'**/node_modules/**',
50+
/**
51+
* Vite has a bug where it create multiple files with a
52+
* timestamp. This cause hot-hook to restart in loop.
53+
* See https://github.com/vitejs/vite/issues/13267
54+
*/
55+
'**/vite.config.js.timestamp*',
56+
'**/vite.config.ts.timestamp*',
57+
],
4958
restart: ['.env'],
5059
},
5160
options

0 commit comments

Comments
 (0)