tinyglobby
tinyglobby copied to clipboard
Support `fs` option
It's needed by copy-webpack-plugin
https://github.com/benmccann/copy-webpack-plugin/blob/8fc1997406dc08ca6458fe4d4377d9aeb0d9dfe4/src/index.js#L343
https://www.npmjs.com/package/fast-glob#fs
does fdir have support for this? if not it should be added there first
No, I don't see an option for it there
Can you describe why? Our fs has caching so it speed up incremental builds
If you're asking why copy-webpack-plugin needs it, perhaps it doesn't. I just assumed it would be desired since fast-glob was using it. But based off your comment on https://github.com/webpack-contrib/copy-webpack-plugin/issues/788, perhaps we can try without it.
I'm closing this as it doesn't seem necessary
@SuperchupuDev Note - avoiding fs option can be bottleneck when you have incremental compilation, for example - I have 1000+ files and want to copy them using https://github.com/webpack-contrib/copy-webpack-plugin/. When we have fs option (i.e. allow to provide own file system), on the first cold start we cache them (stats and content), then developer added a file to directory and we trigger compilation again, it runs the copy plugin again and fs make calls again, but because they are cached it is very fast, but without this option we run real fs calls again, and it can be very slow, we recently migrate to tinyglobby (in https://github.com/webpack-contrib/copy-webpack-plugin/), but I am afraid after the official release you can get such feedback, unfortunately we can't solve this on our side, so I will refer to this problem here, I hope you will think more deeply about this problem and provide an opportunity to solve it (i.e. implement fs option). Thank you
i am in support of an fs option, however the same option would need to be added to fdir (the crawling library used here) first, since it's what does the heavy fs operations. since there is a need for the feature i'll reopen this
i've opened https://github.com/thecodrr/fdir/issues/134 on fdir - if fdir's author agrees i'll try to implement it there and pr it
Thanks for feedback, yeah, let's wait an answer
@SuperchupuDev Looks like https://github.com/thecodrr/fdir/issues/134 was resolved so we just need to allow passing the fs option
i wish we could! but we need to wait for the changes in fdir to be released. i hope it happens soon 🙏