Skip to content

block65/bundlesize

Repository files navigation

@block65/bundlesize

Bundle file size analyzer.

Installation

Install @block65/bundlesize using npm or pnpm:

npm install @block65/bundlesize

or

pnpm add @block65/bundlesize -D

Usage

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

License

@block65/bundlesize is MIT licensed. See LICENSE.md for details.