# @microsoft/webpack-stats-report

> A library for generating a markdown report for a bundle stats diff.

Latest version **2.4.1** (published 2025-09-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @microsoft/webpack-stats-report
pnpm add @microsoft/webpack-stats-report
yarn add @microsoft/webpack-stats-report
bun add @microsoft/webpack-stats-report
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.4.1 |
| Published | 2025-09-29 |
| First published | 2021-08-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 19.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Maintainers | vincentbailly, bweggersen, microsoft1es, kenotron_msft |

## Links

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

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [@microsoft/webpack-stats-differ](https://npm.io/package/@microsoft/webpack-stats-differ.md) *

## Recent versions

- 2.4.1 (latest) — 2025-09-29
- 2.4.0 — 2025-09-26
- 2.3.0 — 2025-07-23
- 2.2.0 — 2025-07-17
- 2.0.0 — 2025-05-21
- 1.2.7 — 2025-04-30
- 1.2.6 — 2025-03-20
- 1.2.5 — 2024-06-26
- 1.2.4 — 2024-06-26
- 1.2.3 — 2024-06-26
- 1.2.2 — 2024-04-08
- 1.2.1 — 2023-12-12
- 1.2.0 — 2023-10-03
- 1.1.4 — 2023-09-14
- 1.1.3 — 2023-08-23
- … 7 more at https://npm.io/package/@microsoft/webpack-stats-report/versions

## README

# webpack-stats-report
A library for generating a markdown report for a bundle stats diff.

## Installation
Using npm:
```sh
npm install @microsoft/webpack-stats-report
```
Using Yarn:
```sh
yarn add @microsoft/webpack-stats-report
```

## Usage
```typescript
import { createReport, getAppName } from "@microsoft/webpack-stats-report";
import { diff } from "@microsoft/webpack-stats-differ";
import * as path from "path";
import * as fs from "fs";

const baselineDir = path.resolve('/baseline');
const candidateDir = path.resolve('/candidate');

const diffResult = await diff(baselineDirUnzipped,candidateDir);

const report = createReport(diffResult);
const appName = getAppName(path.resolve('myAwesomeApp_default.json'));
```
# API

## createReport() function

Generates a bundle size report from webpack bundle stats diff

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  bundleStatsResults | [FileDiffResults](https://github.com/microsoft/ardiffact/blob/68e27505a9f7f97334592676bbd43b827f53c552/docs/webpack-stats-differ.filediffresults.md) | Diff results created by [FileDiffResults](https://github.com/microsoft/ardiffact/blob/68e27505a9f7f97334592676bbd43b827f53c552/docs/webpack-stats-differ.filediffresults.md) object |
|  minimumIncrease | number | number indicating the smallest increase in bytes that must be reported |

<b>Returns:</b>

string

markdown report

## getAppName() function

Returns the app name from webpack bundle stats filepath

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  filePath | string | path to webpack bundle stats file |

<b>Returns:</b>

string

- App name from stat filepath  


# Contributing

This project welcomes contributions and suggestions. Most contributions require you to
agree to a Contributor License Agreement (CLA) declaring that you have the right to,
and actually do, grant us the rights to use your contribution. For details, visit
https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need
to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the
instructions provided by the bot. You will only need to do this once across all repositories using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

# License

MIT

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