aelbore / esbuild-jest

A Jest transformer using esbuild
519 stars 51 forks source link

Fix loaders extension parsing #53

Open gavinsharp opened 3 years ago

gavinsharp commented 3 years ago

Fixes https://github.com/aelbore/esbuild-jest/issues/52.

The first commit (320216a9c22f2f0d603c01024e52b6181f992f35) refactors the logic for determining the ESBuild config into a separate helper, and introduces some basic tests for it (no behaviour change).

The second commit (93c7f1018d83d268ea4ddda5edf72c573d239316) makes a behaviour change to eliminate the custom getExt helper in favour of using path.extname.

I'm worried I'm missing the original rationale for the custom helper, so let me know if there is an expected case that this new code doesn't handle!