Closed
Description
This is not an issue, because the input was already wrong.
If you really want to workaround this, see #5151 (comment)
Note that this is not an official one, and it will break frequently.
jest
not working with ESM is not an issue of swc. See jestjs/jest#9430
common js vs ESM behavior
Technically this can be workarounded by SWC by compiling in a wrong way.
But ESM is an established standard, and swc follows the specification. If you use ESM as input, swc will compile the code to behave in a way defined by the specification.
You may claim the official typescript compiler does not follow specification if module type is common js, but it's a bug of tsc
. If you want behavior of common js, you can write a common js module instead.
Discussions
Issues
Metadata
Metadata
Assignees
Labels
No labels