1. esbuild-jest
Jest plugin to use esbuild for transformation
esbuild-jest
Package: esbuild-jest
Created by: aelbore
Last modified: Sun, 01 May 2022 11:49:14 GMT
Version: 0.5.0
License: MIT
Downloads: 686,630
Repository: https://github.com/aelbore/esbuild-jest

Install

npm install esbuild-jest
yarn add esbuild-jest

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

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin