Closed gothy closed 9 years ago
Your best bet would be to pipe the manifest through something to sort it alphabetically by keys before writing it to disk. Otherwise, the merge will just move whatever's new to the bottom.
I guess we could sort the keys when merging. Don't see any downside doing that. npm does so to with package.json dependencies.
Yeah, I don't have a strong preference one way or the other. Sorting the keys seems like a sane default?
If we're going to sort on merge, we should sort 'em even if we don't merge, since directory order is nondeterministic.
Yes, let's go with that.
Wow... that was fast :) Can I hope to see an update soon on npm? :) Thanks a lot!
I'm here because sorting the keys ruins it for me! Is it possible to use this as an option instead?
I need the files in the original order because all vendor files needs to be in the beginning.
Given that it's a hash map and there is no additional complexity accessing keys farther down the list, why do vendor files need to be at the top?
Either way, this isn't something we are likely to support. I recommend writing a custom parser using fs
and JSON.parse
to achieve what you are looking for.
Hi
I'm trying to make this merging this work the way I expect and failing in this. Each time I'm running gulp-rev on unchanged repo, I can see changes in rev-manifest.json output. Everything is fine except the line order in output. So merging is OK, tail revisions are fine, but I get a diff in git each time. I know it's not very nice to have build/dist sitting in the repo, but this is a requirement for now. Is there any way to force the output be exactly the same when running with merge: true?
Thanks!