microsoft / microsoft/TypeScript
rewriteRelativeImportExtensions does not rewrite the extension for an import expressions unless the file is detected to be a module
Open
@andrewbranch is already working on this.
Since Nov 28, 2024.
Needs Investigation
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
🔎 Search Terms
rewriteRelativeImportExtensions, import expression
🕗 Version & Regression Information
- This changed between versions 5.7
⏯ Playground Link
💻 Code
Test One
import('./foo.ts')
Test Two
import './foo.ts';
import('./foo.ts')
🙁 Actual behavior
JS Output
Test One
import('./foo.ts') // ❌
Test Two
import './foo.js'; // ✅
import('./foo.js') // ✅
🙂 Expected behavior
JS Output
Test One
import('./foo.js') // ✅
Test Two
import './foo.js'; // ✅
import('./foo.js') // ✅
Additional information about the issue
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.