@@ -24,7 +24,7 @@ import type {
24
24
import FederationRuntimePlugin from '../container/runtime/FederationRuntimePlugin' ;
25
25
import { createSchemaValidation } from '../../utils' ;
26
26
import path from 'path' ;
27
- const { satisfy } = require (
27
+ const { satisfy, parseRange } = require (
28
28
normalizeWebpackPath ( 'webpack/lib/util/semver' ) ,
29
29
) as typeof import ( 'webpack/lib/util/semver' ) ;
30
30
import {
@@ -489,7 +489,7 @@ class ProvideSharedPlugin {
489
489
let versionIncludeFailed = false ;
490
490
if ( typeof config . include . version === 'string' ) {
491
491
if ( typeof version === 'string' && version ) {
492
- if ( ! satisfy ( version , config . include . version ) ) {
492
+ if ( ! satisfy ( parseRange ( config . include . version ) , version ) ) {
493
493
versionIncludeFailed = true ;
494
494
}
495
495
} else {
@@ -544,7 +544,7 @@ class ProvideSharedPlugin {
544
544
typeof version === 'string' &&
545
545
version
546
546
) {
547
- if ( satisfy ( version , config . exclude . version ) ) {
547
+ if ( satisfy ( parseRange ( config . exclude . version ) , version ) ) {
548
548
versionExcludeMatches = true ;
549
549
}
550
550
}
@@ -706,7 +706,7 @@ class ProvideSharedPlugin {
706
706
let versionIncludeFailed = false ;
707
707
if ( typeof config . include . version === 'string' ) {
708
708
if ( typeof version === 'string' && version ) {
709
- if ( ! satisfy ( version , config . include . version ) ) {
709
+ if ( ! satisfy ( parseRange ( config . include . version ) , version ) ) {
710
710
versionIncludeFailed = true ;
711
711
}
712
712
} else {
@@ -764,7 +764,7 @@ class ProvideSharedPlugin {
764
764
typeof version === 'string' &&
765
765
version
766
766
) {
767
- if ( satisfy ( version , config . exclude . version ) ) {
767
+ if ( satisfy ( parseRange ( config . exclude . version ) , version ) ) {
768
768
versionExcludeMatches = true ;
769
769
}
770
770
}
@@ -834,7 +834,7 @@ class ProvideSharedPlugin {
834
834
if ( config . include ?. version ) {
835
835
const includeVersion = config . include . version ;
836
836
if ( typeof includeVersion === 'string' ) {
837
- if ( ! satisfy ( version , includeVersion ) ) {
837
+ if ( ! satisfy ( parseRange ( includeVersion ) , version ) ) {
838
838
return false ; // Skip providing this module
839
839
}
840
840
}
@@ -844,7 +844,7 @@ class ProvideSharedPlugin {
844
844
if ( config . exclude ?. version ) {
845
845
const excludeVersion = config . exclude . version ;
846
846
if ( typeof excludeVersion === 'string' ) {
847
- if ( satisfy ( version , excludeVersion ) ) {
847
+ if ( satisfy ( parseRange ( excludeVersion ) , version ) ) {
848
848
return false ; // Skip providing this module
849
849
}
850
850
}
0 commit comments