File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,17 @@ export function parseConfig(
75
75
return
76
76
}
77
77
78
+ if ( parsedConfig ! . raw . include ) {
79
+ parsedConfig ! . raw . include = parsedConfig ! . raw . include . map ( ( includePath : string ) => {
80
+ return includePath . replace ( '${configDir}/' , '' )
81
+ } )
82
+ }
83
+ if ( parsedConfig ! . raw . exclude ) {
84
+ parsedConfig ! . raw . exclude = parsedConfig ! . raw . exclude . map ( ( excludePath : string ) => {
85
+ return excludePath . replace ( '${configDir}/' , '' )
86
+ } )
87
+ }
88
+
78
89
return parsedConfig
79
90
}
80
91
Original file line number Diff line number Diff line change @@ -37,4 +37,18 @@ test.group('Helpers | Parse config', () => {
37
37
const result = parseConfig ( fs . baseUrl , ts )
38
38
assert . deepEqual ( result ?. fileNames , [ string . toUnixSlash ( join ( fs . basePath , 'foo.ts' ) ) ] )
39
39
} )
40
+
41
+ test ( 'parse tsconfig file using ${configDir} variable to point to the root dir' , async ( {
42
+ assert,
43
+ fs,
44
+ } ) => {
45
+ await fs . createJson ( 'tsconfig.json' , {
46
+ include : [ '${configDir}/**/*' , '${configDir}/.adonisjs/server/**/*' ] ,
47
+ } )
48
+ await fs . create ( 'foo.ts' , '' )
49
+
50
+ const result = parseConfig ( fs . baseUrl , ts )
51
+ assert . deepEqual ( result ?. fileNames , [ string . toUnixSlash ( join ( fs . basePath , 'foo.ts' ) ) ] )
52
+ assert . deepEqual ( result ?. raw . include , [ '**/*' , '.adonisjs/server/**/*' ] )
53
+ } )
40
54
} )
You can’t perform that action at this time.
0 commit comments