Skip to content

fix(plugin-vite): ignore .git directory in dev mode file watcher#4213

Merged
erickzhao merged 1 commit intonextfrom
fix/vite-ignore-git-watch
Apr 14, 2026
Merged

fix(plugin-vite): ignore .git directory in dev mode file watcher#4213
erickzhao merged 1 commit intonextfrom
fix/vite-ignore-git-watch

Conversation

@erickzhao
Copy link
Copy Markdown
Member

@erickzhao erickzhao commented Apr 13, 2026

Summary

  • Adds **/.git/** to the Rolldown watch.exclude pattern in getBuildConfig() when running in dev mode
  • Prevents unnecessary HMR reloads triggered by git operations (e.g. rebase writing to .git/rebase-merge/)

Context

When running electron-forge start with plugin-vite, the base build config sets watch: {} with no ignored patterns. This means Rolldown watches the entire project directory, including .git/ subdirectories. Any git operation that writes files (rebase, merge, cherry-pick) triggers rebuilds and Vite HMR reloads.

Test plan

  • Run electron-forge start with the Vite plugin
  • Perform a git rebase in the project directory during dev
  • Verify no HMR reloads are triggered by .git/ file changes

🤖 Generated with Claude Code

@erickzhao erickzhao requested a review from a team as a code owner April 13, 2026 20:40
@github-actions github-actions Bot added the next label Apr 13, 2026
When running in dev mode, the Rolldown watch config is set to `{}` with
no `ignored` patterns. This causes Rolldown to watch `.git/`
subdirectories, triggering unnecessary HMR reloads during git
operations like rebase (which writes to `.git/rebase-merge/`).
@erickzhao erickzhao force-pushed the fix/vite-ignore-git-watch branch from c8493a8 to e91951c Compare April 13, 2026 21:31
@erickzhao erickzhao merged commit a864302 into next Apr 14, 2026
17 checks passed
@erickzhao erickzhao deleted the fix/vite-ignore-git-watch branch April 14, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants