Support file exclusion when using addDirectory
Currently the addDirectory api only support matching files via glob, which is based on wax. But it does not support exclusion currently so there is no easy way to say "match all html in this directory except these". So it would be good to have an additional option to exclude file in some way (regex, js callback, etc...).
This feature would be useful for astro-pagefind: https://github.com/shishkin/astro-pagefind/issues/104#issuecomment-2742158563
Good call — I don't see why this can't be done. The blast radius might be slightly larger in getting exclusions spread through the codebase, but the main CLI has also been needing better globbing for a while so it makes sense.