webpack-stats-report

2.0.6 • Public • Published

Webpack Stats Report

Generating Webpack Stats Report in HTML Grid.

npm npm

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

Readme

Keywords

none

Package Sidebar

Install

npm i webpack-stats-report

Weekly Downloads

3,283

Version

2.0.6

License

MIT

Unpacked Size

359 kB

Total Files

10

Last publish

Collaborators

  • cenfun