https://github.com/lucleray/next-size
Next.js plugin to print browser assets sizes
https://github.com/lucleray/next-size
bundle-size next next-plugins nextjs size
Last synced: about 1 year ago
JSON representation
Next.js plugin to print browser assets sizes
- Host: GitHub
- URL: https://github.com/lucleray/next-size
- Owner: lucleray
- Created: 2018-11-07T19:07:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-03T10:39:23.000Z (over 3 years ago)
- Last Synced: 2025-04-22T15:59:56.828Z (about 1 year ago)
- Topics: bundle-size, next, next-plugins, nextjs, size
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/next-size
- Size: 601 KB
- Stars: 40
- Watchers: 3
- Forks: 1
- Open Issues: 15
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
> ⚠️ This package has been deprecated because it can slow down your builds. Upgrade to Next.js 9+ to get [Build Output Statistics](https://nextjs.org/blog/next-9#build-output-statistics) out-of-the-box.
# next-size
**Next-size** is a next.js plugin to **print browser assets sizes** when running `next build`.
> 🎁 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