Answer the question
In order to leave comments, you need to log in
Versioning in GULP?
I want to version css and js files in order to combat caching, I try to do it throughgulp-replace
gulp.task('version', function(){
gulp.src(['src/**/*.html','src/**/*.php'])
.pipe(replace('{{version}}', Date.now() ))
.pipe(gulp.dest('dist/'));
});
<link rel="stylesheet" href="assets/css/style.css?{{version}}">
The following tasks did not complete: dev, build, version
Did you forget to signal async completion?
Answer the question
In order to leave comments, you need to log in
Good day!
Here is one solution to this problem
gulp.task('version', function(){
return gulp.src(['src/**/*.html','src/**/*.php']) // Добавлен return
.pipe(replace('{{version}}', Date.now() ))
.pipe(gulp.dest('dist/'));
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question