npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@justinribeiro/rollup-plugin-asset-build-size-compare

v1.2.1

Published

Track asset build sizes and compare over time with Rollup.

Readme

npm version

rollup-plugin-asset-build-size-compare

Track asset build sizes and compare over time with Rollup. A opinionated and modified version of Wes's rollup-plugin-size, which was the rollup port of Jason's webpack size-plugin

Features

  • Allows tracking build asset sizes, in either gzip, brotli, or no compression at all (don't ship your stuff that way!)
  • Sets more sane compression defaults based on
  • Allows setting custom compression targets to better match your web server compression settings (additional information as to why)
  • Writes a file to disk for easy tracking of size over time (e.g., .rollup-plugin-asset-build-size-compare-data-${options.compression}.json)
  • Color codes asset file sizes in out (red > 75kB, yellow > 40kB, cyan > 20kB, green < 20kB) to remind you that performance matters (and you should care)
  • v1.2.0 Add hashPattern option to allow removal of hash from file name for easier compares.

Installation

Install justinribeiro@/rollup-plugin-asset-build-size-compare as a development dependency from NPM:

npm i -D justinribeiro@/rollup-plugin-asset-build-size-compare
# or
yarn add justinribeiro@/rollup-plugin-asset-build-size-compare --dev

Quick Start

Add the plugin to your rollup configuration:

// rollup.config.js
+ import size from '@justinribeiro/rollup-plugin-asset-build-size-compare';

plugins: [
+   size()
]

For first time run, you'll get and initial set of sizes:

An initial run of the plugin

For additional runs, you'll get the change in those sizes (or no change in the example case as we did not edit anything):

A second run, showing no change in size

Options

You can set various options within the plugin.

size({
  compression: 'brotli',
  compressionLevel: 6,
  pattern: '**/*.{mjs,js,jsx,css,html}',
  exclude: 'vendor/**',
  filename: '.rollup-plugin-asset-build-size-compare-data-brotli.json',
  writeFile: true,
  columnWidth: 20,
  hashPattern: '^(.*)(.{10})(\.[^.]+)$',
});

| Option | Description | Default | | ------------------------ | -------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | compression | The compression algorithm to run on the build assets. One of 'none', 'gzip', or 'brotli'. | 'gzip' | | compressionLevel | Compression level to use for gzip (range: 1–9) or brotli (range: 1–11) | 6 | | pattern | Minimatch pattern to include files from the build assets. | '**/*.{mjs,js,jsx,css,html}' | | exclude | Minimatch pattern to exclude files from the build assets. | undefined | | filename | The file name to write asset size data to disk. Supports template string ${options.compression}. | '.rollup-plugin-asset-build-size-compare-data-${options.compression}.json' | | writeFile | Whether to write the asset size data file to disk. | true | | columnWidth | The number of characters used for column width in console output. | 20 | | hashPattern | A three group match pattern (filename, hash, extension) to remove hashes from build files | `` |

License

Apache 2.0