{"id":26394,"library":"size-limit-node-esbuild","title":"size-limit-node-esbuild","description":"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.","status":"active","version":"0.4.0","language":"javascript","source_language":"en","source_url":"https://github.com/un-ts/size-limit","tags":["javascript","typescript"],"install":[{"cmd":"npm install size-limit-node-esbuild","lang":"bash","label":"npm"},{"cmd":"yarn add size-limit-node-esbuild","lang":"bash","label":"yarn"},{"cmd":"pnpm add size-limit-node-esbuild","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for plugin to function","package":"size-limit","optional":false}],"imports":[{"note":"ESM-only since v0.3.0; CommonJS require will fail with ERR_REQUIRE_ESM.","wrong":"const sizeLimitNodeEsbuild = require('size-limit-node-esbuild')","symbol":"default","correct":"import sizeLimitNodeEsbuild from 'size-limit-node-esbuild'"},{"note":"Default export only; named export does not exist.","wrong":"import { sizeLimitNodeEsbuild } from 'size-limit-node-esbuild'","symbol":"sizeLimitNodeEsbuild","correct":"import sizeLimitNodeEsbuild from 'size-limit-node-esbuild'"},{"note":"Types are available when using TypeScript, imported as a type.","wrong":null,"symbol":"type SizeLimitNodeEsbuildOptions","correct":"import type { SizeLimitNodeEsbuildOptions } from 'size-limit-node-esbuild'"}],"quickstart":{"code":"// Install: pnpm add -D size-limit @size-limit/preset-app size-limit-node-esbuild\n// size-limit.config.js\nimport sizeLimitNodeEsbuild from 'size-limit-node-esbuild';\n\nexport default [\n  {\n    path: \"dist/index.js\",\n    plugin: [sizeLimitNodeEsbuild],\n    limit: \"10 KB\",\n  },\n];\n\n// Run: npx size-limit","lang":"javascript","description":"Shows how to configure size-limit with the esbuild plugin to check a Node bundle size."},"warnings":[{"fix":"Use ES module imports (import) or switch to dynamic import().","message":"v0.3.0 migrated to ESM only, breaking CommonJS require()","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Upgrade size-limit to v11 or later.","message":"v0.4.0 bumped size-limit peer dependency to v11, breaking compatibility with older size-limit versions","severity":"breaking","affected_versions":">=0.4.0"},{"fix":"Use size-limit v8 or later, or stick with size-limit-node-esbuild@0.1.x.","message":"v0.2.0 upgraded to size-limit v8, breaking configurations for v7","severity":"breaking","affected_versions":">=0.2.0 <0.3.0"},{"fix":"","message":"No deprecation warnings known for this package.","severity":"deprecated","affected_versions":""},{"fix":"Use 'plugin' (singular) in the config object, as size-limit expects.","message":"Plugin must be placed in the 'plugin' array of size-limit config, not 'plugins'","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Adjust esbuild options or upgrade to v0.3.1+ which inherits default config properly.","message":"The plugin inherits default esbuild config but may need explicit 'target' for Node version","severity":"gotcha","affected_versions":"<0.3.1"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use import statement or dynamic import(). If using CommonJS, downgrade to v0.2.x or use a dynamic import wrapper.","cause":"Trying to require('size-limit-node-esbuild') with CommonJS after v0.3.0.","error":"ERR_REQUIRE_ESM: require() of ES Module"},{"fix":"Run `pnpm add -D size-limit-node-esbuild` (or npm/yarn equivalent).","cause":"Package not installed or not listed in dependencies.","error":"Cannot find module 'size-limit-node-esbuild'"},{"fix":"Use import sizeLimitNodeEsbuild from 'size-limit-node-esbuild' (default export).","cause":"Plugin exported incorrectly (e.g., import { sizeLimitNodeEsbuild } instead of default import).","error":"Invalid plugin: must be a function or an object with a 'name' property"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}