File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,8 @@ export interface TSInternal {
90
90
host : _ts . ModuleResolutionHost ,
91
91
cache ?: _ts . ModuleResolutionCache ,
92
92
redirectedReference ?: _ts . ResolvedProjectReference ,
93
- lookupConfig ?: boolean
93
+ conditionsOrIsConfigLookup ?: string [ ] | boolean , // `conditions` parameter added in TS 5.3
94
+ isConfigLookup ?: boolean
94
95
) : _ts . ResolvedModuleWithFailedLookupLocations ;
95
96
// Added in TS 4.7
96
97
getModeForFileReference ?: (
Original file line number Diff line number Diff line change 1
1
import { isAbsolute , resolve } from 'path' ;
2
- import { cachedLookup , normalizeSlashes } from './util' ;
2
+ import { cachedLookup , normalizeSlashes , versionGteLt } from './util' ;
3
3
import type * as _ts from 'typescript' ;
4
4
import type { TSCommon , TSInternal } from './ts-compiler-types' ;
5
5
@@ -40,14 +40,16 @@ function createTsInternalsUncached(_ts: TSCommon) {
40
40
return extendedConfigPath ;
41
41
}
42
42
// If the path isn't a rooted or relative path, resolve like a module
43
+ const tsGte5_3_0 = versionGteLt ( ts . version , '5.3.0' ) ;
43
44
const resolved = ts . nodeModuleNameResolver (
44
45
extendedConfig ,
45
46
combinePaths ( basePath , 'tsconfig.json' ) ,
46
47
{ moduleResolution : ts . ModuleResolutionKind . NodeJs } ,
47
48
host ,
48
49
/*cache*/ undefined ,
49
50
/*projectRefs*/ undefined ,
50
- /*lookupConfig*/ true
51
+ /*conditionsOrIsConfigLookup*/ tsGte5_3_0 ? undefined : true ,
52
+ /*isConfigLookup*/ tsGte5_3_0 ? true : undefined
51
53
) ;
52
54
if ( resolved . resolvedModule ) {
53
55
return resolved . resolvedModule . resolvedFileName ;
You can’t perform that action at this time.
0 commit comments