Skip to content

Commit

Permalink
add factorThreshold option
Browse files Browse the repository at this point in the history
  • Loading branch information
dgbeck committed Aug 19, 2015
1 parent e5ef000 commit 88456a3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ function Cartero( entryPoints, outputDirPath, options ) {
sourceMaps : false,
watch : false,
browserifyOptions : {},

factorThreshold : function( row, group ) {
return this.mainPaths.length > 1 && ( group.length >= this.mainPaths.length || group.length === 0 );
},

postProcessors : []
} );

Expand All @@ -79,6 +84,7 @@ function Cartero( entryPoints, outputDirPath, options ) {
'sourceMaps',
'watch',
'browserifyOptions',
'factorThreshold',
'logLevel'
) );

Expand Down Expand Up @@ -310,10 +316,10 @@ Cartero.prototype.processMains = function( callback ) {
return _.pluck( tempJsBundlesByEntryPoint, 'stream' );
},
threshold : function( row, group ) {
var putIntoCommonBundle = _this.mainPaths.length > 1 && ( group.length >= _this.mainPaths.length || group.length === 0 );
var putIntoCommonBundle = _this.factorThreshold( row, group );
needToWriteCommonJsBundle = needToWriteCommonJsBundle || putIntoCommonBundle;
return putIntoCommonBundle;
}
return putIntoCommonBundle;
}
} );

if( this.watch ) {
Expand Down

0 comments on commit 88456a3

Please sign in to comment.