Watch() - Exclude pattern
dazinator opened this issue · 3 comments
When watching() it's often quite useful to watch based on an include list and an exclude list.
For example watch all *.js files, except for "bundle.js".
The IFileProvider
interface at the moment only allows watching a single include pattern.
This would be more useful:
IChangeToken Watch(string[] includePatterns, string[] excludePatterns);
include and exclude are also useful when searching for files, however this was easier to solve, as you can write your own searching implementation that sits on top of the provider:
However watching() is different, because the underlying provider can only watch a single pattern and has no concept of exclude. So to implement an extension method that would do a watch() using an include and exclude list, you'd currently have to have the underlying provider watch more files than necessary for changes, and then evaluate against the exclude filters after change tokens have been signalled. This is not nice as change tokens are still signalled when not necessary by the underlying IFileProvider.
Any thoughts on this anyone?
This issue was moved to dotnet/aspnetcore#2544