-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for recursive directory search / patterns #47
Comments
The following seems to be a workaround for the issue, in case it helps in getting this into the default package. Basically using System.IO to build an array of filenames (recursive) using standard directory pattern matching. The Create Overload accepting JavaScriptFile[] seems to work fine with this.
Maybe a JavaScriptFolder() object could be added in addition to the string naming convention. The constructor would take the path, search pattern, and a recursive true/false. |
This seems to be working internally in my project. Its a start.
usage
|
I was also thinking of using the globbing patterns built in to ASP.Net core, the syntax currently used was created before the globbing patterns stuff in ASP.Net Core existed. So can look into that and also these extension methods. thanks! |
Shameless plug: i''ve recently built a super fast Glob library, ( with benchmarks ) it's usually more than 80℅ faster at matching compared to a compiled regex. It implements more of the Globbing spec than the out of box pattern matcher stuff in asp.net/filesystem. you can find it here: https://github.com/dazinator/DotNet.Glob feel free to take a look. And here is an IFileProvider extension method I put together that will let you get search all files using a set of include/s exclude/s patterns, that leverage dotnet.glob for the matching: https://github.com/dazinator/Dazinator.AspNet.Extensions.FileProviders/blob/master/src/Dazinator.AspNet.Extensions.FileProviders/IFileProviderExtensions.cs#L69 |
Nice! I probably wont have time to getting this fixed for the 2.0 release (which might hopefully be soon) but of course PRs are most welcome! |
Would be good to allow the glob / matcher that gets used to be a service perhaps. By default you could register one based on aspnet/filesystem pattern matcher, but this could be overridden if for example, you wanted to use more advanced glob syntax then it would be possible to override the default service with one based on dotnet.glob! |
I'll have a go at a PR when I next get an hour or so to spare :-) |
Hi, when approximately this enhancement will be released? I mean |
@Shazwazza @dazinator |
Yeah I agree. Dotnet.Glob provides glob pattern matching against a string, it doesnt care where the string comes from - but IFileProvider is the correct abstraction for the modern microsoft stack. |
Sorry have been on vacation, I'll have a look at this real soon |
This is finally done. There's a service responsible for this: By default the underlying IFileProvider is a PhysicalFileSystem. If this isn't change then the globbing is done via .NET's |
It doesn't look like Smidge is supporting recursive directory search when building a bundle.
Folder Structure
Setup
jquery.js does not get found, regardless of debug mode when rendering. If I move jquery.js into the lib folder directly, it works.
The text was updated successfully, but these errors were encountered: