gulpfile.js
function buildExampleScripts(dev) {

  var dest = EXAMPLE_DIST_PATH;

  var opts = dev ? watchify.args : {};
  opts.debug = dev ? true : false;
  opts.hasExports = true;

  return function() {

    var common = browserify(opts),
      bundle = browserify(opts).require('./' + SRC_PATH + '/' + PACKAGE_FILE, { expose: PACKAGE_NAME }),
      example = browserify(opts).exclude(PACKAGE_NAME).add('./' + EXAMPLE_SRC_PATH + '/' + EXAMPLE_APP);

    DEPENDENCIES.forEach(function(pkg) {
      common.require(pkg);
      bundle.exclude(pkg);
      example.exclude(pkg);
    });

    if (dev) {
      watchBundle(common, 'common.js', dest);
      watchBundle(bundle, 'bundle.js', dest);
      watchBundle(example, 'app.js', dest);
    }

    return merge(
      doBundle(common, 'common.js', dest),
      doBundle(bundle, 'bundle.js', dest),
      doBundle(example, 'app.js', dest)
    );

  }

}
function buildExampleScripts(dev) {

  var dest = EXAMPLE_DIST_PATH;

  var opts = dev ? watchify.args : {};
  opts.debug = dev ? true : false;
  opts.hasExports = true;

  return function() {

    var common = browserify(opts),
      bundle = browserify(opts).require('./' + SRC_PATH + '/' + PACKAGE_FILE, { expose: PACKAGE_NAME }),
      example = browserify(opts).exclude(PACKAGE_NAME).add('./' + EXAMPLE_SRC_PATH + '/' + EXAMPLE_APP);

    DEPENDENCIES.forEach(function(pkg) {
      common.require(pkg);
      bundle.exclude(pkg);
      example.exclude(pkg);
    });

    if (dev) {
      watchBundle(common, 'common.js', dest);
      watchBundle(bundle, 'bundle.js', dest);
      watchBundle(example, 'app.js', dest);
    }

    return merge(
      doBundle(common, 'common.js', dest),
      doBundle(bundle, 'bundle.js', dest),
      doBundle(example, 'app.js', dest)
    );

  }

}
function buildExampleScripts ( dev ) { var dest = EXAMPLE_DIST_PATH ; var opts = dev ? watchify . args : { } ; opts . debug = dev ? true : false ; opts . hasExports = true ; return function ( ) { var common = browserify ( opts ) , bundle = browserify ( opts ) . require ( './' + SRC_PATH + '/' + PACKAGE_FILE , { expose : PACKAGE_NAME } ) , example = browserify ( opts ) . exclude ( PACKAGE_NAME ) . add ( './' + EXAMPLE_SRC_PATH + '/' + EXAMPLE_APP ) ; DEPENDENCIES . forEach ( function ( pkg ) { common . require ( pkg ) ; bundle . exclude ( pkg ) ; example . exclude ( pkg ) ; } ) ; if ( dev ) { watchBundle ( common , 'common.js' , dest ) ; watchBundle ( bundle , 'bundle.js' , dest ) ; watchBundle ( example , 'app.js' , dest ) ; } return merge ( doBundle ( common , 'common.js' , dest ) , doBundle ( bundle , 'bundle.js' , dest ) , doBundle ( example , 'app.js' , dest ) ) ; } }
Build example scripts

Returns a gulp task with watchify when in development mode
Build example scripts