File tree Expand file tree Collapse file tree
packages/core/module-name-resolver/qualifier-matcher Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,20 +119,21 @@ const supportedQualifiers: Array<QualifierSpec> = [minWidthHeightQualifier, minW
119119
120120function checkQualifiers ( path : string , context : PlatformContext ) : number {
121121 let result = 0 ;
122+ let value : number ;
122123 for ( let i = 0 ; i < supportedQualifiers . length ; i ++ ) {
123124 const qualifier = supportedQualifiers [ i ] ;
124125 if ( qualifier . isMatch ( path ) ) {
125126 const occurences = qualifier . getMatchOccurences ( path ) ;
126127 // 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 ) {
129130 // Non of the supported qualifiers matched this or the match was not satisfied
130131 return - 1 ;
131132 }
132133
133- result += ( supportedQualifiers . length - i ) * PRIORITY_STEP ;
134-
135- return result ;
134+ if ( value > 0 ) {
135+ result += value + ( supportedQualifiers . length - i ) * PRIORITY_STEP ;
136+ }
136137 }
137138 }
138139
You can’t perform that action at this time.
0 commit comments