File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -346,9 +346,9 @@ class Runtime {
346
346
loaded : false ,
347
347
} ;
348
348
moduleRegistry [ modulePath ] = localModule ;
349
- if ( path . extname ( modulePath ) === '.json' ) {
349
+ if ( path . extname ( modulePath . split ( '?' ) [ 0 ] ) === '.json' ) {
350
350
localModule . exports = this . _environment . global . JSON . parse (
351
- stripBOM ( fs . readFileSync ( modulePath , 'utf8' ) ) ,
351
+ stripBOM ( fs . readFileSync ( modulePath . split ( '?' ) [ 0 ] , 'utf8' ) ) ,
352
352
) ;
353
353
} else if (path.extname(modulePath) === '.node') {
354
354
// $FlowFixMe
@@ -422,7 +422,7 @@ class Runtime {
422
422
'__mocks__' ,
423
423
moduleFileName ,
424
424
) ;
425
- if ( fs . existsSync ( potentialManualMock ) ) {
425
+ if ( fs . existsSync ( potentialManualMock . split ( '?' ) [ 0 ] ) ) {
426
426
isManualMock = true ;
427
427
modulePath = potentialManualMock ;
428
428
}
@@ -520,7 +520,7 @@ class Runtime {
520
520
if (
521
521
coveredFiles . has ( sourcePath ) &&
522
522
this . _needsCoverageMapped . has ( sourcePath ) &&
523
- fs . existsSync ( this . _sourceMapRegistry [ sourcePath ] )
523
+ fs . existsSync ( this . _sourceMapRegistry [ sourcePath ] . split ( '?' ) [ 0 ] )
524
524
) {
525
525
result [ sourcePath ] = this . _sourceMapRegistry [ sourcePath ] ;
526
526
}
Original file line number Diff line number Diff line change @@ -299,7 +299,7 @@ export default class ScriptTransformer {
299
299
const isInternalModule = ! ! ( options && options . isInternalModule ) ;
300
300
const isCoreModule = ! ! ( options && options . isCoreModule ) ;
301
301
const content = stripShebang (
302
- fileSource || fs . readFileSync ( filename , 'utf8' ) ,
302
+ fileSource || fs . readFileSync ( filename . split ( '?' ) [ 0 ] , 'utf8' ) ,
303
303
) ;
304
304
305
305
let wrappedCode : string ;
@@ -511,7 +511,7 @@ const readCacheFile = (cachePath: Path): ?string => {
511
511
} ;
512
512
513
513
const getScriptCacheKey = ( filename , instrument : boolean ) => {
514
- const mtime = fs . statSync ( filename ) . mtime ;
514
+ const mtime = fs . statSync ( filename . split ( '?' ) [ 0 ] ) . mtime ;
515
515
return filename + '_' + mtime . getTime ( ) + ( instrument ? '_instrumented' : '' ) ;
516
516
} ;
517
517
You can’t perform that action at this time.
0 commit comments