Closed karlhorky closed 1 year ago
TypeScript doesn't allow imports to *.jsx
files right?
tsc
allows both:
.jsx
to resolve .tsx
.jsx
to resolve .ts
edit: oh wait, did you mean .js
resolving to .jsx
? ...that doesn't work.
Should we add the other transforms for .jsx
import paths too?
No @ jsx updates β that's ridiculous
Please check out the CI results for the test-tsx
branch βΒ it replicates your original issue and yet the jsx
and tsx
files are loaded correctly regardless of the sourcefile's extension and ESM-vs-CJS format.
Edit: It doesn't replicate your issue at all π lol π΄
Can you actually send over a reproduction using ts-node
? I can get tsc
to not throw errors, but ts-node never actually works or applies any of the resolutions described here or in my updated test files
Can you actually send over a reproduction using
ts-node
?
Sure, here's a Replit: https://replit.com/@karlhorky/SuperbLivelyEditor#index.ts
The start
script runs ts-node-esm index.ts
@lukeed just circling back around to this since I noticed a new version of tsm
was released.
What do you think about getting a fix in for the inconsistency with the .js
fully-specified ESM import paths?
Did some more research on what tsc
and esbuild
supports for extensions over here, also including the latest nodenext
options in tsconfig.json
:
https://github.com/esbuild-kit/tsx/issues/112#issuecomment-1272577698
Nice, tsm@2.3.0
(PR #43) is working, thanks! π
Ref: https://github.com/lukeed/tsm/issues/1#issuecomment-1079169934