Releases: benelan/build-sizes
Releases · benelan/build-sizes
v3.2.2
v3.2.1
v3.2.0
v3.1.0
v3.0.0
Breaking changes
- Deprecated and removed
getFileSizes
function.getFiles
now returns a size property - Need to use the
-f
or--filetype
flag when specifying a main bundle filetype from the CLI (previously was the second CLI argument) - Use base 10 (previously base 2) as the default for converting bytes into a human readable format in the
formatBytes
function. Base 10 is what operating systems use in file explorers
Enhancements
CLI
- Added support for CLI flags instead of passing arguments in a specific order (use the
-h
or--help
flag for usage info) - Added
-d
and--decimals
CLI flags for specifying decimals places when formatting bytes - Added
-b
and--binary
CLI flags for converting bytes to a human readable format in base 2 - Added
-o
and--outfile
CLI flags for saving the build size data to CSV - Log build on-disk size to the console for non-windows machines (uses
du
) - Log compressed main bundle sizes to the console
- Spiffed up the
build-sizes
formatting that is logged to the console
New exported functions
saveBuildSizes
: savesbuild-sizes
data to CSVgetFileSizeGzip
: calculates a file's gzipped size (with zlib defaults)getFileSizeBrotli
: calculates a file's brotli compressed size (with zlib defaults)
New function return properties
mainBundleSizeGzip
(fromgetBuildSizes
): main bundle's gzipped sizemainBundleSizeBrotli
fromgetBuildSizes
): main bundle's brotli compressed sizebuildSizeOnDisk
(fromgetBuildSizes
): build's on-disk size (NaN
on windows since it uses a unix command)size
(fromgetFiles
): file's uncompressed byte size
Fixes
- Use the correct formula for converting bytes to a human readable format in base 10
- The on-disk size was actually byte size. I changed it to "size" and added "on-disk size" for non-window machines
- Some error handling issues are resolved
v2.4.0
Publishing to get the jsdoc on the npm page
Enhancements
- None to the functionality
- Published jsdoc page: https://benelan.github.io/build-sizes/
Misc
- Cleaned up jsdoc syntax
- Removed function reference section from readme