@@ -166,23 +166,35 @@ export class Transpiler {
166
166
// very complicated logic to re-use TS internal functions to know the output path
167
167
// given a TS input path and its config
168
168
type InternalTsApi = typeof ts & {
169
+ normalizePath ( path : string ) : string ;
169
170
getOutputFileNames ( commandLine : ts . ParsedCommandLine , inputFileName : string , ignoreCase : boolean ) : readonly string [ ] ;
170
171
} ;
171
172
this . _getOutputFileName = ( file ) => {
172
- if ( ! _cmdLine . options . configFilePath ) {
173
- // this is needed for the INTERNAL getOutputFileNames-call below...
174
- _cmdLine . options . configFilePath = configFilePath ;
175
- }
176
- const isDts = file . endsWith ( '.d.ts' ) ;
177
- if ( isDts ) {
178
- file = file . slice ( 0 , - 5 ) + '.ts' ;
179
- _cmdLine . fileNames . push ( file ) ;
180
- }
181
- const outfile = ( < InternalTsApi > ts ) . getOutputFileNames ( _cmdLine , file , true ) [ 0 ] ;
182
- if ( isDts ) {
183
- _cmdLine . fileNames . pop ( ) ;
173
+ try {
174
+
175
+ // windows: path-sep normalizing
176
+ file = ( < InternalTsApi > ts ) . normalizePath ( file ) ;
177
+
178
+ if ( ! _cmdLine . options . configFilePath ) {
179
+ // this is needed for the INTERNAL getOutputFileNames-call below...
180
+ _cmdLine . options . configFilePath = configFilePath ;
181
+ }
182
+ const isDts = file . endsWith ( '.d.ts' ) ;
183
+ if ( isDts ) {
184
+ file = file . slice ( 0 , - 5 ) + '.ts' ;
185
+ _cmdLine . fileNames . push ( file ) ;
186
+ }
187
+ const outfile = ( < InternalTsApi > ts ) . getOutputFileNames ( _cmdLine , file , true ) [ 0 ] ;
188
+ if ( isDts ) {
189
+ _cmdLine . fileNames . pop ( ) ;
190
+ }
191
+ return outfile ;
192
+
193
+ } catch ( err ) {
194
+ console . error ( file , _cmdLine . fileNames ) ;
195
+ console . error ( err ) ;
196
+ throw new err ;
184
197
}
185
- return outfile ;
186
198
} ;
187
199
}
188
200
0 commit comments