File tree 1 file changed +3
-1
lines changed
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 1
- import type ts from 'typescript' ;
1
+ import ts from 'typescript' ;
2
2
import { ProjectPrincipal } from './ProjectPrincipal.js' ;
3
3
import type { AsyncCompilers , SyncCompilers } from './compilers/types.js' ;
4
4
import { debugLog } from './util/debug.js' ;
@@ -64,6 +64,7 @@ export class PrincipalFactory {
64
64
const workspacePaths = compilerOptions ?. paths ? Object . keys ( compilerOptions . paths ) : [ ] ;
65
65
const principal = Array . from ( this . principals ) . find ( principal => {
66
66
if ( compilerOptions . pathsBasePath && principal . principal . compilerOptions . pathsBasePath ) return false ;
67
+ if ( compilerOptions . moduleResolution !== principal . principal . compilerOptions . moduleResolution ) return false ;
67
68
if ( compilerOptions . baseUrl === principal . principal . compilerOptions . baseUrl ) {
68
69
return workspacePaths . every ( p => ! principal . pathKeys . has ( p ) ) ;
69
70
}
@@ -81,6 +82,7 @@ export class PrincipalFactory {
81
82
) {
82
83
const { pathsBasePath, paths } = compilerOptions ;
83
84
if ( pathsBasePath ) principal . principal . compilerOptions . pathsBasePath = pathsBasePath ;
85
+ principal . principal . compilerOptions . moduleResolution ??= ts . ModuleResolutionKind . Bundler ;
84
86
for ( const p of Object . keys ( paths ?? { } ) ) principal . pathKeys . add ( p ) ;
85
87
principal . principal . addPaths ( paths ) ;
86
88
principal . principal . addCompilers ( compilers ) ;
You can’t perform that action at this time.
0 commit comments