Skip to content

Commit

Permalink
Fix #6644
Browse files Browse the repository at this point in the history
  • Loading branch information
zacanger committed Mar 2, 2018
1 parent f6e366b commit 3a41ca4
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/optimize/SplitChunksPlugin.js
Expand Up @@ -83,7 +83,7 @@ module.exports = class SplitChunksPlugin {
this.options = SplitChunksPlugin.normalizeOptions(options);
}

static normalizeOptions(options) {
static normalizeOptions(options = {}) {
return {
chunks: options.chunks || "all",
minSize: options.minSize || 0,
Expand Down
1 change: 1 addition & 0 deletions test/configCases/split-chunks/no-options/a.js
@@ -0,0 +1 @@
module.exports = "a";
6 changes: 6 additions & 0 deletions test/configCases/split-chunks/no-options/index.js
@@ -0,0 +1,6 @@
require("should");

it("should run", function() {
var a = require("./a");
a.should.be.eql("a");
});
5 changes: 5 additions & 0 deletions test/configCases/split-chunks/no-options/test.config.js
@@ -0,0 +1,5 @@
module.exports = {
findBundle: function(i, options) {
return ["vendor.js", "main.js"];
}
};
13 changes: 13 additions & 0 deletions test/configCases/split-chunks/no-options/webpack.config.js
@@ -0,0 +1,13 @@
const SplitChunksPlugin = require("../../../../lib/optimize/SplitChunksPlugin");

module.exports = {
entry: {
vendor: ["./a"],
main: "./index"
},
target: "web",
output: {
filename: "[name].js"
},
plugins: [new SplitChunksPlugin()]
};

0 comments on commit 3a41ca4

Please sign in to comment.