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

replacement of the asset name like 'none-d56725a517-d56725a517.png', cannot replace with the manifest.json #47

Closed lmx99 closed 6 years ago

lmx99 commented 6 years ago

the bellow we would see is part of the index.js codes of gulp-rev-collector

 var cleanReplacement = path.basename(json[key]).replace(new RegExp(opts.revSuffix), '');

                if (!~[
                        path.basename(key),
                        _mapExtnames(path.basename(key), opts)
                    ].indexOf(cleanReplacement)) {
                    isRev = 0;
                }

when my source file path look like none-d56725a517-d56725a517.png , the result path of the replacement via var cleanReplacement = path.basename(json[key]).replace(new RegExp(opts.revSuffix), ''); will be the string like noned56725a517.png, the right way of this result should be none-d56725a517.png . for the issue the revcollect cannot work as we expected

shonny-ua commented 6 years ago

use option revSuffix: '-[0-9a-f]{8,10}' to resolve your task