Skip to content

Commit 132272b

Browse files
author
chuckd
committed
Update unit test to use CommonsChunkPlugin
1 parent fd43f11 commit 132272b

File tree

7 files changed

+22
-8
lines changed

7 files changed

+22
-8
lines changed

test/cases/compile/require-context/a.js

Whitespace-only changes.

test/cases/compile/require-context/b.js

Whitespace-only changes.

test/cases/compile/require-context/index.js

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = "a";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = "b";
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
it("should maintain require context", function(done) {
2+
var context = {foo: "bar"};
3+
(function(){
4+
require(["./a", "./b"], function(a, b) {
5+
this.foo.should.eql("bar");
6+
done();
7+
}.bind(this));
8+
}).call(context);
9+
// Call require again so that CommonsChunkPlugin will create separate chunks for a and b
10+
require(["./a"], function(a) {});
11+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
var webpack = require("../../../../");
2+
3+
module.exports = {
4+
plugins: [
5+
new webpack.optimize.CommonsChunkPlugin({
6+
async: true
7+
})
8+
]
9+
};

0 commit comments

Comments
 (0)