• Version 11.1.4
  • Published
  • 35.6 kB
  • 7 dependencies
  • MIT license


npm i size-limit
yarn add size-limit
pnpm add size-limit


CLI tool for Size Limit



function sizeLimitAPI

sizeLimitAPI: (
plugins: AnyFunction[],
files: string[] | object
) => Promise<object>;
  • Run Size Limit and return the result.

    Parameter plugins

    The list of plugins like @size-limit/time

    Parameter files

    Path to files or internal config Project size


interface Check

interface Check {}
  • Represents the options for the size-limit check.

property brotli

brotli?: boolean;
  • With false it will disable any compression.

property compareWith

compareWith?: string;
  • Path to stats.json from another build to compare (when --why is using).

property config

config?: string;
  • A path to a custom webpack config.

property disableModuleConcatenation

disableModuleConcatenation?: boolean;

    property entry

    entry?: string | string[];
    • When using a custom webpack config, a webpack entry could be given. It could be a string or an array of strings. By default, the total size of all entry points will be checked.

    property gzip

    gzip?: boolean;
    • With true it will use Gzip compression and disable Brotli compression.

    property hidePassed

    hidePassed?: boolean;

      property highlightLess

      highlightLess?: boolean;

        property ignore

        ignore?: string[];
        • An array of files and dependencies to exclude from the project size calculation.

        property import

        import?: string | Record<string, string>;
        • Partial import to test tree-shaking. It could be "{ lib }" to test import { lib } from 'lib', * to test all exports, or { "a.js": "{ a }", "b.js": "{ b }" } to test multiple files.

        property limit

        limit?: string;
        • Size or time limit for files from the path option. It should be a string with a number and unit, separated by a space. Format: 100 B, 10 kB, 500 ms, 1 s.

        property modifyEsbuildConfig

        modifyEsbuildConfig?: (config?: any) => any;

          property modifyWebpackConfig

          modifyWebpackConfig?: (config?: any) => any;
          • (.size-limit.js only) Function that can be used to do last-minute changes to the webpack config, like adding a plugin.

          property module

          module?: boolean;

            property name

            name?: string;
            • The name of the current section. It will only be useful if you have multiple sections.

            property path

            path: string | string[];
            • Relative paths to files. The only mandatory option. It could be a path "index.js", a "dist/app-*.js" or an array ["index.js", "dist/app-*.js", "!dist/app-exclude.js"].

            property running

            running?: boolean;
            • With false it will disable calculating running time.

            property uiReports

            uiReports?: object;
            • Custom UI reports list.

              See Also

            property webpack

            webpack?: boolean;
            • With false it will disable webpack.

            Type Aliases

            type SizeLimitConfig

            type SizeLimitConfig = Check[];

              Package Files (1)

              Dependencies (7)

              Dev Dependencies (0)

              No dev dependencies.

              Peer Dependencies (0)

              No peer dependencies.


              To add a badge like this badgeto your package's README, use the codes available below.

              You may also use to create a custom badge linking to

              • Markdown
              • HTML
                <a href=""><img src="" alt=""></a>