esbuild-jest
esbuild-jest copied to clipboard
feat: support esbuild options
Problem
Current implementation:
- does not support all esbuild options
- reimplements some esbuild types
Solution
- Support esbuild options to be passed thru, so users can use more esbuild APIs to suit their needs
- Dedupe types
- Update docs
Discussion
- the project has prettier in it, my editor picked it up, ...and ran it 😬 . hopefully that's ok? i didn't mean to send a bulk change, but ...editors... and prettier
-
yarn test
outside of CI yields:
$ jest --clearCache && jest --detectOpenHandles
Cleared /private/var/folders/b2/_t0w_hyn6jz28xm301k2qp81c9b83j/T/jest_okufzl
jest-haste-map: Haste module naming collision: esbuild-jest
The following files share their name; please adjust your hasteImpl:
* <rootDir>/package.json
* <rootDir>/dist/package.json
this is because the build step symlinks the dist folder. there's certainly ways around that, but FYI, I had to test like CI tests :)
@cdaringe thanks for the PR, it would be good if you could add tests for this PR, to make sure it will not break.
Would this support the inject
option? I need it to inject a JSX tranformer global h
into every transformed module as outlined here. Not sure if there are other ways to achieve this.
Ya, @silverwind , iirc it should. Feel free to pick up the PR. I hit a roadblock with esbuild, thus probably won't be pursuing this further
Not really interested, sorry. I ended up writing my own jest transformer in place of this module (it's actually trivial) but am blocked by jest's ESM bugs currently to proceed.
For anyone investigating: This approach is unlikely to be able to support build-only options like inject
since it still uses only the transformSync
API.
@aelbore
So how is it going, esbuild-jest
is dead?