@@ -43,33 +43,40 @@ function parseTypeScriptConfiguration(
43
43
function getDependenciesFromTypeScriptConfiguration (
44
44
typescript : typeof ts ,
45
45
parsedConfiguration : ts . ParsedCommandLine ,
46
+ configFileContext : string ,
46
47
parseConfigFileHost : ts . ParseConfigFileHost ,
47
48
processedConfigFiles : string [ ] = [ ]
48
49
) : FilesMatch {
49
50
const files = new Set < string > ( parsedConfiguration . fileNames ) ;
50
- if ( typeof parsedConfiguration . options . configFilePath === 'string' ) {
51
- files . add ( parsedConfiguration . options . configFilePath ) ;
51
+ const configFilePath = parsedConfiguration . options . configFilePath ;
52
+ if ( typeof configFilePath === 'string' ) {
53
+ files . add ( configFilePath ) ;
52
54
}
53
55
const dirs = new Set ( Object . keys ( parsedConfiguration . wildcardDirectories || { } ) ) ;
56
+ const excluded = new Set < string > (
57
+ ( parsedConfiguration . raw ?. exclude || [ ] ) . map ( ( path : string ) => resolve ( configFileContext , path ) )
58
+ ) ;
54
59
55
60
for ( const projectReference of parsedConfiguration . projectReferences || [ ] ) {
56
- const configFile = typescript . resolveProjectReferencePath ( projectReference ) ;
57
- if ( processedConfigFiles . includes ( configFile ) ) {
61
+ const childConfigFilePath = typescript . resolveProjectReferencePath ( projectReference ) ;
62
+ const childConfigContext = dirname ( childConfigFilePath ) ;
63
+ if ( processedConfigFiles . includes ( childConfigFilePath ) ) {
58
64
// handle circular dependencies
59
65
continue ;
60
66
}
61
- const parsedConfiguration = parseTypeScriptConfiguration (
67
+ const childParsedConfiguration = parseTypeScriptConfiguration (
62
68
typescript ,
63
- configFile ,
64
- dirname ( configFile ) ,
69
+ childConfigFilePath ,
70
+ childConfigContext ,
65
71
{ } ,
66
72
parseConfigFileHost
67
73
) ;
68
74
const childDependencies = getDependenciesFromTypeScriptConfiguration (
69
75
typescript ,
70
- parsedConfiguration ,
76
+ childParsedConfiguration ,
77
+ childConfigContext ,
71
78
parseConfigFileHost ,
72
- [ ...processedConfigFiles , configFile ]
79
+ [ ...processedConfigFiles , childConfigFilePath ]
73
80
) ;
74
81
childDependencies . files . forEach ( ( file ) => {
75
82
files . add ( file ) ;
@@ -90,6 +97,7 @@ function getDependenciesFromTypeScriptConfiguration(
90
97
return {
91
98
files : Array . from ( files ) . map ( ( file ) => normalize ( file ) ) ,
92
99
dirs : Array . from ( dirs ) . map ( ( dir ) => normalize ( dir ) ) ,
100
+ excluded : Array . from ( excluded ) . map ( ( path ) => normalize ( path ) ) ,
93
101
extensions : extensions ,
94
102
} ;
95
103
}
@@ -198,6 +206,7 @@ function getArtifactsFromTypeScriptConfiguration(
198
206
return {
199
207
files : Array . from ( files ) . map ( ( file ) => normalize ( file ) ) ,
200
208
dirs : Array . from ( dirs ) . map ( ( dir ) => normalize ( dir ) ) ,
209
+ excluded : [ ] ,
201
210
extensions,
202
211
} ;
203
212
}
0 commit comments