File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
packages/core/module-name-resolver/qualifier-matcher Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -119,20 +119,21 @@ const supportedQualifiers: Array<QualifierSpec> = [minWidthHeightQualifier, minW
119
119
120
120
function checkQualifiers ( path : string , context : PlatformContext ) : number {
121
121
let result = 0 ;
122
+ let value : number ;
122
123
for ( let i = 0 ; i < supportedQualifiers . length ; i ++ ) {
123
124
const qualifier = supportedQualifiers [ i ] ;
124
125
if ( qualifier . isMatch ( path ) ) {
125
126
const occurences = qualifier . getMatchOccurences ( path ) ;
126
127
// Always get the last qualifier among identical occurences
127
- result = qualifier . getMatchValue ( occurences [ occurences . length - 1 ] , context ) ;
128
- if ( result < 0 ) {
128
+ value = qualifier . getMatchValue ( occurences [ occurences . length - 1 ] , context ) ;
129
+ if ( value < 0 ) {
129
130
// Non of the supported qualifiers matched this or the match was not satisfied
130
131
return - 1 ;
131
132
}
132
133
133
- result += ( supportedQualifiers . length - i ) * PRIORITY_STEP ;
134
-
135
- return result ;
134
+ if ( value > 0 ) {
135
+ result += value + ( supportedQualifiers . length - i ) * PRIORITY_STEP ;
136
+ }
136
137
}
137
138
}
138
139
You can’t perform that action at this time.
0 commit comments