You can use settable esbuild transform on Jest.
npm install esbuild-jest-transformesbuild jest plugin.
You can set the build options of esbuild by passing them as transform options.
bash
npm install -D esbuild esbuild-jest-transform
`Setup
jest.config.js`json
"transform": {
"^.+\\.[jt]sx?$": "esbuild-jest-transform"
},
`config
jest.config.js`json
"transform": {
"^.+\\.[jt]sx?$": [
"esbuild-jest-transform",
{
"target": "es2015",
}
]
},
``