lib/bro.js
function bundlePreprocessor(config) {

    var debug = config.browserify && config.browserify.debug;

    function updateSourceMap(file, content) {
      var map;

      if (debug) {

        map = extractSourceMap(content);

        file.sourceMap = map && map.sourcemap;
      }
    }

    return function(content, file, done) {

      if (b._builtOnce) {
        updateSourceMap(file, content);
        return done(content);
      }

      log.debug('building bundle');

      // wait for the initial bundle to be created
      b.deferredBundle(function(err, content) {

        b._builtOnce = config.autoWatch;

        if (err) {
          return done(BUNDLE_ERROR_TPL);
        }

        content = content.toString('utf-8');
        updateSourceMap(file, content);

        log.info('bundle built');

        done(content);
      });
    };
  }
function bundlePreprocessor(config) {

    var debug = config.browserify && config.browserify.debug;

    function updateSourceMap(file, content) {
      var map;

      if (debug) {

        map = extractSourceMap(content);

        file.sourceMap = map && map.sourcemap;
      }
    }

    return function(content, file, done) {

      if (b._builtOnce) {
        updateSourceMap(file, content);
        return done(content);
      }

      log.debug('building bundle');

      // wait for the initial bundle to be created
      b.deferredBundle(function(err, content) {

        b._builtOnce = config.autoWatch;

        if (err) {
          return done(BUNDLE_ERROR_TPL);
        }

        content = content.toString('utf-8');
        updateSourceMap(file, content);

        log.info('bundle built');

        done(content);
      });
    };
  }
function bundlePreprocessor ( config ) { var debug = config . browserify && config . browserify . debug ; function updateSourceMap ( file , content ) { var map ; if ( debug ) { map = extractSourceMap ( content ) ; file . sourceMap = map && map . sourcemap ; } } return function ( content , file , done ) { if ( b . _builtOnce ) { updateSourceMap ( file , content ) ; return done ( content ) ; } log . debug ( 'building bundle' ) ; // wait for the initial bundle to be created b . deferredBundle ( function ( err , content ) { b . _builtOnce = config . autoWatch ; if ( err ) { return done ( BUNDLE_ERROR_TPL ) ; } content = content . toString ( 'utf-8' ) ; updateSourceMap ( file , content ) ; log . info ( 'bundle built' ) ; done ( content ) ; } ) ; } ; }
A special preprocessor that builds the main browserify bundle once and
passes the bundle contents through on all later preprocessing request.
A special preprocessor that builds the main browserify bundle once and passes the bundle contents through on all later preprocessing request .