Registry / devops / size-limit-node-esbuild

size-limit-node-esbuild

JSON →
library0.4.0jsnpmunverified

Node esbuild plugin for Size Limit, a lightweight tool to measure JavaScript bundle sizes. Current stable version is 0.4.0, released with major bump to size-limit v11. This plugin enables size-limit to process Node.js bundles using esbuild, an extremely fast bundler and minifier. It integrates with size-limit's configuration system and supports ESM and CJS outputs. Key differentiators: leverages esbuild's speed for CI size checks, supports modern Node.js (^12.20.0 || ^14.18.0 || >=16.0.0), ships TypeScript types, and is part of the un-ts/size-limit ecosystem. Release cadence is irregular, with major breaking changes tracking size-limit major updates. Compared to alternatives like webpack or rollup plugins, it offers faster builds for Node-focused targets.

npm install size-limit-node-esbuild
INSTALL
IMPORT
SIG · SIZE-LIMIT-NODE-ES
S
size-limit-node-esbuild
devopsjavascriptv0.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import sizeLimitNodeEsbuild from 'size-limit-node-esbuild'
const sizeLimitNodeEsbuild = require('size-limit-node-esbuild')
ESM-only since v0.3.0; CommonJS require will fail with ERR_REQUIRE_ESM.
sizeLimitNodeEsbuild
import sizeLimitNodeEsbuild from 'size-limit-node-esbuild'
import { sizeLimitNodeEsbuild } from 'size-limit-node-esbuild'
Default export only; named export does not exist.
type SizeLimitNodeEsbuildOptions
import type { SizeLimitNodeEsbuildOptions } from 'size-limit-node-esbuild'
Types are available when using TypeScript, imported as a type.

Shows how to configure size-limit with the esbuild plugin to check a Node bundle size.

// Install: pnpm add -D size-limit @size-limit/preset-app size-limit-node-esbuild // size-limit.config.js import sizeLimitNodeEsbuild from 'size-limit-node-esbuild'; export default [ { path: "dist/index.js", plugin: [sizeLimitNodeEsbuild], limit: "10 KB", }, ]; // Run: npx size-limit
size-limit --version
Debug
Known issues
breakingv0.3.0 migrated to ESM only, breaking CommonJS require()
fix
Use ES module imports (import) or switch to dynamic import().
affects: >=0.3.0
breakingv0.4.0 bumped size-limit peer dependency to v11, breaking compatibility with older size-limit versions
fix
Upgrade size-limit to v11 or later.
affects: >=0.4.0
breakingv0.2.0 upgraded to size-limit v8, breaking configurations for v7
fix
Use size-limit v8 or later, or stick with size-limit-node-esbuild@0.1.x.
affects: >=0.2.0 <0.3.0
deprecatedNo deprecation warnings known for this package.
gotchaPlugin must be placed in the 'plugin' array of size-limit config, not 'plugins'
fix
Use 'plugin' (singular) in the config object, as size-limit expects.
affects: >=0.1.0
gotchaThe plugin inherits default esbuild config but may need explicit 'target' for Node version
fix
Adjust esbuild options or upgrade to v0.3.1+ which inherits default config properly.
affects: <0.3.1
Errors
Common errors & fixes
ERR_REQUIRE_ESM: require() of ES Module
Trying to require('size-limit-node-esbuild') with CommonJS after v0.3.0.
fix
Use import statement or dynamic import(). If using CommonJS, downgrade to v0.2.x or use a dynamic import wrapper.
Cannot find module 'size-limit-node-esbuild'
Package not installed or not listed in dependencies.
fix
Run `pnpm add -D size-limit-node-esbuild` (or npm/yarn equivalent).
Invalid plugin: must be a function or an object with a 'name' property
Plugin exported incorrectly (e.g., import { sizeLimitNodeEsbuild } instead of default import).
fix
Use import sizeLimitNodeEsbuild from 'size-limit-node-esbuild' (default export).
Upgrade
Version history
0.4.0latest on npm
Audit
Dependencies
size-limitrequiredpeer dependency required for plugin to function
Agent activity
9 hits · last 30 days
node
6
Amazon
1
OpenAI (training)
1
Resources
size-limit-node-esbuild — npm install size-limit-node-esbuild · libregistry