From 9ddf4306725234628a0720447ad658354808c2a2 Mon Sep 17 00:00:00 2001 From: Patrick Mowrer Date: Mon, 14 Sep 2015 11:40:51 -0400 Subject: [PATCH] Fix bundling errors being swallowed Fixes #266 --- index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 33d401d..b541c3a 100644 --- a/index.js +++ b/index.js @@ -96,9 +96,12 @@ function watchify (b, opts) { }); b.on('bundle', function (bundle) { updating = true; - bundle.on('error', onend); + bundle.on('error', function(err) { + b.emit('error', err); + onend(); + }); bundle.on('end', onend); - function onend () { updating = false } + function onend () { updating = false; } }); function watchFile (file, dep) {