klei / gulp-inject

A javascript, stylesheet and webcomponent injection plugin for Gulp
MIT License
812 stars 93 forks source link

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

Open jongunter opened 7 years ago

jongunter commented 7 years ago

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.

niels1voo commented 7 years ago

+1

jake-lambert-volusion commented 6 years ago

Did you ever figure a way around this?