In my web application I created gulpfile which compiles react files by using reactify with browserify. Here is how my bundle task looks:
var bundler = watchify(browserify({
entries: config.paths.src.js.app,
transform: [reactify, envify],
debug: isDevelopment,
cache: {}, packageCache: {}, fullPaths: true
}), watchify.args);
var bundle = function() {
start();
return bundler
.bundle()
.on('error', errorLog)
.pipe(source(config.paths.build.appName))
.pipe(gulpif(!isDevelopment, streamify(uglify())))
.pipe(gulp.dest(config.paths.build.folder))
.pipe(reload({stream:true}))
.on('end', end);
};
function errorLog(error) {
log('****** Start of Error ******');
gutil.log(gutil.colors.red(error.message));
log('****** End of Error ******');
}
The problem is that when error occurs my gulp crashes. Don't know how to handle it. Plumber doesn't work in that case. Any ideas?