Skip to content

Commit

Permalink
add testcase for moving entry modules into the commons chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed May 4, 2017
1 parent c91ba49 commit a244879
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/configCases/commons-chunk-plugin/move-entry/a.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = "a";
5 changes: 5 additions & 0 deletions test/configCases/commons-chunk-plugin/move-entry/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require("should");

it("should not be moved", function() {
new Error().stack.should.not.match(/webpackBootstrap/);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
findBundle: function(i, options) {
return [
"./commons.js",
"./main.js"
]
}
};
16 changes: 16 additions & 0 deletions test/configCases/commons-chunk-plugin/move-entry/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
var CommonsChunkPlugin = require("../../../../lib/optimize/CommonsChunkPlugin");
module.exports = {
entry: {
main: "./index",
second: "./index"
},
target: "web",
output: {
filename: "[name].js"
},
plugins: [
new CommonsChunkPlugin({
name: "commons"
})
]
};

0 comments on commit a244879

Please sign in to comment.