How to use the browserify.on 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 learningequality / studio / build.js View on Github external
{ global: true }
);

if (watch) {
  var watchify = require('watchify');
  browserify.plugin(watchify,
    { // watchify options
      verbose: true,
      poll: 1000,
      ignoreWatch: '**/node_modules/**',
    }
  );

  infoLog('Starting watcher');

  browserify.on('update', function (ids) {
    infoLog('files changed, bundle updated');
    _.each(ids, function(id) {infoLog(id + ' changed');});
    createBundles(browserify, bundles);
  });

  browserify.on('log', infoLog);

  browserify.on('error', function(error) {
    errLog(error);
    this.emit('end');
  });
}

createBundles(browserify, bundles);
github learningequality / studio / build.js View on Github external
{ // watchify options
      verbose: true,
      poll: 1000,
      ignoreWatch: '**/node_modules/**',
    }
  );

  infoLog('Starting watcher');

  browserify.on('update', function (ids) {
    infoLog('files changed, bundle updated');
    _.each(ids, function(id) {infoLog(id + ' changed');});
    createBundles(browserify, bundles);
  });

  browserify.on('log', infoLog);

  browserify.on('error', function(error) {
    errLog(error);
    this.emit('end');
  });
}

createBundles(browserify, bundles);
github learningequality / studio / build.js View on Github external
poll: 1000,
      ignoreWatch: '**/node_modules/**',
    }
  );

  infoLog('Starting watcher');

  browserify.on('update', function (ids) {
    infoLog('files changed, bundle updated');
    _.each(ids, function(id) {infoLog(id + ' changed');});
    createBundles(browserify, bundles);
  });

  browserify.on('log', infoLog);

  browserify.on('error', function(error) {
    errLog(error);
    this.emit('end');
  });
}

createBundles(browserify, bundles);