Skip to content

Commit 3ea83f1

Browse files
committed
Add tests for exclude functionality in BannerPlugin
1 parent b76aa12 commit 3ea83f1

4 files changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
it("should contain banner in bundle0 chunk", function() {
2+
var fs = require("fs");
3+
var source = fs.readFileSync(__filename, "utf-8");
4+
source.should.containEql("A test value");
5+
});
6+
7+
it("should not contain banner in vendors chunk", function() {
8+
var fs = require("fs"),
9+
path = require("path");
10+
var source = fs.readFileSync(path.join(__dirname, "vendors.js"), "utf-8");
11+
source.should.not.containEql("A test value");
12+
});
13+
14+
require.include("./test.js");
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
var foo = {};
2+
3+
module.exports = foo;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
var bar = {};
2+
3+
module.exports = bar;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
var webpack = require("../../../../");
2+
module.exports = {
3+
node: {
4+
__dirname: false,
5+
__filename: false
6+
},
7+
entry: {
8+
bundle0: ["./index.js"],
9+
vendors: ["./vendors.js"]
10+
},
11+
output: {
12+
filename: "[name].js"
13+
},
14+
plugins: [
15+
new webpack.BannerPlugin("A test value", {
16+
exclude: ["vendors.js"]
17+
})
18+
]
19+
};

0 commit comments

Comments
 (0)