Skip to content

Commit c30095a

Browse files
committed
small fixes
1 parent 259fb52 commit c30095a

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

lib/buildDeps.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,10 +397,10 @@ function createRealIds(depTree, options) {
397397
depTree.modulesById[0].realId = 0;
398398
sortedModules.sort(function(a, b) {
399399
if(a.chunks && b.chunks &&
400-
(a.chunks.indexOf(0) !== -1 || b.chunks.indexOf(0) !== -1)) {
401-
if(a.chunks.indexOf(0) === -1)
400+
(a.chunks.indexOf("main") !== -1 || b.chunks.indexOf("main") !== -1)) {
401+
if(a.chunks.indexOf("main") === -1)
402402
return 1;
403-
if(b.chunks.indexOf(0) === -1)
403+
if(b.chunks.indexOf("main") === -1)
404404
return -1;
405405
}
406406
var diff = b.usages - a.usages;

lib/webpack.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ function webpack(context, moduleName, options, callback) {
214214
// all ids of the chunks, in desc order
215215
var chunkIds = Object.keys(depTree.chunks);
216216
chunkIds.sort(function(a,b) {
217+
if(typeof depTree.chunks[b].realId !== "number") return 1;
218+
if(typeof depTree.chunks[a].realId !== "number") return -1;
217219
return depTree.chunks[b].realId - depTree.chunks[a].realId;
218220
});
219221

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.4.3",
3+
"version": "0.4.4",
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)