Skip to content

Commit

Permalink
chore(bro): make watchify an optional dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Jan 24, 2016
1 parent 84138e2 commit ffd145c
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/bro.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
'use strict';

var browserify = require('browserify'),
watchify = require('watchify'),
convert = require('convert-source-map'),
watchify;

try {
watchify = require('watchify');
} catch (e) {
console.error('watchify not found; install it via npm install --save-dev watchify');
console.error('incremental rebuild will be disabled');
}


var convert = require('convert-source-map'),
minimatch = require('minimatch'),
escape = require('js-string-escape');

Expand Down Expand Up @@ -220,7 +229,7 @@ function Bro(bundleFile) {
}

// register rebuild bundle on change
if (config.autoWatch) {
if (config.autoWatch && watchify) {
w = watchify(w, config.watchify);

log.info('registering rebuild (autoWatch=true)');
Expand Down

0 comments on commit ffd145c

Please sign in to comment.