File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -501,7 +501,7 @@ class Chunk {
501501 this . _modules . sortWith ( sortByFn || sortById ) ;
502502 }
503503
504- sortItems ( ) {
504+ sortItems ( sortChunks ) {
505505 this . sortModules ( ) ;
506506 this . origins . sort ( ( a , b ) => {
507507 const aIdent = a . module . identifier ( ) ;
@@ -514,8 +514,10 @@ class Chunk {
514514 if ( origin . reasons )
515515 origin . reasons . sort ( ) ;
516516 } ) ;
517- this . _parents . sort ( ) ;
518- this . _chunks . sort ( ) ;
517+ if ( sortChunks ) {
518+ this . _parents . sort ( ) ;
519+ this . _chunks . sort ( ) ;
520+ }
519521 }
520522
521523 toString ( ) {
Original file line number Diff line number Diff line change @@ -1115,7 +1115,7 @@ class Compilation extends Tapable {
11151115
11161116 const chunks = this . chunks ;
11171117 for ( let indexChunk = 0 ; indexChunk < chunks . length ; indexChunk ++ ) {
1118- chunks [ indexChunk ] . sortItems ( ) ;
1118+ chunks [ indexChunk ] . sortItems ( false ) ;
11191119 }
11201120 }
11211121
@@ -1129,7 +1129,7 @@ class Compilation extends Tapable {
11291129
11301130 const chunks = this . chunks ;
11311131 for ( let indexChunk = 0 ; indexChunk < chunks . length ; indexChunk ++ ) {
1132- chunks [ indexChunk ] . sortItems ( ) ;
1132+ chunks [ indexChunk ] . sortItems ( true ) ;
11331133 }
11341134
11351135 const byMessage = ( a , b ) => {
Original file line number Diff line number Diff line change @@ -43,9 +43,10 @@ module.exports = class SortableSet extends Set {
4343 const sortedArray = Array . from ( this ) . sort ( sortFn ) ;
4444 super . clear ( ) ;
4545 for ( let i = 0 ; i < sortedArray . length ; i += 1 ) {
46- this . add ( sortedArray [ i ] ) ;
46+ super . add ( sortedArray [ i ] ) ;
4747 }
4848 this . _lastActiveSortFn = sortFn ;
49+ this . _frozenArray = null ;
4950 }
5051
5152 /**
You can’t perform that action at this time.
0 commit comments