From 43aeb5d692d2288be753f7afbd4e2996ffcce498 Mon Sep 17 00:00:00 2001 From: Sonat Alpagut Date: Fri, 23 Apr 2021 15:53:58 +0200 Subject: [PATCH] fix: the source is not available on afterEmit --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 1881b2b..d0d0563 100644 --- a/index.js +++ b/index.js @@ -42,7 +42,7 @@ AssetsWebpackPlugin.prototype = { ) self.writer = createQueuedWriter(createOutputWriter(self.options)) - const afterEmit = (compilation, callback) => { + const emitPlugin = (compilation, callback) => { const options = compiler.options const stats = compilation.getStats().toJson({ hash: true, @@ -206,9 +206,9 @@ AssetsWebpackPlugin.prototype = { if (compiler.hooks) { const plugin = { name: 'AssetsWebpackPlugin' } - compiler.hooks.afterEmit.tapAsync(plugin, afterEmit) + compiler.hooks.emit.tapAsync(plugin, emitPlugin) } else { - compiler.plugin('after-emit', afterEmit) + compiler.plugin('after-emit', emitPlugin) } } }