forked from aelbore/esbuild-jest
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Babel transform to handle TS type annotations
The `@babel/plugin-transform-modules-commonjs` transform runs before the esbuild step, which is where TS type annotations are removed. This can cause files that contain typings to fail with errors like: ``` SyntaxError: xxx.ts: Cannot transform the imported binding "XXX" since it's also used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow. ``` This commit ensures that files that are transformed via this Babel plugin have their type annotations removed via the `@babel/preset-typescript` preset beforehand. Fixes aelbore#57
- Loading branch information
1 parent
daa5847
commit 61e3f62
Showing
4 changed files
with
10 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters