fix(plugin-vite): ignore .git directory in dev mode file watcher#4213
Merged
fix(plugin-vite): ignore .git directory in dev mode file watcher#4213
Conversation
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/`).
c8493a8 to
e91951c
Compare
BlackHole1
approved these changes
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
**/.git/**to the Rolldownwatch.excludepattern ingetBuildConfig()when running in dev mode.git/rebase-merge/)Context
When running
electron-forge startwithplugin-vite, the base build config setswatch: {}with noignoredpatterns. 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
electron-forge startwith the Vite plugingit rebasein the project directory during dev.git/file changes🤖 Generated with Claude Code