Gulp - clear css cache in html

0 votes
199 views
added Jul 5, 2018 in Gulp by anonymous
edited Jul 13, 2018 by LC Marshal
gulp.task('clear-css-cache', function(){
  gulp.src(['index.html'])
    .pipe(replace(/main.css\?v=[0-9]+/g, 'main.css?v='+Date.now()))
    .pipe(gulp.dest('./'));
});
lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...