Browse Source

Merge pull request #999 from vforvova/reduce-options-rewrites-with-reduce

reduce instead forEach to update options
legacy-quote-reserved-properties
Rich Harris 8 years ago
committed by GitHub
parent
commit
be83883d75
  1. 9
      src/Bundle.js

9
src/Bundle.js

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

Loading…
Cancel
Save