or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

index.md
tile.json

tessl/npm-size-limit--preset-big-lib

Size Limit preset for big open source libraries

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/@size-limit/preset-big-lib@11.2.x

To install, run

npx @tessl/cli install tessl/npm-size-limit--preset-big-lib@11.2.0

index.mddocs/

Size Limit Preset for Big Libraries

Size Limit preset for big open source libraries (> 10 kB) that combines webpack, file, and time plugins to provide comprehensive performance monitoring including tracking the time of JavaScript download and execution for the library and all its dependencies.

Package Information

  • Package Name: @size-limit/preset-big-lib
  • Package Type: npm
  • Language: JavaScript (ES Module)
  • Installation: npm install @size-limit/preset-big-lib
  • Peer Dependencies: size-limit@11.2.0

Core Imports

import preset from "@size-limit/preset-big-lib";

For CommonJS (if supported by bundler):

const preset = require("@size-limit/preset-big-lib");

Package.json access:

import packageJson from "@size-limit/preset-big-lib/package.json";

Basic Usage

This preset is designed to be used with Size Limit configuration. It provides a pre-configured combination of plugins for comprehensive performance monitoring of large libraries.

// size-limit.config.js
import preset from "@size-limit/preset-big-lib";

export default [
  {
    name: "My Big Library",
    path: "dist/index.js",
    plugins: preset,
    limit: "50 kB"
  }
];

Or in package.json:

{
  "size-limit": [
    {
      "name": "My Big Library", 
      "path": "dist/index.js",
      "plugins": ["@size-limit/preset-big-lib"],
      "limit": "50 kB"
    }
  ]
}

Architecture

This preset combines three Size Limit plugins:

  • @size-limit/webpack: Provides webpack bundling analysis for accurate dependency tracking
  • @size-limit/file: Measures the actual file size of the bundled output
  • @size-limit/time: Measures JavaScript download and execution time

The preset exports these plugins as a combined array, making it easy to apply comprehensive performance monitoring to large libraries without manual plugin configuration.

Capabilities

Preset Configuration

The main and only export of this package - a combined array of Size Limit plugins optimized for big libraries.

/**
 * Size Limit preset combining webpack, file, and time plugins
 * Exports: [...webpack, ...file, ...time]
 */
export default Array<SizeLimitPlugin>;

interface SizeLimitPlugin {
  // Internal Size Limit plugin interface
  // Specific structure depends on Size Limit implementation
}

Usage:

The preset is used by importing it and applying it to Size Limit configuration. When applied, it provides:

  1. Webpack bundling analysis - Analyzes the library and all its dependencies through webpack
  2. File size measurement - Tracks the actual file size of the bundled output
  3. Execution time measurement - Measures JavaScript download and execution time

Configuration Example:

import preset from "@size-limit/preset-big-lib";

// Apply to Size Limit configuration
const config = [
  {
    name: "Main Bundle",
    path: "dist/main.js", 
    plugins: preset, // Uses the combined plugin array
    limit: "100 kB"
  }
];

Dependencies

This preset includes the following Size Limit plugins as dependencies:

  • @size-limit/webpack@11.2.0 - Webpack bundling analysis plugin
  • @size-limit/file@11.2.0 - File size measurement plugin
  • @size-limit/time@11.2.0 - JavaScript execution time measurement plugin
  • size-limit@11.2.0 - Core Size Limit library (also required as peer dependency)

The preset simply re-exports these plugins in a combined array format, providing a convenient way to apply comprehensive performance monitoring to large libraries without manually configuring individual plugins.