TypeScript · Senior · Question 58 of 75
What does rewriteRelativeImportExtensions (TS 5.7) enable?
import { util } from './util.ts'; // emitted as './util.js'- ✓Correct answer: Writing
.tsextensions in relative imports that work both when running TS directly and after compiling to JS - 2Importing CSS files
- 3Removing extensions from all imports
Explanation
It pairs with Node's type stripping: the same source runs directly and also compiles to correct JS imports.