jonkemp / gulp-useref

Parse build blocks in HTML files to replace references to non-optimized scripts or stylesheets.
MIT License
705 stars 93 forks source link

use gulp-rev, there is no version in <scripts> and <links> #243

Closed usercx closed 6 years ago

usercx commented 6 years ago

here is my gulpfile: ` gulp.task("build", ["inject"], function(

return gulp.src("src/index.html")
    .pipe($.useref())
    .pipe($.if("**/*.{js,css}", $.rev()))
    .pipe(gulp.dest("dist/"));

)) ` but in "dist/index.html" the scripts and link are without version. gulp-useref is v3.1.3

usercx commented 6 years ago

Well, I am sorry... I find the solution for this, by using gulp-rev-replace

return gulp.src("src/index.html") .pipe($.useref()) .pipe($.if("**/*.{js,css}", $.rev())) .pipe($.revReplace()) .pipe(gulp.dest("dist/"));

Sincerely sorry for this....