{"id":21229,"library":"esbuild-jest","title":"esbuild-jest","description":"Jest transformer that uses esbuild for fast compilation of TypeScript, JavaScript, TSX, and JSX files. Current stable version is 0.5.0. Released as needed, with esbuild >=0.8.50 as peer dependency. Differentiators: significantly faster than ts-jest by leveraging esbuild's speed, but lacks type checking and some advanced TypeScript features. Ships TypeScript types.","status":"active","version":"0.5.0","language":"javascript","source_language":"en","source_url":"https://github.com/aelbore/esbuild-jest","tags":["javascript","esbuild","jest","test","typescript"],"install":[{"cmd":"npm install esbuild-jest","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-jest","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-jest","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required peer dependency for transformation","package":"esbuild","optional":false}],"imports":[{"note":"Default export is the transformer function. Only named exports are Options types.","symbol":"default export (transformer)","correct":"import esbuildJest from 'esbuild-jest'"},{"note":"Options is a TypeScript type, not a value. Use type import.","wrong":"import { Options } from 'esbuild-jest' (runtime error, type-only)","symbol":"Options interface","correct":"import type { Options } from 'esbuild-jest'"},{"note":"CommonJS require returns the transformer directly, not under default.","wrong":"const { default } = require('esbuild-jest')","symbol":"require with CreateTransformerOptions?","correct":"const transformer = require('esbuild-jest')"}],"quickstart":{"code":"// jest.config.js\nmodule.exports = {\n  transform: {\n    '^.+\\\\.(t|j)sx?$': ['esbuild-jest', { sourcemap: true }]\n  }\n};\n\n// your.test.ts\nimport { sum } from './sum';\ntest('adds 1 + 2 to equal 3', () => {\n  expect(sum(1, 2)).toBe(3);\n});","lang":"javascript","description":"Shows minimal Jest config using esbuild-jest transformer with sourcemap option and a basic test."},"warnings":[{"fix":"Run tsc --noEmit separately or use a type-checked alternative like ts-jest.","message":"esbuild-jest does not perform type checking, only transpilation.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Switch to @swc/jest or ts-jest.","message":"esbuild-jest is not maintained as actively as alternatives; consider @swc/jest or ts-jest for production.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Migrate to @swc/jest or ts-jest.","message":"The package is no longer actively maintained.","severity":"deprecated","affected_versions":">=0.5.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"npm install --save-dev esbuild-jest esbuild","cause":"esbuild-jest not installed or esbuild peer dependency missing.","error":"Cannot find module 'esbuild-jest' from 'jest.config.js'"},{"fix":"Use default import for transformer: import esbuildJest from 'esbuild-jest'","cause":"Using named import Options as a function.","error":"TypeError: esbuildJest is not a function"},{"fix":"Update regex to '^.+\\\\.(t|j)sx?$' in jest config","cause":"Transform regex does not match .tsx files.","error":"Jest encountered an unexpected token (tsx file)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}