{"library":"size-limit","title":"Size Limit CLI Tool","description":"Size Limit is a performance budget command-line interface (CLI) tool for JavaScript projects, designed to prevent web performance regressions. It integrates into CI/CD pipelines (like GitHub Actions, Travis CI, Circle CI) to automatically check bundle size against predefined limits on every commit or pull request. The tool supports ES modules and tree-shaking, providing modular plugins to adapt to various project setups, from large applications to small npm libraries. Rather than just raw bytes, it can calculate the estimated download and execution time for end-users, incorporating all dependencies and polyfills. The current stable version is 12.1.0, with an active release cadence involving frequent patch and minor updates, and major versions released as necessary for breaking changes or significant feature additions.","language":"javascript","status":"active","last_verified":"Wed Apr 22","install":{"commands":["npm install size-limit"],"cli":{"name":"size-limit","version":null}},"imports":["import { type Config } from 'size-limit'","import { run } from 'size-limit/run'","import { createReporter } from 'size-limit/create-reporter'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"/* .size-limit.js */\n/** @type {import('size-limit').Config} */\nmodule.exports = [\n  {\n    path: 'dist/main.js',\n    limit: '10 kB',\n    name: 'Main Bundle'\n  },\n  {\n    path: 'dist/*.css',\n    limit: '2 kB',\n    name: 'CSS Stylesheets'\n  },\n  {\n    path: ['dist/vendor.js', 'dist/utils.js'],\n    limit: '5 kB',\n    webpack: false, // For non-webpack bundles\n    gzip: true\n  }\n];\n\n// To run Size Limit after setting up the config:\n// npx size-limit","lang":"javascript","description":"Demonstrates a basic `.size-limit.js` configuration file to define bundle size limits for multiple files or patterns, and how to execute the tool via `npx`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}