gulp/compilejs.js
function watchjs(sources, outdir, outfile, opt_options) {
  var bundler = watchify(browserify({
    entries: sources,
    debug: false,
    // Watchify options:
    cache: {},
    packageCache: {},
    fullPaths: true
  }));

  bundler.on('update', function() {
    gutil.log('recompiling js...');
    rebundle_(bundler, outdir, outfile, opt_options);
    gutil.log('finished recompiling js');
  });
  return rebundle_(bundler, outdir, outfile, opt_options);
}
function watchjs(sources, outdir, outfile, opt_options) {
  var bundler = watchify(browserify({
    entries: sources,
    debug: false,
    // Watchify options:
    cache: {},
    packageCache: {},
    fullPaths: true
  }));

  bundler.on('update', function() {
    gutil.log('recompiling js...');
    rebundle_(bundler, outdir, outfile, opt_options);
    gutil.log('finished recompiling js');
  });
  return rebundle_(bundler, outdir, outfile, opt_options);
}
function watchjs ( sources , outdir , outfile , opt_options ) { var bundler = watchify ( browserify ( { entries : sources , debug : false , // Watchify options: cache : { } , packageCache : { } , fullPaths : true } ) ) ; bundler . on ( 'update' , function ( ) { gutil . log ( 'recompiling js...' ) ; rebundle_ ( bundler , outdir , outfile , opt_options ) ; gutil . log ( 'finished recompiling js' ) ; } ) ; return rebundle_ ( bundler , outdir , outfile , opt_options ) ; }
Watches JS code for changes and triggers compilation.
@param {Array.<string>} sources List of JS source files.
@param {string} outdir Output directory.
@param {string} outfile Output file name.
@param {Object=} opt_options Options.
Watches JS code for changes and triggers compilation .