File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,8 @@ export interface TSInternal {
9090 host : _ts . ModuleResolutionHost ,
9191 cache ?: _ts . ModuleResolutionCache ,
9292 redirectedReference ?: _ts . ResolvedProjectReference ,
93- lookupConfig ?: boolean
93+ conditionsOrIsConfigLookup ?: string [ ] | boolean , // `conditions` parameter added in TS 5.3
94+ isConfigLookup ?: boolean
9495 ) : _ts . ResolvedModuleWithFailedLookupLocations ;
9596 // Added in TS 4.7
9697 getModeForFileReference ?: (
Original file line number Diff line number Diff line change 11import { isAbsolute , resolve } from 'path' ;
2- import { cachedLookup , normalizeSlashes } from './util' ;
2+ import { cachedLookup , normalizeSlashes , versionGteLt } from './util' ;
33import type * as _ts from 'typescript' ;
44import type { TSCommon , TSInternal } from './ts-compiler-types' ;
55
@@ -40,14 +40,16 @@ function createTsInternalsUncached(_ts: TSCommon) {
4040 return extendedConfigPath ;
4141 }
4242 // 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' ) ;
4344 const resolved = ts . nodeModuleNameResolver (
4445 extendedConfig ,
4546 combinePaths ( basePath , 'tsconfig.json' ) ,
4647 { moduleResolution : ts . ModuleResolutionKind . NodeJs } ,
4748 host ,
4849 /*cache*/ undefined ,
4950 /*projectRefs*/ undefined ,
50- /*lookupConfig*/ true
51+ /*conditionsOrIsConfigLookup*/ tsGte5_3_0 ? undefined : true ,
52+ /*isConfigLookup*/ tsGte5_3_0 ? true : undefined
5153 ) ;
5254 if ( resolved . resolvedModule ) {
5355 return resolved . resolvedModule . resolvedFileName ;
You can’t perform that action at this time.
0 commit comments