Bundle file size analyzer.
Install @block65/bundlesize using npm or pnpm:
npm install @block65/bundlesize
or
pnpm add @block65/bundlesize -D
Create a bundlesize.config.js
configuration file specifying files to analyze and their maximum sizes.
Example configuration file:
module.exports = {
files: [
{
path: 'dist/*.js',
maxSize: '100 KB',
compression: 'brotli'
},
{
path: 'dist/vendor.js',
maxSize: '500 KB'
},
],
};
NOTE: Maximum sizes are in base 10.
To analyze bundle sizes, run:
npx @block65/bundlesize
or
pnpx @block65/bundlesize
@block65/bundlesize is MIT licensed. See LICENSE.md for details.