Skip to content

Commit a7cdb88

Browse files
committed
minor fixes
1 parent e2277c6 commit a7cdb88

5 files changed

Lines changed: 13 additions & 10 deletions

File tree

‎bin/config-optimist.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ module.exports = function(optimist) {
4545

4646
.describe("optimize-max-chunks")
4747

48+
.describe("optimize-min-chunk-size")
49+
4850
.boolean("optimize-minimize").describe("optimize-minimize")
4951

5052
.string("plugin").describe("plugin")

‎bin/convert-argv.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@ module.exports = function(optimist, argv, convertOptions) {
219219
options.optimize.maxChunks = parseInt(value, 10);
220220
});
221221

222+
ifArg("optimize-min-chunk-size", function(value) {
223+
ensureObject(options, "optimize");
224+
options.optimize.minChunkSize = parseInt(value, 10);
225+
});
226+
222227
ifBooleanArg("optimize-minimize", function() {
223228
ensureObject(options, "optimize");
224229
options.optimize.minimize = true;

‎lib/optimize/MinChunkSizePlugin.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ MinChunkSizePlugin.prototype.apply = function(compiler) {
3030
if(a.entry != b.entry) {
3131
return a.entry ? 1 : -1;
3232
}
33-
return b.size - a.size;
33+
return a.size - b.size;
3434
});
3535

36-
if(argumentedChunks[0].size < minChunkSize) {
36+
if(argumentedChunks[0].size < minChunkSize && !argumentedChunks[0].entry) {
3737
for(var i = 1; i < argumentedChunks.length; i++) {
3838
if(argumentedChunks[i].size + argumentedChunks[0].size >= minChunkSize)
3939
break;

‎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.9.0-beta15",
3+
"version": "0.9.0-beta16",
44
"author": "Tobias Koppers @sokra",
55
"description": "Packs CommonJs/AMD Modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jade, coffee, css, less, ... and your custom stuff.",
66
"dependencies": {

‎test/browsertest/library2config.js‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@ module.exports = {
22
module: {
33
postLoaders: [
44
{ test: /extra2?\.js/, loader: "raw!extra!val?cacheable" }
5-
],
6-
afterResolve: [
7-
function(result, callback) {
8-
result.request = result.request.replace(/extra\.js/, "extra2.js");
9-
callback(null, result);
10-
}
115
]
126
},
13-
maxChunks: 2,
7+
optimize: {
8+
maxChunks: 2,
9+
},
1410
amd: {
1511
fromOptions: true
1612
},

0 commit comments

Comments
 (0)