Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ StatsPlugin.prototype.apply = function apply (compiler) {
var cache = this.cache

compiler.plugin('emit', function onEmit (compilation, done) {
var result
var resultStored

compilation.assets[output] = {
size: function getSize () {
return result && result.length || 0
return resultStored && resultStored.length || 0
},
source: function getSource () {
var stats = compilation.getStats().toJson(options)
Expand All @@ -38,6 +38,7 @@ StatsPlugin.prototype.apply = function apply (compiler) {
} else {
result = JSON.stringify(stats)
}
resultStored = result
return result
}
}
Expand Down