src/bundle.js
function bundle(entryPoint, buildContext, opts) {

  if (!opts) {
    opts = {};
  }

  if (!opts.outputFileName) {
  	opts.outputFileName = 'index.js';
  }

  if (!opts.destPath) {
  	opts.destPath = buildContext.destPath;
  }

  if (opts.rev !== false) {
    opts.rev = true;
  }

  var shouldUglify = false;
  var config = {
      // these are needed for watchify
      cache: {}, packageCache: {}, fullPaths: false,
      // Specify the entry point of the bundle
      entries: entryPoint,
      // Enable source maps
      debug: buildContext.dev
  };

  var bundler = browserify(config)
    .transform(babelify.configure({stage: 1}));

  if (buildContext.watch) {
      // Wrap with watchify and rebundle on changes
      bundler = watchify(bundler);
      // Rebundle on update
      bundler.on('update', doBundle.bind(null, bundler, buildContext, opts));
  }

  return doBundle(bundler, buildContext, opts);
}
function bundle(entryPoint, buildContext, opts) {

  if (!opts) {
    opts = {};
  }

  if (!opts.outputFileName) {
  	opts.outputFileName = 'index.js';
  }

  if (!opts.destPath) {
  	opts.destPath = buildContext.destPath;
  }

  if (opts.rev !== false) {
    opts.rev = true;
  }

  var shouldUglify = false;
  var config = {
      // these are needed for watchify
      cache: {}, packageCache: {}, fullPaths: false,
      // Specify the entry point of the bundle
      entries: entryPoint,
      // Enable source maps
      debug: buildContext.dev
  };

  var bundler = browserify(config)
    .transform(babelify.configure({stage: 1}));

  if (buildContext.watch) {
      // Wrap with watchify and rebundle on changes
      bundler = watchify(bundler);
      // Rebundle on update
      bundler.on('update', doBundle.bind(null, bundler, buildContext, opts));
  }

  return doBundle(bundler, buildContext, opts);
}
function bundle ( entryPoint , buildContext , opts ) { if ( ! opts ) { opts = { } ; } if ( ! opts . outputFileName ) { opts . outputFileName = 'index.js' ; } if ( ! opts . destPath ) { opts . destPath = buildContext . destPath ; } if ( opts . rev !== false ) { opts . rev = true ; } var shouldUglify = false ; var config = { // these are needed for watchify cache : { } , packageCache : { } , fullPaths : false , // Specify the entry point of the bundle entries : entryPoint , // Enable source maps debug : buildContext . dev } ; var bundler = browserify ( config ) . transform ( babelify . configure ( { stage : 1 } ) ) ; if ( buildContext . watch ) { // Wrap with watchify and rebundle on changes bundler = watchify ( bundler ) ; // Rebundle on update bundler . on ( 'update' , doBundle . bind ( null , bundler , buildContext , opts ) ) ; } return doBundle ( bundler , buildContext , opts ) ; }
Create a browserify bundle according
to the given configuration

entryPoint          - the entry point for the bundle
buildContext        - lucify build context
opts.outputFileName - file name for produced bundle
opts.destPath       - destinatino path for produced bundle
Create a browserify bundle according to the given configuration