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

the path replace bug #36

Open LYlanfeng opened 7 years ago

LYlanfeng commented 7 years ago

I have two file ,the path is "/app/test0.js" and "/app/test/test0.js" ,fileanme is identical。but path is not identical。 gulp.task('testmd5',function() { gulp.src(['src/app/**/*.js']) .pipe(rev()) .pipe(gulp.dest('dist/js')) // write rev'd assets to build dir .pipe(rev.manifest()) .pipe(gulp.dest('./rev')) }); gulp.task('rev', function() { gulp.src(['./rev/*.json', './src/app/**/*.html']) .pipe(revCollector({ replaceReved: true })) .pipe(gulp.dest('./dist/app/')); });

run after all the html replace olny one js file。

shonny-ua commented 7 years ago

Can You show me content of manifest file after gulp.dest('./rev') ?

cjd6568358 commented 7 years ago

@shonny-ua i find a bug. if i rename a filename to .min.css ,rev will transform to -aaaaaaaaaa.min.css ,that revCollector doesn't work with replaceReved .and i rename to -min.css / -aaaaaaaaaa-min.css it works.

cjd6568358 commented 7 years ago

qq 20170526181507 @shonny-ua

shonny-ua commented 7 years ago

@cjd6568358 it was separate bug... It have been fixed. Use version 1.2.2

LYlanfeng commented 7 years ago

@shonny-ua The mail was blocked from spam and was not noticed until today 1 2 5

4

qiuyuwu commented 7 years ago

if i rename file doesn't work ,like @cjd6568358 。 and Use version 1.2.2。 Nor does it work。

shonny-ua commented 7 years ago

@LYlanfeng Do you really need to use 2 different files with the same name ??? Use dirReplacements option with attribute as a function to handle this case.

shonny-ua commented 7 years ago

@qiuyuwu What does not work? Probably the option replaceReved does not work as you expected? Use option revSuffix for renamed reved filenames.

Or describe Your situation more detail.

qiuyuwu commented 7 years ago

@shonny-ua Sorry, I did not see the document revsuffix, thanks!

lywTYH commented 7 years ago

let cleanReplacement = path .basename(json[key]) .replace(new RegExp(opts.revSuffix), '') if ( !~[ path.basename(key), _mapExtnames(path.basename(key), opts) ].indexOf(cleanReplacement) ) { isRev = 0 }

when rename the code is error so i comment out it . and it works

shonny-ua commented 7 years ago

@cjd6568358 Give me rev-manifest.json file content, please.