Skip to content

Commit 00f70fc

Browse files
authored
Merge pull request webpack#6645 from zacanger/fix/6644
Fix webpack#6644
2 parents 2e3d319 + b0e14df commit 00f70fc

File tree

5 files changed

+29
-1
lines changed

5 files changed

+29
-1
lines changed

lib/optimize/SplitChunksPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ module.exports = class SplitChunksPlugin {
8383
this.options = SplitChunksPlugin.normalizeOptions(options);
8484
}
8585

86-
static normalizeOptions(options) {
86+
static normalizeOptions(options = {}) {
8787
return {
8888
chunks: options.chunks || "all",
8989
minSize: options.minSize || 0,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = "a";
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
require("should");
2+
3+
it("should run", function() {
4+
var a = require("./a");
5+
a.should.be.eql("a");
6+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
findBundle: function(i, options) {
3+
return ["vendor.js", "main.js"];
4+
}
5+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const SplitChunksPlugin = require("../../../../lib/optimize/SplitChunksPlugin");
2+
3+
module.exports = {
4+
entry: {
5+
vendor: ["./a"],
6+
main: "./index"
7+
},
8+
target: "web",
9+
output: {
10+
filename: "[name].js"
11+
},
12+
optimization: {
13+
splitChunks: false
14+
},
15+
plugins: [new SplitChunksPlugin()]
16+
};

0 commit comments

Comments
 (0)