Answer the question
In order to leave comments, you need to log in
How to hang an error handler?
I have a task
// #javascript
gulp.task('js', function () {
return browserify({
entries:path.src.js,
extensions:['.jsx']
})
.transform('babelify',{
presets:['es2015','react'],
plugins:['transform-class-properties']
})
.bundle()
.on('error',function(err){
console.log(err);
})
.pipe(source('app.min.js'))
.pipe(buffer())
.pipe(_if(isDev,sourcemaps.init()))
// .pipe(jsMin())
.pipe(_if(isDev,sourcemaps.write()))
.pipe(gulp.dest(path.dist.js))
.pipe(_debug({title:'js to Dist'}))
.pipe(_reload({stream: true}));
});
.pipe(_plumber({
errorHandler: _log.onError(function(err){
return {
title:'JAVASCRIPT',
message:err.message
};
})
}))
var gulp = require('gulp'),
babel = require('gulp-babel'),
browserify = require('browserify'),
babelify = require('babelify'),
buffer = require('vinyl-buffer'),
source = require('vinyl-source-stream'),
jsMin = require('gulp-uglify'),
rename = require('gulp-rename'),
sass = require('gulp-sass'),
cssMin = require('gulp-minify-css'),
cssPrefixer = require('gulp-autoprefixer'),
watch = require('gulp-watch'),
sourcemaps = require('gulp-sourcemaps'),
_if = require('gulp-if'),
_debug = require('gulp-debug'),
_log = require('gulp-notify'),
_plumber = require('gulp-plumber'),
_delete = require('rimraf'),
_server = require('browser-sync'),
_reload = _server.reload;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question