How to use the browserify.add function in browserify

To help you get started, we’ve selected a few browserify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github anvaka / graph-drawing-libraries / src / gulpfile.js View on Github external
function produceMainBundle() {
  var bundle = require('browserify')().add('./src/scripts/index.js');
  bundle
    .bundle()
    .on('error', function (err) {
      gutil.log(gutil.colors.red('Failed to browserify'), gutil.colors.yellow(err.message));
    })
    .pipe(fs.createWriteStream(path.join(__dirname + '/dist/bundle.js')));
}
github goodybag / gplaces / gulpfile.js View on Github external
gulp.task( 'scripts', function(){
  return require('browserify')({
      debug: true
    })
    .add('./test/public/js/app.js')
    .bundle()
    .pipe( fs.createWriteStream('./test/public/dist/app.js') );
});
github goodybag / gplaces / gulpfile.js View on Github external
gulp.task( 'build-dist', ['lint', 'clear-dist-dir'], function(){
  return require('browserify')({
      debug: true
    })
    .add('./standalone-build.js')
    .bundle()
    .pipe( fs.createWriteStream('./dist/gplaces.js') );
});
github learningequality / studio / build.js View on Github external
function(item) {
    browserify.add(item.bundle, {expose: item.alias});
  }
);
github anvaka / allnpmviz3d / gulpfile.js View on Github external
function runBrowserify() {
  var fs = require('fs');

  var bundle = require('browserify')()
    .add('./src/scripts/index.js')
    .bundle()
    .on('error', function (err) {
        gutil.log(gutil.colors.red('Failed to browserify'), gutil.colors.yellow(err.message));
    });
  bundle.pipe(fs.createWriteStream(path.join(__dirname + '/dist/bundle.js')));
}