File tree 2 files changed +6
-0
lines changed
2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -306,10 +306,12 @@ function getMappedPath(
306
306
if ( isJs ) {
307
307
const jsExt = path . extname ( source )
308
308
const tsExt = jsExt . replace ( 'js' , 'ts' )
309
+ const tsxExt = jsExt . replace ( 'js' , 'tsx' )
309
310
const basename = source . replace ( JS_EXT_PATTERN , '' )
310
311
311
312
const resolved =
312
313
getMappedPath ( basename + tsExt , file ) ||
314
+ getMappedPath ( basename + tsxExt , file ) ||
313
315
getMappedPath (
314
316
basename + '.d' + ( tsExt === '.tsx' ? '.ts' : tsExt ) ,
315
317
file ,
Original file line number Diff line number Diff line change @@ -6,9 +6,13 @@ import './subfolder/tsxImportee'
6
6
7
7
// import using tsconfig.json path mapping
8
8
import 'folder/tsImportee'
9
+ import 'folder/tsImportee.js'
9
10
import 'folder/tsxImportee'
11
+ import 'folder/tsxImportee.js'
10
12
import 'folder/subfolder/tsImportee'
13
+ import 'folder/subfolder/tsImportee.js'
11
14
import 'folder/subfolder/tsxImportee'
15
+ import 'folder/subfolder/tsxImportee.js'
12
16
13
17
// import module with typings set in package.json
14
18
import 'folder/module'
You can’t perform that action at this time.
0 commit comments