mirror of https://github.com/webpack/webpack.git
fixed single option
This commit is contained in:
parent
f265d3e3de
commit
258b0c1951
|
@ -33,6 +33,10 @@ var argv = require("optimist")
|
|||
.describe("colors", "Output Stats with colors")
|
||||
.default("colors", false)
|
||||
|
||||
.boolean("single")
|
||||
.describe("single", "Disable lazy loading")
|
||||
.default("single", false)
|
||||
|
||||
.boolean("json")
|
||||
.describe("json", "Output Stats as JSON")
|
||||
.default("json", false)
|
||||
|
@ -95,6 +99,10 @@ if(argv.debug) {
|
|||
options.debug = true;
|
||||
}
|
||||
|
||||
if(argv.single) {
|
||||
options.single = true;
|
||||
}
|
||||
|
||||
if(argv.watch) {
|
||||
options.watch = true;
|
||||
}
|
||||
|
|
|
@ -477,15 +477,19 @@ function addModuleToChunk(depTree, context, chunkId, options) {
|
|||
}
|
||||
if(context.asyncs) {
|
||||
context.asyncs.forEach(function(context) {
|
||||
var subChunk
|
||||
if(context.chunkId) {
|
||||
subChunk = depTree.chunks[context.chunkId];
|
||||
subChunk.usages++;
|
||||
if(options.single) {
|
||||
addModuleToChunk(depTree, context, chunkId, options);
|
||||
} else {
|
||||
subChunk = addChunk(depTree, context, options);
|
||||
var subChunk;
|
||||
if(context.chunkId) {
|
||||
subChunk = depTree.chunks[context.chunkId];
|
||||
subChunk.usages++;
|
||||
} else {
|
||||
subChunk = addChunk(depTree, context, options);
|
||||
}
|
||||
subChunk.parents = subChunk.parents || [];
|
||||
subChunk.parents.push(chunkId);
|
||||
}
|
||||
subChunk.parents = subChunk.parents || [];
|
||||
subChunk.parents.push(chunkId);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue