Import assertions with swc enabled #1810
-
I am having difficulty using import assertions with ts-node when swc is enabled. Import assertions work just fine when swc is disabled, but not when swc is enabled. Import assertions seem to be behind a config flag for swc per swc-project/swc#2802.
but I can't find any way to set importAssertions to true. I can see that ts-node creates its own swcconfig from the tsconfig here and I don't really see anyway to override or add to these options. Am I missing something? Should this be enabled by default? I would be happy to move this to a new issue or create a pr if that would be more appropriate. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Looks like you've found a bug, thanks for reporting. Not only do we need to specify I'm guessing that's why this bug exists, because SWC didn't support this when we first added support. I've created a bug to track #1817, and I already have a PR in progress to fix #1802. Thanks again for reporting this. |
Beta Was this translation helpful? Give feedback.
Looks like you've found a bug, thanks for reporting. Not only do we need to specify
importAssertions
, but swc also requiresexperimental: {keepImportAssertions: true}
I'm guessing that's why this bug exists, because SWC didn't support this when we first added support.
I've created a bug to track #1817, and I already have a PR in progress to fix #1802. Thanks again for reporting this.