gulp.task("taskName", function() {
var b = browserify({
entries: ['./entryFile'],
cache: {},
packageCache: {},
});
b.plugin(watchify);
b.on('update', bundle);
bundle();
function bundle() {
b.bundle()
.pipe(fs.createWriteStream('output.js'));
}
})
The problem is that for any syntax error in the entries, the process (gulp taskName) will hang and not giving any info on the error.
I found a way to have the info by adding .on('error', function (e) {throw e;}) right after the .bundle(), but if I insert it anywhere else in the pipe chain of b.bundle. ... nothing happens.
I can also remove the watchify plugin and then the error is displayed.
Is it really what should happen?
And also if it is, shouldn't it be documented somewhere? Because when no feedback is returned, it's quite a bore to know what actually causes the process to block and who (watchify here I suppose) could potentially keep the error.
I use Browserify with watchify within gulp.
The (simplified) utilisation looks like this:
The problem is that for any syntax error in the entries, the process (
gulp taskName
) will hang and not giving any info on the error.I found a way to have the info by adding
.on('error', function (e) {throw e;})
right after the .bundle(), but if I insert it anywhere else in the pipe chain ofb.bundle. ...
nothing happens. I can also remove the watchify plugin and then the error is displayed.Is it really what should happen? And also if it is, shouldn't it be documented somewhere? Because when no feedback is returned, it's quite a bore to know what actually causes the process to block and who (watchify here I suppose) could potentially keep the error.
versions: browserify@13.0.1 watchify@3.7.0