Skip to content

Commit 77705e1

Browse files
committed
changed example to made coverage pass. It also seemed like the common functionality may not be working correctly
1 parent 5fde639 commit 77705e1

6 files changed

Lines changed: 11 additions & 10 deletions

File tree

examples/move-to-parent/page.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

examples/move-to-parent/pageA.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require(["./a"]);

examples/move-to-parent/pageB.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require(["./a", "./b"]);

examples/move-to-parent/pageC.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require(["./a", "./b", "./c"]);
2+

examples/move-to-parent/pageD.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require(["./a", "./b", "./c", "./d"]);

examples/move-to-parent/webpack.config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ var path = require("path");
22
var CommonsChunkPlugin = require("../../lib/optimize/CommonsChunkPlugin");
33
module.exports = {
44
entry: {
5-
pageA: "./page?A",
6-
pageB: "./page?B",
7-
pageC: "./page?C",
8-
pageD: "./page?D"
5+
pageA: "./pageA",
6+
pageB: "./pageB",
7+
pageC: "./pageC",
8+
pageD: "./pageD"
99
},
1010
output: {
1111
path: path.join(__dirname, "js"),
1212
filename: "[name].bundle.js",
1313
chunkFilename: "[id].chunk.js"
1414
},
1515
plugins: [
16-
// check for common modules in children of pageA and move them to the parent
16+
//check for common modules in children of pageA and move them to the parent
1717
new CommonsChunkPlugin({
1818
name: "pageA",
1919
children: true
@@ -32,7 +32,7 @@ module.exports = {
3232
children: true,
3333
minChunks: function(module, count) {
3434
// move only module "b"
35-
return /b\.js$/.test(module.identifier());
35+
return !/b\.js$/.test(module.identifier());
3636
}
3737
})
3838
]

0 commit comments

Comments
 (0)