gulp-rev-outdated
Old static asset revision files filter.
Install
$ npm install --save-dev gulp-rev-outdated
Usage
We can use gulp-rev to cache-bust several assets. Every modification of source files caused a new revisioned asset creation. In case of using separate http://static.exsample.com/ domain for distributing static assets we have some problem with a lot of accumulated revisioned asset files. If we have several different frontends (e.q. [www-1.exsample.com, www-2.exsample.cpm, ... www-12.exsample com]) worked with different software releases, We can't remove all revisioned asset files on static.exsample.com. We need to save number of recent revisioned assets. gulp-rev-outdated filter revisioned assets and exclude parametrised quantity of recent files for removing.
Takes one parameter [ keepQuantity ] - number of saved recent files. Default value == 2.
var gulp = ;var gutil = ;var rimraf = ;var revOutdated = ;var path = ;var through = ; { return through;} gulp;
It's also possible to pass in all your asset files at once:
... gulp;
gulp.src option read false prevents gulp to read the contents of the file and makes this task a lot faster. If you need the file and it's contents after cleaning in the same stream, do not set the read option to false.