Code coverage report for lib/bundlers/browserify.js

Statements: 100% (12 / 12)      Branches: 100% (0 / 0)      Functions: 100% (3 / 3)      Lines: 100% (12 / 12)      Ignored: none     

All files » lib/bundlers/ » browserify.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 271   1   1 4   4   4   1 3       3   3 1     3        
module.exports = setupBrowserify
 
var through = require('through')
 
function setupBrowserify(dir, entryPoints, flags, ready) {
  var parseArgs = require(dir + '/bin/args.js')
 
  instantiate.bundler = dir
 
  return ready(null, instantiate)
 
  function instantiate(entryPath) {
    var stdout = through()
      , stderr = through()
      , bundle
 
    bundle = parseArgs([entryPath].concat(flags))
 
    bundle.bundle().on('error', function(err) {
      stderr.end(err.stack + '')
    }).pipe(stdout)
 
    return {stderr: stderr, stdout: stdout}
  }
}