GeezerVison is showing github.com — fix unstable sorting of ChunkGroups and add test · webpack/webpack@8e2e19b
File tree
Expand file treeCollapse file tree
Open diff view settings
test/statsCases/prefetch-preload-mixed
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: lib/Chunk.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -389,7 +389,7 @@ class Chunk { |
389 | 389 | const cmp = b.order - a.order; |
390 | 390 | if (cmp !== 0) return cmp; |
391 | 391 | // TOOD webpack 5 remove this check of compareTo |
392 | | - if (a.compareTo) return a.compareTo(b); |
| 392 | + if (a.group.compareTo) return a.group.compareTo(b.group); |
393 | 393 | return 0; |
394 | 394 | }); |
395 | 395 | result[name] = Array.from( |
|
Collapse file
Copy file name to clipboardExpand all lines: lib/ChunkGroup.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -349,7 +349,7 @@ class ChunkGroup { |
349 | 349 | const cmp = b.order - a.order; |
350 | 350 | if (cmp !== 0) return cmp; |
351 | 351 | // TOOD webpack 5 remove this check of compareTo |
352 | | - if (a.compareTo) return a.compareTo(b); |
| 352 | + if (a.group.compareTo) return a.group.compareTo(b.group); |
353 | 353 | return 0; |
354 | 354 | }); |
355 | 355 | result[name] = list.map(i => i.group); |
|
Collapse file
Copy file name to clipboardExpand all lines: test/statsCases/prefetch-preload-mixed/expected.txt +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -chunk {0} a.js (a) 136 bytes <{3}> >{10}< >{9}< (prefetch: {10} {9}) [rendered] |
| 1 | +chunk {0} a.js (a) 136 bytes <{3}> >{10}< >{9}< (prefetch: {9} {10}) [rendered] |
2 | 2 | chunk {1} b.js (b) 203 bytes <{3}> >{6}< >{7}< >{8}< (prefetch: {6} {8}) (preload: {7}) [rendered] |
3 | 3 | chunk {2} c.js (c) 134 bytes <{3}> >{4}< >{5}< (preload: {4} {5}) [rendered] |
4 | | -chunk {3} main.js (main) 126 bytes >{0}< >{1}< >{2}< [entry] [rendered] |
| 4 | +chunk {3} main.js (main) 195 bytes >{0}< >{1}< >{2}< (prefetch: {0} {1} {2}) [entry] [rendered] |
5 | 5 | chunk {4} c1.js (c1) 0 bytes <{2}> [rendered] |
6 | 6 | chunk {5} c2.js (c2) 0 bytes <{2}> [rendered] |
7 | 7 | chunk {6} b1.js (b1) 0 bytes <{1}> [rendered] |
|
Collapse file
Copy file name to clipboard +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -import(/* webpackChunkName: "a" */"./a"); |
2 | | -import(/* webpackChunkName: "b" */"./b"); |
3 | | -import(/* webpackChunkName: "c" */"./c"); |
| 1 | +import(/* webpackPrefetch: true, webpackChunkName: "a" */"./a"); |
| 2 | +import(/* webpackPrefetch: true, webpackChunkName: "b" */"./b"); |
| 3 | +import(/* webpackPrefetch: true, webpackChunkName: "c" */"./c"); |