Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support returning js and jsSourceMap in build? #183

Closed
eigilsagafos opened this issue Jun 18, 2020 · 3 comments
Closed

Support returning js and jsSourceMap in build? #183

eigilsagafos opened this issue Jun 18, 2020 · 3 comments

Comments

@eigilsagafos
Copy link

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)

@evanw
Copy link
Owner

evanw commented Jun 18, 2020

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.

@evanw
Copy link
Owner

evanw commented Jun 22, 2020

The original request (build returning the output files) is a duplicate of #139, so I'm going to close this issue as a duplicate of that one.

@evanw evanw closed this as completed Jun 22, 2020
@eigilsagafos
Copy link
Author

Thanks @evanw. I'll follow the other two issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants