# next-size

> **Next-size** is a next.js plugin to **print browser assets sizes** when running `next build`.

Latest version **2.1.0** (published 2019-10-25) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install next-size
pnpm add next-size
yarn add next-size
bun add next-size
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2019-10-25 |
| First published | 2018-11-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | lucleray |
| Maintainers | lucleray |

## Links

- npm: https://www.npmjs.com/package/next-size
- npm.io page: https://npm.io/package/next-size

## Dependencies (1)

- [chalk](https://npm.io/package/chalk.md) ^2.4.2

## Recent versions

- 2.1.0 (latest) — 2019-10-25
- 2.0.2 — 2019-02-21
- 2.0.1 — 2019-01-25
- 2.0.0 — 2019-01-25
- 1.0.1 — 2018-11-07
- 1.0.0 — 2018-11-07
- 0.0.1 — 2018-11-07

## README

# next-size

**Next-size** is a next.js plugin to **print browser assets sizes** when running `next build`.

<div align="center">
<img  width="600px" alt="browser assets sizes appear magically when running next build ✨" src="demo.png" />
</div>

> 🎁 Check out the [**example folder**](example) folder if you want to try `next-size` (the example includes css and dynamic imports).

### Installation

```
yarn add next-size --dev
```

### Usage

Edit your next configuration and wrap you config with `withSize`.

```js
// next.config.js
const withSize = require('next-size')

module.exports = withSize()
```

The size of the assets created will be showed when you run `next-build`

### Options

You can specify `printRawSize` to print raw asset sizes instead of gzipped sizes.

```js
// next.config.js
const withSize = require('next-size')

module.exports = withSize({
  size: {
    printRawSize: true
  }
})
```

### More

Inspired by :

- create-react-app's [FileSizeReporter](https://github.com/facebook/create-react-app/blob/master/packages/react-dev-utils/FileSizeReporter.js)
- [size-plugin](https://github.com/GoogleChromeLabs/size-plugin) by @developit

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