@@ -481,9 +481,13 @@ class ConsumeSharedPlugin {
481
481
}
482
482
const { context, request, contextInfo } = resolveData ;
483
483
484
- const match = unresolvedConsumes . get (
485
- createLookupKeyForSharing ( request , contextInfo . issuerLayer ) ,
486
- ) ;
484
+ const match =
485
+ unresolvedConsumes . get (
486
+ createLookupKeyForSharing ( request , contextInfo . issuerLayer ) ,
487
+ ) ||
488
+ unresolvedConsumes . get (
489
+ createLookupKeyForSharing ( request , undefined ) ,
490
+ ) ;
487
491
488
492
// First check direct match with original request
489
493
if ( match !== undefined ) {
@@ -511,12 +515,19 @@ class ConsumeSharedPlugin {
511
515
512
516
// Try to match with module path after node_modules
513
517
if ( modulePathAfterNodeModules ) {
514
- const moduleMatch = unresolvedConsumes . get (
515
- createLookupKeyForSharing (
516
- modulePathAfterNodeModules ,
517
- contextInfo . issuerLayer ,
518
- ) ,
519
- ) ;
518
+ const moduleMatch =
519
+ unresolvedConsumes . get (
520
+ createLookupKeyForSharing (
521
+ modulePathAfterNodeModules ,
522
+ contextInfo . issuerLayer ,
523
+ ) ,
524
+ ) ||
525
+ unresolvedConsumes . get (
526
+ createLookupKeyForSharing (
527
+ modulePathAfterNodeModules ,
528
+ undefined ,
529
+ ) ,
530
+ ) ;
520
531
521
532
if (
522
533
moduleMatch !== undefined &&
@@ -532,12 +543,16 @@ class ConsumeSharedPlugin {
532
543
}
533
544
534
545
// Try to match with the full reconstructed path
535
- const reconstructedMatch = unresolvedConsumes . get (
536
- createLookupKeyForSharing (
537
- reconstructed ,
538
- contextInfo . issuerLayer ,
539
- ) ,
540
- ) ;
546
+ const reconstructedMatch =
547
+ unresolvedConsumes . get (
548
+ createLookupKeyForSharing (
549
+ reconstructed ,
550
+ contextInfo . issuerLayer ,
551
+ ) ,
552
+ ) ||
553
+ unresolvedConsumes . get (
554
+ createLookupKeyForSharing ( reconstructed , undefined ) ,
555
+ ) ;
541
556
542
557
if ( reconstructedMatch !== undefined ) {
543
558
return boundCreateConsumeSharedModule (
0 commit comments