File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ module.exports = class SpeedMeasurePlugin {
8282 if ( typeof this . options . outputFormat === "function" )
8383 return this . options . outputFormat ( outputObj ) ;
8484 return getHumanOutput ( outputObj , {
85+ ...this . options ,
8586 verbose : this . options . outputFormat === "humanVerbose" ,
8687 } ) ;
8788 }
Original file line number Diff line number Diff line change @@ -94,6 +94,14 @@ module.exports.getHumanOutput = (outputObj, options = {}) => {
9494
9595 xEqualsY . push ( [ "module count" , loaderObj . averages . dataPoints ] ) ;
9696
97+ if ( options . loaderTopFiles ) {
98+ const loopLen = Math . min ( loaderObj . rawStartEnds . length , options . loaderTopFiles ) ;
99+ for ( let i = 0 ; i < loopLen ; i ++ ) {
100+ const rawItem = loaderObj . rawStartEnds [ i ] ;
101+ xEqualsY . push ( [ rawItem . name , hT ( rawItem . end - rawItem . start ) ] ) ;
102+ }
103+ }
104+
97105 const maxXLength = xEqualsY . reduce (
98106 ( acc , cur ) => Math . max ( acc , cur [ 0 ] . length ) ,
99107 0
@@ -148,6 +156,9 @@ module.exports.getLoadersOutput = data => {
148156 activeTime,
149157 loaders : startEnds [ 0 ] . loaders ,
150158 subLoadersTime : subLoadersActiveTime ,
159+ rawStartEnds : startEnds . sort (
160+ ( a , b ) => b . end - b . start - ( a . end - a . start )
161+ ) ,
151162 } ;
152163 } ) ;
153164
You can’t perform that action at this time.
0 commit comments