Skip to content

Commit 7b7fc9c

Browse files
committed
even more deterministic
1 parent 54ed0bf commit 7b7fc9c

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎lib/buildDeps.js‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,16 @@ function createRealChunkIds(depTree, options) {
539539
return 1;
540540
var aCount = Object.keys(a.modules).length;
541541
var bCount = Object.keys(b.modules).length;
542-
return aCount - bCount;
542+
if(aCount != bCount)
543+
return aCount - bCount;
544+
function genModulesString(modules) {
545+
return Object.keys(modules).sort().join("-");
546+
}
547+
var aModules = genModulesString(a.modules);
548+
var bModules = genModulesString(b.modules);
549+
if(aModules == bModules)
550+
return 0;
551+
return aModules < bModules ? -1 : 1;
543552
});
544553
sortedChunks.forEach(function(chunk, idx) {
545554
chunk.realId = idx + 1;

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webpack",
3-
"version": "0.3.18",
3+
"version": "0.3.19",
44
"author": "Tobias Koppers @sokra",
55
"description": "Packs CommonJs Modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loading of js, json, jade, coffee, css, ... out of the box and more with custom loaders.",
66
"dependencies": {

0 commit comments

Comments
 (0)