Skip to content

Commit 756f2ca

Browse files
committed
Testing LibManifestPlugin directly instead of going through DllPlugin
Renamed files to reflect that change, as well as added tests to verify the manifest output.
1 parent 4650dfe commit 756f2ca

5 files changed

Lines changed: 35 additions & 20 deletions

File tree

test/configCases/plugins/dll-plugin/index.js

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

test/configCases/plugins/dll-plugin/webpack.config.js

Lines changed: 0 additions & 14 deletions
This file was deleted.
File renamed without changes.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
var fs = require("fs");
2+
var path = require("path");
3+
4+
it("should complete", function(done) {
5+
require.ensure(["./a"], function(require) {
6+
require("./a").should.be.eql("a");
7+
done();
8+
});
9+
});
10+
11+
it("should write the correct manifest", function() {
12+
var manifest = JSON.parse(fs.readFileSync(path.join(__dirname, 'bundle0-manifest.json'), "utf-8"));
13+
manifest.should.have.key("content", "name");
14+
manifest.content.should.not.have.property("./a.js");
15+
manifest.content.should.have.property("./index.js");
16+
manifest.content["./index.js"].should.eql(0);
17+
});
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
var path = require("path");
2+
var webpack = require("../../../../");
3+
var LibManifestPlugin = require("../../../../lib/LibManifestPlugin");
4+
5+
module.exports = {
6+
entry: {
7+
bundle0: ["./"]
8+
},
9+
plugins: [
10+
new LibManifestPlugin({
11+
path: path.resolve(__dirname, '../../../js/config/plugins/lib-manifest-plugin/[name]-manifest.json'),
12+
name: "[name]_[hash]"
13+
})
14+
],
15+
node: {
16+
__dirname: false
17+
}
18+
}

0 commit comments

Comments
 (0)