webpack-bundle-stats-plugin
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -11,12 +11,9 @@ "use strict"; | ||
apply(compiler) { | ||
compiler.hooks.compilation.tap('BundleStatsPlugin', (compilation) => { | ||
// TODO: Is there a better hook to tap than statsFactory? | ||
compilation.hooks.statsFactory.tap('BundleStatsPlugin', () => { | ||
var _a, _b; | ||
const stats = (0, getStatsFromCompilation_1.getStatsFromCompilation)(compilation); | ||
if (this.options.outputFile) { | ||
fs.writeFileSync(this.options.outputFile, JSON.stringify(stats, null, 2)); | ||
} | ||
(_b = (_a = this.options).onComplete) === null || _b === void 0 ? void 0 : _b.call(_a, stats); | ||
}); | ||
compiler.hooks.done.tap('BundleStatsPlugin', (webpackStats) => { | ||
var _a, _b; | ||
const stats = (0, getStatsFromCompilation_1.getStatsFromCompilation)(webpackStats.compilation); | ||
if (this.options.outputFile) { | ||
fs.writeFileSync(this.options.outputFile, JSON.stringify(stats, null, 2)); | ||
} | ||
(_b = (_a = this.options).onComplete) === null || _b === void 0 ? void 0 : _b.call(_a, stats); | ||
}); | ||
@@ -23,0 +20,0 @@ } |
{ | ||
"name": "webpack-bundle-stats-plugin", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Export internal bundling details from Webpack", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
6564
103