[![npm][npm]][npm-url]
[![bundlewatch][bundlewatch]][bundlewatch-url]
[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors)
[![node][node]][node-url]
![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/npm/bundlewatch)
[![builds][builds]][builds-url]
[![test][test]][test-url]
[![npm-chart][npm-chart]][npm-chart-url]
[![contributors][contrib]][contrib-url]
[![license][license]][license-url]
BundleWatch
BundleWatch checks file sizes, ensuring bundled browser assets don't jump in file size.
Sharp increases in BundleWatch can signal that something is wrong - adding a package that bloats the slug, a wrong import, or forgetting to minify.
Inspired by [Siddharth Kshetrapal bundlesize][bundlesize]
# Getting Started
Install the BundleWatch package:
- NPM: `npm install bundlewatch --save-dev`
- Yarn: `yarn add bundlewatch --dev`
Add some basic configuration to your `package.json`
```json
{
"name": "my package name",
"version": "0.0.1",
"bundlewatch": {
"files": [
{
"path": "myfolder/*.js",
"maxSize": "100kB"
}
]
}
}
```
Usage:
- NPM: `npm run bundlewatch`
- Yarn: `yarn run bundlewatch`
This will give you command line output. If you want BundleWatch to report build status on your pull requests, see below.
# Adding Build Status
BundleWatch can report its status on your GitHub Pull Requests.