@@ -206,15 +206,15 @@ module.exports.transform = function(src, filename, options) {
206
206
; ( { src, filename, options } = src )
207
207
}
208
208
209
- if ( filename . endsWith ( '.ts' ) || filename . endsWith ( '.tsx' ) ) {
209
+ if ( filename . endsWith ( '.ts' ) || filename . endsWith ( '.tsx' ) ) {
210
210
if ( compilerOptions . noEmitOnError ) {
211
211
const program = ts . createProgram ( [ filename ] , compilerOptions )
212
212
213
213
const preErrors = ts
214
214
. getPreEmitDiagnostics ( program )
215
215
. filter ( ( { category } ) => category === ts . DiagnosticCategory . Error )
216
216
217
- reportErrors ( preErrors )
217
+ reportErrors ( preErrors , filename , options )
218
218
}
219
219
220
220
const tsCompileResult = ts . transpileModule ( src , {
@@ -227,7 +227,7 @@ module.exports.transform = function(src, filename, options) {
227
227
( { category } ) => category === ts . DiagnosticCategory . Error
228
228
)
229
229
230
- reportErrors ( errors )
230
+ reportErrors ( errors , filename , options )
231
231
232
232
const babelCompileResult = upstreamTransformer . transform ( {
233
233
src : tsCompileResult . outputText ,
@@ -265,7 +265,7 @@ module.exports.transform = function(src, filename, options) {
265
265
}
266
266
}
267
267
268
- function reportErrors ( errors ) {
268
+ function reportErrors ( errors , filename , options ) {
269
269
if ( errors . length ) {
270
270
// report first error
271
271
const error = errors [ 0 ]
@@ -288,4 +288,4 @@ function reportErrors(errors) {
288
288
throw new Error ( message )
289
289
}
290
290
}
291
- }
291
+ }
0 commit comments