File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -306,10 +306,12 @@ function getMappedPath(
306306 if ( isJs ) {
307307 const jsExt = path . extname ( source )
308308 const tsExt = jsExt . replace ( 'js' , 'ts' )
309+ const tsxExt = jsExt . replace ( 'js' , 'tsx' )
309310 const basename = source . replace ( JS_EXT_PATTERN , '' )
310311
311312 const resolved =
312313 getMappedPath ( basename + tsExt , file ) ||
314+ getMappedPath ( basename + tsxExt , file ) ||
313315 getMappedPath (
314316 basename + '.d' + ( tsExt === '.tsx' ? '.ts' : tsExt ) ,
315317 file ,
Original file line number Diff line number Diff line change @@ -6,9 +6,13 @@ import './subfolder/tsxImportee'
66
77// import using tsconfig.json path mapping
88import 'folder/tsImportee'
9+ import 'folder/tsImportee.js'
910import 'folder/tsxImportee'
11+ import 'folder/tsxImportee.js'
1012import 'folder/subfolder/tsImportee'
13+ import 'folder/subfolder/tsImportee.js'
1114import 'folder/subfolder/tsxImportee'
15+ import 'folder/subfolder/tsxImportee.js'
1216
1317// import module with typings set in package.json
1418import 'folder/module'
You can’t perform that action at this time.
0 commit comments