esbuild-jest

Jest plugin to use esbuild for transformation

MIT 19 个版本
安装
npm install esbuild-jest
yarn add esbuild-jest
pnpm add esbuild-jest
bun add esbuild-jest
README

esbuild-jest

A Jest transformer using esbuild

With this transformer you can use and transform (ts, js, tsx and jsx) files

npm build status

Install

npm install --save-dev esbuild-jest esbuild

Setting up Jest config file

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

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

Setting up Jest config file with transformOptions

export interface Options {
  jsxFactory?: string
  jsxFragment?: string
  sourcemap?: boolean | 'inline' | 'external'
  loaders?: {
    [ext: string]: Loader
  },
  target?: string
  format?: string
}
{
  "transform": {
    "^.+\\.tsx?$": [ 
      "esbuild-jest", 
      { 
        sourcemap: true,
        loaders: {
          '.spec.ts': 'tsx'
        }
      } 
    ]
  }
}
版本列表
0.5.0-beta.2 2021-02-20
0.5.0-beta.1 2021-02-19
0.5.0 2021-02-22
0.4.0-beta.1 2021-01-31
0.4.0 2021-02-06
0.3.0-beta.2 2020-12-03
0.3.0-beta.1 2020-11-28
0.3.0-beta.0 2020-10-14
0.3.0 2020-12-03
0.2.2 2020-08-04
0.2.1 2020-08-03
0.2.0-beta.2 2020-07-07
0.2.0-beta.1 2020-07-07
0.2.0 2020-07-07
0.1.3 2020-07-04
0.1.2 2020-06-23
0.1.1 2020-05-24
0.1.0 2020-05-24
0.0.1 2020-05-23