Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #6645 from zacanger/fix/6644
Fix #6644
  • Loading branch information
sokra committed Mar 3, 2018
2 parents 2e3d319 + b0e14df commit 00f70fc
Show file tree
Hide file tree
Showing 5 changed files with 29 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"];
}
};
16 changes: 16 additions & 0 deletions test/configCases/split-chunks/no-options/webpack.config.js
@@ -0,0 +1,16 @@
const SplitChunksPlugin = require("../../../../lib/optimize/SplitChunksPlugin");

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

0 comments on commit 00f70fc

Please sign in to comment.