Inspiration

Tauri is a toolkit for building desktop apps from a web page and Rust code, and tauri dev is the command that rebuilds an app each time you save. Issue #9163, opened by anatawa12 in March 2024, showed that an allow list style .taurignore (skip everything with /*, then bring back src and a few files with !) made tauri dev stop watching the app folder. Git accepted the very same rules. Anyone who wrote their ignore file this way lost automatic rebuilds.

What it does

The merged change, tauri-apps/tauri#16398, makes the dev watcher always walk each folder it's told to watch and watch the entries that the ignore rules allow. Ignore rules no longer decide whether a watch folder is skipped as a whole. Event filtering is unchanged. Result with the reporter's file: a change to src/main.rs causes a rebuild, a change to README.md causes none.

How I built it

I reproduced the bug on the small test app inside Tauri's repository: with the reporter's .taurignore, the app folder was missing from the list of watched folders.

The cause was a check in the watcher's setup. Each watch folder was tested against the ignore rules as a whole before anything inside it got watched. The ignore crate reads patterns relative to the ignore file's folder, so asking about that folder leaves an empty path, and /* matches it.

My first commit skipped an ignore file when the path was its own folder, the way git behaves. After review, the second commit replaced that with a helper, watch_targets, built on Tauri's existing folder walker:

for (path, mode) in watch_targets(&watch_folders) {
  let _ = watcher.watch(&path, mode);
}

Two unit tests use the reporter's rules: one checks that exactly Cargo.toml and src are watched, the other that the event filter keeps src/main.rs and Cargo.toml and ignores README.md.

Challenges I ran into

Finding why a file that git handles correctly broke Tauri took comparing the two: git never applies a .gitignore to its own folder. The bigger challenge was the design. My first fix was correct but kept a special case. Legend-Master's review suggested always watching the folders and filtering events instead, and reworking the PR around that removed the special case entirely.

Accomplishments that I'm proud of

Closing an issue that had been open since March 2024. Legend-Master and FabianLars both approved, Legend-Master merged it on 12 November 2026, and it shipped in tauri-cli and @tauri-apps/cli 2.12.5.

What I learned

A detailed bug report pays off: the reporter's own file became the fixture in both tests. I also learned to treat a review question as a design input: the simplest fix here was removing a check, not improving it.

What's next

Nothing from this issue was left as a follow up. For my next contributions I'm keeping the habit this one taught me: build the first test from the reporter's own example.

The full story, with all the code, is on my blog: https://ashokramsi.hashnode.dev/one-in-taurignore-and-tauri-dev-watched-nothing

Built With

Share this project:

Updates