From cadf9f715f143519696a0b0d43881ef63ec683fb Mon Sep 17 00:00:00 2001 From: Steven Hargrove Date: Thu, 6 Jul 2017 16:08:58 -0400 Subject: [PATCH 1/2] added sortModules method to Chunk class --- lib/Chunk.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Chunk.js b/lib/Chunk.js index b4e15e988cd..f02a30296fc 100644 --- a/lib/Chunk.js +++ b/lib/Chunk.js @@ -421,8 +421,12 @@ class Chunk { }; } + sortModules(sortByFn = sortById) { + this._modules.sortWith(sortByFn); + } + sortItems() { - this._modules.sortWith(sortById); + this.sortModules(); this.origins.sort((a, b) => { const aIdent = a.module.identifier(); const bIdent = b.module.identifier(); From 5f08aa44bdddf3ed20319e26c71ed4a6cbac7f30 Mon Sep 17 00:00:00 2001 From: Steven Hargrove Date: Thu, 6 Jul 2017 16:40:58 -0400 Subject: [PATCH 2/2] removed default params for node 4 --- lib/Chunk.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Chunk.js b/lib/Chunk.js index f02a30296fc..41cac42cd37 100644 --- a/lib/Chunk.js +++ b/lib/Chunk.js @@ -421,8 +421,8 @@ class Chunk { }; } - sortModules(sortByFn = sortById) { - this._modules.sortWith(sortByFn); + sortModules(sortByFn) { + this._modules.sortWith(sortByFn || sortById); } sortItems() {