diff --git a/src/index.js b/src/index.js index 425f234..bda4c92 100755 --- a/src/index.js +++ b/src/index.js @@ -37,7 +37,8 @@ function DonePlugin(callbacks) { DonePlugin.prototype.apply = function (compiler) { let callbacks = this.callbacks - compiler.plugin('done', function () { + const pluginFn = compiler.hooks ? compiler.hooks.done.tap : compiler.plugin + [pluginFn]('done', function () { callbacks.forEach(function (fn) { fn() })