TypeScript · Modules
rewriteRelativeImportExtensions
Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files.
Syntax
"rewriteRelativeImportExtensions": trueExample
Example
{
"compilerOptions": {
"rewriteRelativeImportExtensions": true
}
}More in this group
Learn this in the course
Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.