I'm using plumber with notify to log errors in a custom function
it throw me an error "Error in plugin 'plumber' Message: Can't pipe to undefined"
// ==========================================================
// Pumbler error function
// ==========================================================
function customPlumber(errTitle) {
return plumber({
errorHandler: notify.onError({
// Customizing error title
title: errTitle || "Error running Gulp",
message: "Error: <%= error.message %>",
sound: "Glass"
})
});
}
// ==========================================================
// STYLES TASK
// ==========================================================
gulp.task('sass', function(){
return gulp.src(paths.styles.src + '*/.scss')
.pipe(customPlumber('Error Running Sass'))
// inititalizr sourcemap before anyother pluging that alter files
.pipe(sourcemaps.init())
.pipe(sass({
includePaths: ['theme/bower_components'],
precision: 2
}))
.pipe(autoprefixer({
browsers: ['ie 8-9', 'last 2 versions']
}))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(paths.styles.build))
.pipe(browserSync.reload())
})
gulp.task('watch', ['browserSync'], function(){
gulp.watch(basePaths.src + 'sass//*.scss', ['sass']);
gulp.watch(paths.scripts.src + '/.js', browserSync.reload);
gulp.watch('theme/.html', browserSync.reload);
gulp.watch('theme/js/*/.js', ['jshint']);
})