webpack-stats-report
v2.0.6
Published
webpack-stats-report
Downloads
6,183
Readme
Webpack Stats Report
Preview Example Reports
Install
npm i webpack-stats-report -D
Usage
As a webpack plugin
// webpack.config.js
const StatsReportPlugin = require("webpack-stats-report").StatsReportPlugin;
module.exports = {
// ... configuration settings here ...
plugins: [new StatsReportPlugin({
//options
title: "Stats Report - webpack-stats-report",
output: ".temp/stats-report.html"
})]
};
As a Node API
const webpack = require('webpack');
const StatsReportGenerator = require("webpack-stats-report").StatsReportGenerator;
webpack(webpackConfig, async (err, stats) => {
await StatsReportGenerator({
//options
title: "Stats Report - webpack-stats-report",
output: ".temp/stats-report.html",
//require one more option stats
stats: stats.toJson({
//source for gzipSize = true
source: true,
reasons: false,
chunkModules: false
})
});
});
Options
//default options
{
title: "Stats Report",
output: "stats-report.html",
outputStatsJson: false,
gzipSize: false
...
}
more details: options.js
Test
npm run test
see test/test.js
Changelog
see CHANGELOG.md