Skip to content

Commit d453ce0

Browse files
committed
Improve webpack 4 support
1 parent 661af13 commit d453ce0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/plugin.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ ManifestPlugin.prototype.apply = function(compiler) {
180180
compiler.hooks.afterEmit.tap('ManifestPlugin', function(compilation) {
181181
release();
182182
});
183+
184+
compilation.hooks.webpackManifestPluginAfterEmit.call(manifest, compileCallback);
183185
} else {
184186
compiler.plugin('after-emit', function(compilation, cb) {
185187
release();
@@ -193,6 +195,11 @@ ManifestPlugin.prototype.apply = function(compiler) {
193195

194196
if (compiler.hooks) {
195197
compiler.hooks.compilation.tap('ManifestPlugin', function (compilation) {
198+
199+
var SyncWaterfallHook = require('tapable').SyncWaterfallHook;
200+
201+
compilation.hooks.webpackManifestPluginAfterEmit = new SyncWaterfallHook(['manifest', 'compileCallback']);
202+
196203
compilation.hooks.moduleAsset.tap('ManifestPlugin', moduleAsset);
197204
});
198205
compiler.hooks.emit.tap('ManifestPlugin', emit);

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"dependencies": {
4242
"fs-extra": "^0.30.0",
4343
"lodash": ">=3.5 <5",
44-
"mutexify": "1.0.1"
44+
"mutexify": "1.0.1",
45+
"tapable": "^1.0.0"
4546
},
4647
"nyc": {
4748
"reporter": [

0 commit comments

Comments
 (0)