@@ -15,6 +15,12 @@ const optionsOrFallback = (...args) => {
15
15
return optionValues . find ( optionValue => typeof optionValue !== "undefined" ) ;
16
16
} ;
17
17
18
+ const compareId = ( a , b ) => {
19
+ if ( a < b ) return - 1 ;
20
+ if ( a > b ) return 1 ;
21
+ return 0 ;
22
+ } ;
23
+
18
24
class Stats {
19
25
constructor ( compilation ) {
20
26
this . compilation = compilation ;
@@ -543,7 +549,7 @@ class Stats {
543
549
}
544
550
return obj ;
545
551
} )
546
- . sort ( ( a , b ) => a . moduleId - b . moduleId ) ;
552
+ . sort ( compareId ) ;
547
553
}
548
554
if ( showUsedExports ) {
549
555
if ( module . used === true ) {
@@ -614,9 +620,9 @@ class Stats {
614
620
names : chunk . name ? [ chunk . name ] : [ ] ,
615
621
files : chunk . files . slice ( ) ,
616
622
hash : chunk . renderedHash ,
617
- siblings : Array . from ( siblings ) . sort ( ) ,
618
- parents : Array . from ( parents ) . sort ( ) ,
619
- children : Array . from ( children ) . sort ( ) ,
623
+ siblings : Array . from ( siblings ) . sort ( compareId ) ,
624
+ parents : Array . from ( parents ) . sort ( compareId ) ,
625
+ children : Array . from ( children ) . sort ( compareId ) ,
620
626
childrenByOrder : childIdByOrder
621
627
} ;
622
628
if ( showChunkModules ) {
0 commit comments