Created
August 3, 2016 08:52
-
-
Save xkr47/afb8c24b2783e185caa9f10502476aff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var util = require('gulp-util'); | |
var source = require('vinyl-source-stream'); | |
var buffer = require('vinyl-buffer'); | |
var through2 = require('through2'); | |
var plumber = require('gulp-plumber'); | |
var errs = 0; | |
gulp.task('default', function () { | |
return gulp.src('./src/*.js') | |
.pipe(plumber(function plumberr(e) { | |
console.log("plumberr", e); | |
++errs; | |
})) | |
.pipe(through2.obj(function w(chunk, enc, cb) { | |
console.log("w()"); | |
this.push(chunk); | |
//cb(); | |
cb(new Error("thruuu", "lolMID")); | |
}, function e(cb) { | |
this.push(null); | |
cb(); | |
})) | |
.pipe(gulp.dest('./target/')) | |
.pipe(plumber.stop()) | |
.pipe(through2.obj(function we(chunk, enc, cb) { | |
cb(); | |
}, function ee(cb) { | |
cb(errs && new util.PluginError("custom", "Lol")); | |
})); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment