@@ -135,6 +135,7 @@ class Stats {
135135 const showBuiltAt = optionOrLocalFallback ( options . builtAt , true ) ;
136136 const showAssets = optionOrLocalFallback ( options . assets , true ) ;
137137 const showEntrypoints = optionOrLocalFallback ( options . entrypoints , true ) ;
138+ const showChunkGroups = optionOrLocalFallback ( options . chunkGroups , true ) ;
138139 const showChunks = optionOrLocalFallback ( options . chunks , ! forToString ) ;
139140 const showChunkModules = optionOrLocalFallback ( options . chunkModules , true ) ;
140141 const showChunkOrigins = optionOrLocalFallback (
@@ -396,15 +397,15 @@ class Stats {
396397 obj . assets . sort ( sortByField ( sortAssets ) ) ;
397398 }
398399
399- if ( showEntrypoints ) {
400- obj . entrypoints = { } ;
401- for ( const keyValuePair of compilation . entrypoints ) {
400+ const fnChunkGroup = groupMap => {
401+ const obj = { } ;
402+ for ( const keyValuePair of groupMap ) {
402403 const name = keyValuePair [ 0 ] ;
403- const ep = keyValuePair [ 1 ] ;
404- const children = ep . getChildrenByOrders ( ) ;
405- obj . entrypoints [ name ] = {
406- chunks : ep . chunks . map ( c => c . id ) ,
407- assets : ep . chunks . reduce (
404+ const cg = keyValuePair [ 1 ] ;
405+ const children = cg . getChildrenByOrders ( ) ;
406+ obj [ name ] = {
407+ chunks : cg . chunks . map ( c => c . id ) ,
408+ assets : cg . chunks . reduce (
408409 ( array , c ) => array . concat ( c . files || [ ] ) ,
409410 [ ]
410411 ) ,
@@ -436,9 +437,19 @@ class Stats {
436437 } , Object . create ( null ) )
437438 } ;
438439 if ( showPerformance ) {
439- obj . entrypoints [ name ] . isOverSizeLimit = ep . isOverSizeLimit ;
440+ obj [ name ] . isOverSizeLimit = cg . isOverSizeLimit ;
440441 }
441442 }
443+
444+ return obj ;
445+ } ;
446+
447+ if ( showEntrypoints ) {
448+ obj . entrypoints = fnChunkGroup ( compilation . entrypoints ) ;
449+ }
450+
451+ if ( showChunkGroups ) {
452+ obj . chunkGroups = fnChunkGroup ( compilation . namedChunkGroups ) ;
442453 }
443454
444455 const fnModule = module => {
0 commit comments