//替换html引用文件里面文件名字,第一次写时成功生成了对应版本号manifest.json文件,并成功替换了.html文件里面文件名
gulp.src(['./rev/*.json', './dist/index.html'])
.pipe(revCollector())
.pipe(gulp.dest('./dist'));
});
//但是修改了内容再次压缩,再次执行rev命令发现.html文件里面文件名并未并成功替换
gulp.task('rev', function() {
gulp.src(['./rev/*.json', './dist/index.html'])
.pipe(revCollector({
replaceReved:true //一定要加上这一句,不然不会替换掉上一次的值
}))
.pipe(gulp.dest('./dist'));
});