Have dotnet watch track files more dynamically
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
### Issue:
I am trying to utilize a combination of dotnet watch and another task runner. Given a task that is generating a number of files, one might tend to want to delete all the files in the output folder before re-building cleanly. If these deleted files are part of the dotnet watch list, watch will no longer live reload the page if any of these files change and have the same name.
High level example:
- I have a gulp.watch task that has a binding to execute when the project opens / is built.
- My watch task will first delete "wwwroot/someFolder", then rebuild all files and output them back into "wwwroot/someFolder". Think assets or CSS files or anything really.
- dotnet watch will no longer track any changes **unless** I comment out the delete parts of my task.
### Describe the solution you'd like
It seems like dotnet watch is tracking/caching a pointer to a specific "wwwroot/css/styles.css" for example, and if that file gets deleted and re-created I would like to see the page refresh.
In other words, if your implementation is going to default to include watching "wwwroot\**" then it shouldn't matter what happens in there, any change to the filesystem and you should refresh.
For now I will remove the deletion part of the watch task and leave it solely to a initial Build or Dist build gulp task.
### Additional context
It matters not if my glob target is "wwwroot/someFolder" or "wwwroot/someFolder/**/*" on the deletion path, as soon as it wipes the files, watch doesn't reload.
I have not logged this as a bug as I don't know if it is in fact something wrong on my implementation, or a default behavior on your end. Further, I wouldn't believe that everyone wants this necessarily, however they do have the Exclude option.
Thanks for your time.
Contributor guide
Assessment
This issue has not been assessed yet.