File tree 1 file changed +12
-6
lines changed
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -181,14 +181,20 @@ const transformer: Transformer<Options.Typescript> = ({
181
181
dirname ( filename ) ) as string ;
182
182
const tsconfigFile = ( options . tsconfigFile ||
183
183
ts . findConfigFile ( fileDirectory , ts . sys . fileExists ) ) as string ;
184
- basePath = dirname ( tsconfigFile ) ;
185
184
186
- const { error, config } = ts . readConfigFile ( tsconfigFile , ts . sys . readFile ) ;
187
- if ( error ) {
188
- throw new Error ( formatDiagnostics ( error , basePath ) ) ;
189
- }
185
+ if ( tsconfigFile ) {
186
+ basePath = dirname ( tsconfigFile ) ;
187
+
188
+ const { error, config } = ts . readConfigFile (
189
+ tsconfigFile ,
190
+ ts . sys . readFile ,
191
+ ) ;
192
+ if ( error ) {
193
+ throw new Error ( formatDiagnostics ( error , basePath ) ) ;
194
+ }
190
195
191
- Object . assign ( compilerOptionsJSON , config . compilerOptions ) ;
196
+ Object . assign ( compilerOptionsJSON , config . compilerOptions ) ;
197
+ }
192
198
}
193
199
194
200
Object . assign ( compilerOptionsJSON , options . compilerOptions ) ;
You can’t perform that action at this time.
0 commit comments