0.4.0 • Published 5 years ago
build-size v0.4.0
build-size
Parse and compare build size
Install
Install locally with npm:
$ npm install --save-dev build-sizeInstall globally with npm:
$ npm install --global build-sizeBasic usage
Locally with npm:
# Display help
$ npm run build-size -- --help
# Parse
$ npm run build-size -- parse ./previous/**/*.js ./previous/**/*.css > previous.json
$ npm run build-size -- parse ./new/**/*.js ./new/**/*.css > new.json
# Compare
$ npm run build-size -- compare previous.json new.jsonGlobally:
# Display help
$ build-size --help
# Parse
$ build-size parse ./previous/**/*.js ./previous/**/*.css > previous.json
$ build-size parse ./new/**/*.js ./new/**/*.css > new.json
# Compare
$ build-size compare previous.json new.jsonExample output
Parse:
$ build-size parse js/*.js css/*.css{
"js/app.js": 133104,
"js/manifest.js": 1478,
"js/vendor.js": 466292,
"css/app.css": 24491
}Compare:
$ build-size compare previous.json new.jsonThis change will increase the build size from 610.71 KB to 616.04 KB, an increase of 5.33 KB \(1%\)
File name | Previous size | New size | Change
--- | --- | --- | ---
js\/app.js | 129.98 KB | 135.32 KB |  5.33 KB \(4%\)
js\/manifest.js | 1.44 KB | 1.45 KB |  2 B \(0%\)
js\/vendor.js | 455.36 KB | 455.36 KB | 0 B \(0%\)
css\/app.css | 23.92 KB | 23.92 KB | 0 B \(0%\)Testing
$ npm testContributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email security@swis.nl instead of using the issue tracker.
Credits
Inspired by BuildSize and similar projects, such as bundlesize and Size Limit.
License
The MIT License (MIT). Please see License File for more information.
SWIS
SWIS is a web agency from Leiden, the Netherlands. We love working with open source software.