smysnk / gulp-rev-all

Static asset revisioning with dependency considerations, appends content hash to each filename (eg. unicorn.css => unicorn.098f6bcd.css), re-writes references.
https://www.npmjs.org/package/gulp-rev-all
MIT License
422 stars 83 forks source link

Merge manifest instead of overwrite #65

Open farism opened 9 years ago

farism commented 9 years ago

gulp-rev recently merged some PR's that added support for merging into a manifest file rather than overwriting it completely. This would allow you to rev-all on an entire tmp folder, and use plugins like gulp-changed and gulp-cached to only rev changed files, and only write the changed files to the manifest. There may be a workaround using gulp-remember but I have yet to figure it out.

would this be in scope for gulp-rev-all?

circlingthesun commented 9 years ago

The problem with this is that even if a file did not change, it might reference a file that did. It would therefore need to update the reference which will result in a different hash.

On Fri, 23 Jan 2015 11:47 pm farism notifications@github.com wrote:

gulp-rev recently merged some PR's that added support for merging into a manifest file rather than overwriting it completely. This allows you to rev-all on an entire tmp folder, and use plugins like gulp-changed and gulp-cached to only rev changed files, and only write the changed files to the manifest. There may be a workaround using gulp-remember but I have yet to figure it out.

would this be in scope for gulp-rev-all?

— Reply to this email directly or view it on GitHub https://github.com/smysnk/gulp-rev-all/issues/65.

farism commented 9 years ago

That's a good point. But you could also use gulp-changed or some other caching mechanism further down in the pipeline (after rev, but before generating the manifest) to only write files to disk that have actually changed after being rev'd.

I suppose a user may implement it incorrectly (like in my original use case), but allowing a merge on the manifest means multiple sets of rev'd files could all be in the same manifest. Sure, a user is probably recommended to glob * and rev them all at the same time to make sure that all references are taken care of, but there are times when you only want to rev a subset of files and update the manifest accordingly.

shaneparsons commented 9 years ago

+1 for the ability to append to a manifest rather than re-writing it.

tigranpetrossian commented 9 years ago

@farism off topic: I'd really appreciate if you could explain on how gulp-rev's merge option helps with gulp-changed.

Briareos commented 9 years ago

+1 to this.

We're working on a complex app and would like to use it with PHP scripts. Managing a single rev-manifest file would be easier.

jonathan-soifer commented 8 years ago

:+1:

phyng commented 8 years ago

:+1:

Finally I find a trick way to do that, It works for me.

var revAll = new RevAll();
revAll.revisioner.manifest = require('./old-manifest.json');

https://github.com/smysnk/gulp-rev-all/blob/master/revisioner.js#L35

lalitkapoor commented 8 years ago

+1

manuelbieh commented 7 years ago

This does not longer work in 0.9.x - how can I achieve this in the recent version?