klei/gulp-inject

Order of Injected Files (with wildcard paths) is not Stable/Deterministic

jongunter opened this issue · 2 comments

First off, I just want to say, great work on this plugin! I've been using it for almost a year now and it's excellent.

Recently, I've noticed, as my application has grown to include many injected JS/CSS files, that the ordering of files is not pure/stable/deterministic. In other words, if I run the the gulp-inject twice in the exact same setup (exact same files with same contents), my files will be injected with a different order each time, mostly for files/folders in my stream that use wildcards in their names.

While it seems like a trivial issue to most, the specific build setup in my enterprise/legacy environment calls gulp-inject anytime a file is changed. This results in a bunch of HTML files constantly appearing as "changed" on my version control, even though the actual files being injected haven't changed, just the order.

It seems weird that files would be injected in different order given exact same context/state in the file system? This may be NPM/gulp issue? If someone could provide more insight here, I would certainly appreciate it.

Did you ever figure a way around this?