How would one add a .on
listener that would stop gulp from crashing and simply try again next time it detects a file reload?
This is what I have tried currently
'use strict';
const gulp = require('gulp');
const jspm = require('gulp-jspm');
gulp.task('default', () => {
return gulp.watch('./src/**/*.js', ['bundle'])
.on('error', function (error) {
console.log('error');
this.emit('end');
});
});
gulp.task('bundle', () => {
return gulp.src('./src/main.js')
.pipe(jspm({ selfExecutingBundle : true })
.on('error', function (error) {
console.log('error');
this.emit('end');
})
)
.on('error', function (error) {
console.log('error');
this.emit('end');
})
.pipe(gulp.dest('./dist/'));
});
None of which captures the error, or stops gulp from crashing.