How do I set up Gulp with caching?

  • Page Owner: Not Set
  • Last Reviewed: 2022-08-11

How do I set up Gulp with caching?


Answer

Add the gulp-cached plugin

Add this at the top of your gulp file.

const cache = require('gulp-cached');
function copyToOptimizely() {
    return src(['static/dist/static/**/*'])
        .pipe(cache('copyFiles')) // ADD THIS
        .pipe(dest('Icertis.Web/wwwroot/static'))
}