Skip to the content.

https://img.shields.io/npm/v/rollup-plugin-summary Commitizen friendly semantic-release https://img.shields.io/github/languages/top/yousifalraheem/rollup-plugin-summary npm bundle size codecov Release

rollup-plugin-summary

A rollup plugin that summarizes the output of the build.

Sample output

Installation


npm

npm i -D rollup-plugin-summary

yarn

yarn add -D rollup-plugin-summary

pnpm

pnpm add -D rollup-plugin-summary

Usage

File: rollup.config.js

import summary from "rollup-plugin-summary";

export default {
  plugins: [summary()],
};

Options

These are the available options:

Name Type Description Default
warnLow? number Minimum size in bytes to be highlighted in yellow.
This is used to warn (in yellow) about the files whom on the brink of exceeding the acceptable pre-defined file size
5000
warnHigh? number Minimum size in bytes to be highlighted in red.
This is used to alert (in red) about files that exceeded the acceptable pre-defined file size
10000
totalLow? number Minimum total size in bytes to be highlighted in yellow.
This is used to warn (in yellow) about the total build size if it comes nearly below maximum acceptable pre-defined size
200000
totalHigh? number Minimum total size in bytes to be highlighted in red.
This is used to alert (in red) about the total build size if it exceeds the acceptable pre-defined size
300000
showBrotliSize? boolean Should calculate and show Brotli size false
showMinifiedSize? boolean Should calculate and show Minified size false
showGzippedSize? boolean Should calculate and show Gipped size false


Here is an example of how it’s used:

{
  plugins: [
    summary({
      warnLow: 1000,
      warnHigh: 3000,
      showMinifiedSize: false,
    }),
  ];
}


Note: File sizes will be evaluated against high values first. For example, if you’ve set warnLow and warnHigh to the same value, the files exceeding that number will be highlighted in red since the warnHigh is prioritized. Same goes for totalLow and totalHigh


License

MIT