hannoeru / jest-esbuild

A Jest esbuild transformer
MIT License
18 stars 7 forks source link

Invalid option in transform() call: "inject" #3

Open cmolina opened 2 years ago

cmolina commented 2 years ago

When I have this configuration with inject:

// jest.config.js
module.exports = {
  transform: {
    '^.+\\.tsx?$': ['jest-esbuild', { inject: ['react-shim.js'] }],
  },
}

it fails with this error:

$ jest
Transform failed with 1 error:
    /Users/cmolina/my-app/node_modules/jest-esbuild/node_modules/esbuild/lib/main.js:256:12: error: Invalid option in transform() call: "inject"
cmolina commented 2 years ago

Although I can't use inject, I was able to use jsx: 'automatic', which has the same effect.