0 votes
in JavaScript by
Gulp Plumber vs. Watch

1 Answer

0 votes
by
Gulp Plumber vs. Watch
Gulp Plumber vs. Watch

The main difference between gulp-watch and gulp-plumber is that plumber helps to prevent pipe breaking caused by errors from gulp plugins, while watch just notifies.

Installation of plumber:

$ npm install --save-dev gulp-plumber

Benefits: Plumber ensures the system doesn't stop or block in case of any error.

Usage: In gulpfile.js

var plumber = require('gulp-plumber');
gulp.src('./src/*.js')
    .pipe(plumber())
    .pipe(jshint())
    .pipe(gulp.dest('./dist'));
...