index.js
function Multibundle(config, components)
{
  var tasks;

  if (!(this instanceof Multibundle))
  {
    return new Multibundle(config, components);
  }

  // turn on object mode
  Readable.call(this, {objectMode: true});

  // prepare config options
  this.config = lodash.merge({}, Multibundle._defaults, config);
  this.config.componentOptions = lodash.cloneDeep(components);

  // process each component in specific order
  tasks = this._getComponents()
    .map(this._processComponent.bind(this))
    .map(this._prepareForRjs.bind(this))
    ;

  // run optimize tasks asynchronously
  async.parallelLimit(tasks, this.config.parallelLimit, function(err)
  {
    if (err)
    {
      this.emit('error', err);
      return;
    }

    // be nice
    if (this.config.logLevel < 4)
    {
      console.log('\n-- All requirejs bundles have been processed.');
    }

    // singal end of the stream
    this.push(null);
  }.bind(this));
}
function Multibundle(config, components)
{
  var tasks;

  if (!(this instanceof Multibundle))
  {
    return new Multibundle(config, components);
  }

  // turn on object mode
  Readable.call(this, {objectMode: true});

  // prepare config options
  this.config = lodash.merge({}, Multibundle._defaults, config);
  this.config.componentOptions = lodash.cloneDeep(components);

  // process each component in specific order
  tasks = this._getComponents()
    .map(this._processComponent.bind(this))
    .map(this._prepareForRjs.bind(this))
    ;

  // run optimize tasks asynchronously
  async.parallelLimit(tasks, this.config.parallelLimit, function(err)
  {
    if (err)
    {
      this.emit('error', err);
      return;
    }

    // be nice
    if (this.config.logLevel < 4)
    {
      console.log('\n-- All requirejs bundles have been processed.');
    }

    // singal end of the stream
    this.push(null);
  }.bind(this));
}
function Multibundle ( config , components ) { var tasks ; if ( ! ( this instanceof Multibundle ) ) { return new Multibundle ( config , components ) ; } // turn on object mode Readable . call ( this , { objectMode : true } ) ; // prepare config options this . config = lodash . merge ( { } , Multibundle . _defaults , config ) ; this . config . componentOptions = lodash . cloneDeep ( components ) ; // process each component in specific order tasks = this . _getComponents ( ) . map ( this . _processComponent . bind ( this ) ) . map ( this . _prepareForRjs . bind ( this ) ) ; // run optimize tasks asynchronously async . parallelLimit ( tasks , this . config . parallelLimit , function ( err ) { if ( err ) { this . emit ( 'error' , err ) ; return ; } // be nice if ( this . config . logLevel < 4 ) { console . log ( '\n-- All requirejs bundles have been processed.' ) ; } // singal end of the stream this . push ( null ) ; } . bind ( this ) ) ; }
Parses multibundle config and transforms it into requirejs compatible options.

@constructor
@param {object} config - process configuration object
@param {array} components - list of bundles to build
@alias module:Multibundle
Parses multibundle config and transforms it into requirejs compatible options .