Browse Source

refactor: reduce options mutations with reduce

legacy-quote-reserved-properties
Vladimir Smyshlyaev 8 years ago
parent
commit
0812aa52d4
  1. 9
      src/Bundle.js

9
src/Bundle.js

@ -31,11 +31,10 @@ export default class Bundle {
this.plugins = ensureArray( options.plugins ); this.plugins = ensureArray( options.plugins );
this.plugins.forEach( plugin => { options = this.plugins.reduce( ( acc, plugin ) => {
if ( plugin.options ) { if ( plugin.options ) return plugin.options( acc ) || acc;
options = plugin.options( options ) || options; return acc;
} }, options);
});
this.entry = options.entry; this.entry = options.entry;
this.entryId = null; this.entryId = null;

Loading…
Cancel
Save