Open kelly-tock opened 2 years ago
One workaround we have is to add a wrapper transformer on top to inject the emotion pragma:
const { createTransformer } = require('esbuild-jest')
const emotionPragma = `const { jsx: emotionJsx } = require('@emotion/core')`
const transformer = createTransformer({
jsxFactory: 'emotionJsx',
})
module.exports = {
process(src, filename, jestOptions) {
const { code, map } = transformer.process(src, filename, jestOptions)
return {
code: `${emotionPragma};${code}`,
map,
}
},
}
https://github.com/evanw/esbuild/issues/832#issuecomment-1021663564
repeated here for consistency:
with this setup still getting:
jest config:
react-shim.js
any ideas?