# @chuyik/webpack-stats-diff

> CLI tool to report changes in bundle sizes across builds

Latest version **1.6.3** (published 2021-03-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @chuyik/webpack-stats-diff
pnpm add @chuyik/webpack-stats-diff
yarn add @chuyik/webpack-stats-diff
bun add @chuyik/webpack-stats-diff
```

Provides the command `webpack-stats-diff`.

## 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.6.3 |
| Published | 2021-03-15 |
| First published | 2021-03-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.11.5 |
| Dependencies | 3 |
| Unpacked size | 19.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Edward Chu |
| Maintainers | chuyik |
| Keywords | cli, webpack, stats |

## Links

- npm: https://www.npmjs.com/package/@chuyik/webpack-stats-diff
- Repository: https://github.com/chuyik/webpack-stats-diff
- Homepage: https://github.com/chuyik/webpack-stats-diff#readme
- Issues: https://github.com/chuyik/webpack-stats-diff/issues
- npm.io page: https://npm.io/package/@chuyik/webpack-stats-diff

## Dependencies (3)

- [chalk](https://npm.io/package/chalk.md) ^2
- [table](https://npm.io/package/table.md) ^6.0.7
- [commander](https://npm.io/package/commander.md) ^7.1.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.6.3 (latest) — 2021-03-15
- 1.6.2 — 2021-03-15
- 1.6.1 — 2021-03-14
- 1.6.0 — 2021-03-14
- 1.5.0 — 2021-03-12
- 1.4.0 — 2021-03-09

## README

# webpack-stats-diff

A command-line tool to report changes in bundle sizes across builds.

## The problem

You just made changes to your webpack config or your source files and you want to know how bundle sizes were impacted.

## The solution

Use this tool to see how much the total built file size has changed and see the breakdown for what files were added or removed as well as what files increased or decreased in size.

## Installation & Usage

Install with `npm install -g webpack-stats-diff`

To compare your bundle sizes before and after, you'll need to configure webpack to save a stats file. This can be done by either adding a script to your package.json similar to `build_stats: webpack mode=production --json > stats.json` or by adding [webpack-stats-plugin](https://github.com/FormidableLabs/webpack-stats-plugin) into your plugins list.

For example, to compare the bundle sizes between branches, you could save the master build stats to a file `master.json` and the branch build stats to `my-branch.json` and run

```bash
webpack-stats-diff master.json my-branch.json
# options
# [--type terminal|markdown|wechat-work]
# [--extensions js,jsx]
# [--threshold 5]
```

![terminal showing the result of running the command](demo-screenshot.png)

## Other Solutions

* [webpack-compare](https://github.com/Southpaw17/webpack-compare) instead generates an HTML file to display the comparison, but it doesn't include totals or filtering options.

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