sizemometer

A library for monitoring your bundle sizes

Usage no npm install needed!

<script type="module">
  import sizemometer from 'https://cdn.skypack.dev/sizemometer';
</script>

README

Sizemometer

npm version Build Status

Monitoring for your front end assets. Gives you nice graphs to track the size of your files over time.

Setting up

Install the package:

npm install -S sizemometer

Set up a config file at .sizemometer/config.js in the root of your project.

module.exports = {
  title: 'Your project name',
  trackedFiles: ['dist/bundle.js', 'main-*.js'],
  commitIgnorePattern: 'Update dependency',
  theme: {
    accentColor: '#BADA55'
  },
  repositoryUrl: 'https://github.com/chardos/sizemometer'
}
Property Description Types
title Displayed in app header string
trackedFiles Files to take snapshots of. Supports globbing. array
commitIgnorePattern When this matches your latest commit message, no new snapshot will be taken string, regex
theme.accentColor Changes the color of the bars string

Using sizemometer

To take your first snapshot, run:

npx sizemometer add

Then to view the report:

npx sizemometer report

API

import { add } from 'sizemometer';

await add({currentHistory});