javascript - how to update script link in html -
i wash update script link in index.html of dist file directory, code can't update script link? how update it?
thanks ! use link download project -- clickthis
var jssrc = ['js/jquery-1.9.0.min.js','js/customer.js']; gulp.task('default', function() { gulp.start('clean','minifyjs','revcollector'); }); gulp.task('clean', function(cb) { del(['minified/css', 'minified/js','rev/js','dist/'], cb) }); gulp.task('minifyjs', function() { return gulp.src(jssrc) .pipe(concat('main.js')) .pipe(gulp.dest('dist/js')) .pipe(rename({suffix: '.min'})) .pipe(uglify()) .pipe(rev()) .pipe(gulp.dest('dist/js')) .pipe(rev.manifest()) .pipe(gulp.dest('dist/js')); }); gulp.task('revcollector', function() { return gulp.src(['dist/js/*.json','index.html']) .pipe(revcollector({ replacereved: true })) .pipe(gulp.dest('dist/')); });
change html file script link same rev-manifest.json key .it worker !
Comments
Post a Comment