2.0.1 • Published 7 years ago

gulp-pcache v2.0.1

Weekly downloads
7
License
MIT
Repository
github
Last release
7 years ago

gulp-pcache

gulp incremental build on each process.

usage.

const gulp = require('gulp');
const eslint = require('gulp-eslint');
const concat = require('gulp-concat');
const pcache = require('gulp-pcache')({path: __dirname + '/.gulpcache'});

// only passthrough modified files.
gulp.task('scripts:eslint', function() {
  return gulp.src('**/*.js')
    .pipe(pcache('scripts:eslint'))
    .pipe(eslint());
});

// only passthrough modified files.
// and remember stream.
gulp.task('scripts:concat', function() {
  return gulp.src('**/*.js')
    .pipe(pcache('scripts:concat'))
    .pipe(remember('scripts:concat'))
    .pipe(concat())
    .pipe(gulp.dest('bundle.js'));
});

gulp.task('cache:clear', function() {
  pcache.clear();
});

// auto save cache.
process.on('exit', function() {
  pcache.save();
});