shonny-ua / gulp-rev-collector

Static asset revision data collector from manifests, with was generated from different streams and replace they's links in html template.
MIT License
150 stars 41 forks source link

I want to "?v=" So, how do i do it? #38

Closed fhvknb closed 7 years ago

fhvknb commented 7 years ago

who help me? thanks

fhvknb commented 7 years ago

if (_.isObject(json)) { var isRev = 1; Object.keys(json).forEach(function (key) { if (!_.isString(json[key])) { isRev = 0; return; } //let cleanReplacement = path.basename(json[key]).replace(new RegExp( opts.revSuffix ), '' ); let cleanReplacement = path.basename(json[key]).split('?')[0].replace(new RegExp( opts.revSuffix ), '' ); if (!~[ path.basename(key), _mapExtnames(path.basename(key), opts) ].indexOf(cleanReplacement) ) { isRev = 0; } }); if (isRev) { data = json; } }