diff --git a/gulp/util/bundle.js b/gulp/util/bundle.js index 7eecd98..b076faa 100644 --- a/gulp/util/bundle.js +++ b/gulp/util/bundle.js @@ -33,9 +33,11 @@ function watch(onUpdate) { var bundler = watchify(createBundler(watchify.args)); - bundler.on('update', function () { - rebundle.call(this).on('end', onUpdate); - }); + if (onUpdate) { + bundler.on('update', function () { + rebundle.call(this).on('end', onUpdate); + }); + } return rebundle.call(bundler); }