next-size
Next-size is a next.js plugin to print browser assets sizes when running next build
.
🎁 Check out the example folder 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
.
// next.config.jsconst withSize = moduleexports =
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.
// next.config.jsconst withSize = moduleexports =
More
Inspired by :
- create-react-app's FileSizeReporter
- size-plugin by @developit