Skip to content

Commit

Permalink
Merge pull request #392 from hey-car/fix/source_is_not_available
Browse files Browse the repository at this point in the history
fix: the source is not available on afterEmit
  • Loading branch information
ztoben authored Apr 23, 2021
2 parents 0055097 + 43aeb5d commit c4502c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit c4502c6

Please # to comment.