# webpack-html-stats-plugin

> Generate a static HTML report from webpack stats during build

Latest version **1.1.1** (published 2019-07-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install webpack-html-stats-plugin
pnpm add webpack-html-stats-plugin
yarn add webpack-html-stats-plugin
bun add webpack-html-stats-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2019-07-12 |
| First published | 2018-08-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 234.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mathieu Maes |
| Maintainers | mathieumaes |
| Keywords | webpack |

## Links

- npm: https://www.npmjs.com/package/webpack-html-stats-plugin
- Repository: https://github.com/webberig/webpack-html-stats-plugin
- Homepage: https://github.com/webberig/webpack-html-stats-plugin#readme
- Issues: https://github.com/webberig/webpack-html-stats-plugin/issues
- npm.io page: https://npm.io/package/webpack-html-stats-plugin

## Dependencies (2)

- [twig](https://npm.io/package/twig.md) ^1.12.0
- [pretty-bytes](https://npm.io/package/pretty-bytes.md) ^5.1.0

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2019-07-12
- 1.1.0 — 2018-08-21
- 1.0.2 — 2018-08-19
- 1.0.1 — 2018-08-19
- 1.0.0 — 2018-08-19

## README

Webpack HTML Stats Plugin
==========================

[![Build Status](https://travis-ci.org/webberig/webpack-html-stats-plugin.svg?branch=master)](https://travis-ci.org/webberig/webpack-html-stats-plugin)

This plugin will generate an HTML report using the Webpack stats object.

The result should be similar to that of [webpack analyse](http://webpack.github.io/analyse/)
with the difference that you don't need to upload/select your `stats.json` 
file. The report is made of static HTML files that you can easily publish for your team
to review, or help you optimize your bundles.

Browse a sample report: https://webberig.github.io/webpack-html-stats-plugin/

## Installation

The plugin is available via [npm](https://www.npmjs.com/package/webpack-html-stats-plugin):

```
$ npm install --save-dev webpack-html-stats-plugin
$ yarn add --dev webpack-html-stats-plugin
```

Add the plugin to your `webpack.config.js`:

```js
const { HtmlStatsPlugin } = require("webpack-html-stats-plugin")

module.exports = {
  plugins: [
    new HtmlStatsPlugin()
  ]
}
```

## How it works

Every time a webpack build is triggered, the report will be generated in 
the `/webpackReport` folder inside your project.

Hot reloading is easily achieved if you use [live-server](http://tapiov.net/live-server/)
to serve the report.


## Contributions

Contributions welcome! The current report being generated is somewhat crude
and lacks much information.

#### Todo's

- [ ] Add tests
- [ ] Properly define webpack version (currently tested on webpack 4.16)
- [ ] Add more information about chunks, modules, assets
- [ ] Implement a build stack for JS and CSS
- [ ] CLI support
- [ ] Configuration options (ie. target location)
- [ ] Add size analysis graphs

---
_Source: https://npm.io/package/webpack-html-stats-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
