Skip to content

Commit

Permalink
fix: add vite.config.js.timestamp files to default ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien-R44 committed May 14, 2024
1 parent 58f2aad commit f81b32f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/unlucky-scissors-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hot-hook": patch
---

[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.
11 changes: 10 additions & 1 deletion packages/hot_hook/src/hot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,16 @@ class Hot {
async init(options: InitOptions) {
this.#options = Object.assign(
{
ignore: ['**/node_modules/**'],
ignore: [
'**/node_modules/**',
/**
* Vite has a bug where it create multiple files with a
* timestamp. This cause hot-hook to restart in loop.
* See https://github.com/vitejs/vite/issues/13267
*/
'**/vite.config.js.timestamp*',
'**/vite.config.ts.timestamp*',
],
restart: ['.env'],
},
options
Expand Down

0 comments on commit f81b32f

Please sign in to comment.