Is file ordering from globs supposed to be consistent? #2747
Unanswered
deviantintegral
asked this question in
Help
Replies: 1 comment
-
Ooph, yeah, this is an unpleasant surprise. I would expect glob file ordering to be consistent. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We ran into a bug today that appears to be caused by how gulp returns files from
src()
. Every time it runs, the order of files returned are different, leading to inconsistent builds.I created a minimal example to show this that globs all JS files in the
node_modules
directory, hashes the returned paths, and then does the same after sorting. We can see each time the hashes of the original set of files change:https://github.com/deviantintegral/gulp-sorting-example
As I found, there is a plugin to sort files, but I was surprised to see this not be used by default everywhere in various projects. As well, this seems to break expectations for users from other ecosystems. For example, we can see bash globs are both consistent and sorted:
Beta Was this translation helpful? Give feedback.
All reactions