When using native ESM, extensions like .js or .jsx are required for TypeScript with "moduleResolution": "Node16".
For example: export * from './component.jsx' should try './component.tsx', this PR just drop the file extension and try all possible extensions, if you want behavior more spec compliantly, resolveFile must be refactored a lot AFAIK.
Considering .tsx can also be compiled as .js, I think this PR's behavior is good enough.
When using native ESM, extensions like
.js
or.jsx
are required forTypeScript
with"moduleResolution": "Node16"
.For example:
export * from './component.jsx'
should try'./component.tsx'
, this PR just drop the file extension and try all possible extensions, if you want behavior more spec compliantly,resolveFile
must be refactored a lot AFAIK.Considering
.tsx
can also be compiled as.js
, I think this PR's behavior is good enough.cc @egoist