You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been looking into using esbuild with jest. There is a plugin on npm, put that uses rollup and rollup-plugin-esbuild which I think is unnecessary. I have been able to create a custom transformer for jest, but it is currently slower than using babel-jest, one of the reasons is probably that I'm using buildSync, saving that to a tmp file and reading it back. Would it be possible to allow returning the js directly like transform is doing? Or am I missing something here? :)
(I have also played with using transformSync, but that will return an error: SyntaxError: Cannot use import statement outside a module)
The text was updated successfully, but these errors were encountered:
It looks like the feature you're asking for is sort of ES6-to-CommonJS conversion for transformSync, which is a duplicate of #109. Keep in mind that this might have a similar performance profile to buildSync because the synchronous APIs both involve starting a new child process every time.
Have you done performance tests with the current transformSync API vs. babel-jest? It could very well be the case that babel-jest is already faster than transformSync for your use case even without ES6-to-CommonJS conversion, in which case this feature request wouldn't help you.
I have been looking into using esbuild with jest. There is a plugin on npm, put that uses rollup and rollup-plugin-esbuild which I think is unnecessary. I have been able to create a custom transformer for jest, but it is currently slower than using babel-jest, one of the reasons is probably that I'm using buildSync, saving that to a tmp file and reading it back. Would it be possible to allow returning the js directly like transform is doing? Or am I missing something here? :)
(I have also played with using transformSync, but that will return an error:
SyntaxError: Cannot use import statement outside a module
)The text was updated successfully, but these errors were encountered: