mirror of https://github.com/webpack/webpack.git
Merge pull request #1764 from jnwng/jw/dll-plugin
Using DllPlugin with multiple chunks ends without emitting chunks.
This commit is contained in:
commit
d883923da1
|
|
@ -12,8 +12,10 @@ module.exports = LibManifestPlugin;
|
|||
LibManifestPlugin.prototype.apply = function(compiler) {
|
||||
compiler.plugin("emit", function(compilation, callback) {
|
||||
async.forEach(compilation.chunks, function(chunk, callback) {
|
||||
if(!chunk.initial)
|
||||
if(!chunk.initial) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
var targetPath = compilation.getPath(this.options.path, {
|
||||
hash: compilation.hash,
|
||||
chunk: chunk
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
module.exports = "a";
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
|
||||
it("should complete", function(done) {
|
||||
require.ensure(["./a"], function(require) {
|
||||
require("./a").should.be.eql("a");
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("should write the correct manifest", function() {
|
||||
var manifest = JSON.parse(fs.readFileSync(path.join(__dirname, 'bundle0-manifest.json'), "utf-8"));
|
||||
manifest.should.have.key("content", "name");
|
||||
manifest.content.should.not.have.property("./a.js");
|
||||
manifest.content.should.have.property("./index.js");
|
||||
manifest.content["./index.js"].should.eql(0);
|
||||
});
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
var path = require("path");
|
||||
var webpack = require("../../../../");
|
||||
var LibManifestPlugin = require("../../../../lib/LibManifestPlugin");
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
bundle0: ["./"]
|
||||
},
|
||||
plugins: [
|
||||
new LibManifestPlugin({
|
||||
path: path.resolve(__dirname, '../../../js/config/plugins/lib-manifest-plugin/[name]-manifest.json'),
|
||||
name: "[name]_[hash]"
|
||||
})
|
||||
],
|
||||
node: {
|
||||
__dirname: false
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue