# @alloc/esbuild-jest

> Jest plugin to use esbuild for transformation

Latest version **0.3.6** (published 2021-04-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @alloc/esbuild-jest
pnpm add @alloc/esbuild-jest
yarn add @alloc/esbuild-jest
bun add @alloc/esbuild-jest
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.6 |
| Published | 2021-04-11 |
| First published | 2021-01-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Arjay Elbore |
| Maintainers | aleclarson |
| Keywords | esbuild, jest, test |

## Links

- npm: https://www.npmjs.com/package/@alloc/esbuild-jest
- Repository: https://github.com/aleclarson/esbuild-jest
- Homepage: https://github.com/aleclarson/esbuild-jest#readme
- Issues: https://github.com/aelbore/esbuild-jest/issues
- npm.io page: https://npm.io/package/@alloc/esbuild-jest

## Dependencies (1)

- [nebu](https://npm.io/package/nebu.md) ^2.2.1

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 0.3.6 (latest) — 2021-04-11
- 0.4.0-0 (next) — 2021-05-04
- 0.3.5 — 2021-02-24
- 0.3.4 — 2021-02-24
- 0.3.3 — 2021-01-29
- 0.3.2 — 2021-01-29
- 0.3.1 — 2021-01-29
- 0.3.0 — 2021-01-28

## README

# esbuild-jest

[![npm](https://img.shields.io/npm/v/@alloc/esbuild-jest.svg)](https://www.npmjs.com/package/@alloc/esbuild-jest)
[![Code style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/alecdotbiz)

> Jest transformer with [`esbuild`](https://github.com/evanw/esbuild/) speed

This is a fork of [`esbuild-jest`](https://github.com/aelbore/esbuild-jest) with the following added features:

- Sourcemaps enabled by default
- Strict mode enabled for modules
- Hoisted `jest.mock` calls with [nebu](https://github.com/alloc/nebu)

## Install

```bash
yarn add esbuild-jest@npm:@alloc/esbuild-jest esbuild -D
```

#### Setting up Jest config file

esbuild-jest transformer should be used in your Jest config file like this:

```js
{
  "transform": {
    "^.+\\.tsx?$": "esbuild-jest"
  }
}
```

#### Setting up Jest config file with transformOptions

```typescript
export interface Options {
  jsxFactory?: string
  jsxFragment?: string
  loaders?: {
    [ext: string]: Loader
  }
  target?: string
}
```

```js
{
  "transform": {
    "^.+\\.tsx?$": [
      "esbuild-jest",
      {
        loaders: {
          '.spec.ts': 'tsx'
        }
      }
    ]
  }
}
```

---
_Source: https://npm.io/package/@alloc/esbuild-jest · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
