@epilot/esbuild-jest
TypeScript icon, indicating that this package has built-in type declarations

0.5.2 • Public • Published

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'
        }
      } 
    ]
  }
}

Note: if you are using tsconfig.json and jsconfig.json with "paths", Please look alias-hq and there documentation https://github.com/davestewart/alias-hq/blob/master/docs/integrations.md

Readme

Keywords

Package Sidebar

Install

npm i @epilot/esbuild-jest

Weekly Downloads

333

Version

0.5.2

License

MIT

Unpacked Size

10.7 kB

Total Files

6

Last publish

Collaborators

  • aleksandr.lapushkin
  • manikandan.subramanian
  • jakub.duras.epilot
  • mp-polarsquad
  • mateus.nardo
  • diogo.f.marques
  • praneetro
  • epilot-keremnalbant
  • rossepilot
  • kate.astrid
  • juan.villamizar
  • j.carneiro
  • sebas.sauer
  • wmolinari
  • vladcrishan
  • alexmarqs
  • mohammadjd
  • julian01
  • daniel-bot.epilot
  • a.kedia
  • sureshkumars
  • dusty48
  • paulo.henriques
  • mohannad7
  • epilot-dev-tools
  • nishugoel
  • sumanth.kanakala
  • anttiviljami
  • j.pinho