https://github.com/spencermountain/rollup-plugin-filesize-check
Rollup plugin to ensure your build is approx the right size
https://github.com/spencermountain/rollup-plugin-filesize-check
Last synced: 2 months ago
JSON representation
Rollup plugin to ensure your build is approx the right size
- Host: GitHub
- URL: https://github.com/spencermountain/rollup-plugin-filesize-check
- Owner: spencermountain
- Created: 2020-01-23T12:54:37.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-24T03:30:17.000Z (7 months ago)
- Last Synced: 2025-02-04T03:51:14.011Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
a small [rollup](https://rollupjs.org) plugin to ensure your build is approx the expected filesize.

`npm i rollup-plugin-filesize-check --save-dev`
then in rollup config:
```js
import sizeCheck from 'rollup-plugin-filesize-check'export default [
{
input: 'src/index.js',
output: [{ file: 'builds/out.js', format: 'umd' }],
plugins: [
sizeCheck({
expect: 95, // sizes in kb
warn: 5 // acceptable diff (+/-)
})
]
}
]
```looks best with `rollup -c --silent` flag
## Options
- **expect ** (optional): the size, in kilobytes, you expect the builds to be
* **warn ** (optional): a difference (+/-), in kilobytes, that like to be warned of (with red text)
## See also
- [rollup-plugin-filesize](https://github.com/ritz078/rollup-plugin-filesize) by ritz078
- [rollup-plugin-sizes](https://github.com/tivac/rollup-plugin-sizes) by tivacMIT