Skip to content

Commit 2879fb3

Browse files
authored
Merge pull request webpack#5225 from hulkish/feature/added-chunk-sortModules-method
added sortModules method to Chunk class
2 parents 0ab36c4 + 5f08aa4 commit 2879fb3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/Chunk.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,12 @@ class Chunk {
421421
};
422422
}
423423

424+
sortModules(sortByFn) {
425+
this._modules.sortWith(sortByFn || sortById);
426+
}
427+
424428
sortItems() {
425-
this._modules.sortWith(sortById);
429+
this.sortModules();
426430
this.origins.sort((a, b) => {
427431
const aIdent = a.module.identifier();
428432
const bIdent = b.module.identifier();

0 commit comments

Comments
 (0)