https://github.com/cenfun/webpack-stats-report
Generating Webpack Stats Report in HTML Grid
https://github.com/cenfun/webpack-stats-report
grid report stats webpack webpack-plugin
Last synced: about 1 year ago
JSON representation
Generating Webpack Stats Report in HTML Grid
- Host: GitHub
- URL: https://github.com/cenfun/webpack-stats-report
- Owner: cenfun
- License: mit
- Created: 2020-04-16T09:32:56.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-31T04:21:26.000Z (over 2 years ago)
- Last Synced: 2024-10-18T08:39:30.520Z (over 1 year ago)
- Topics: grid, report, stats, webpack, webpack-plugin
- Language: JavaScript
- Homepage: https://cenfun.github.io/webpack-stats-report/
- Size: 4.79 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Webpack Stats Report
> Generating [Webpack](https://github.com/webpack/webpack) [Stats](https://webpack.js.org/api/stats/) Report in HTML Grid.


## Preview Example Reports
* [stats-report-wsr.html](https://cenfun.github.io/webpack-stats-report/stats-report-wsr.html)
* [stats-report-test.html](https://cenfun.github.io/webpack-stats-report/stats-report-test.html)
## Install
```sh
npm i webpack-stats-report -D
```
## Usage
### As a webpack plugin
```js
// 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
```js
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
```js
//default options
{
title: "Stats Report",
output: "stats-report.html",
outputStatsJson: false,
gzipSize: false
...
}
```
more details: [options.js](lib/options.js)
## Test
```sh
npm run test
```
see [test/test.js](test/test.js)
## Changelog
see [CHANGELOG.md](CHANGELOG.md)