@@ -60,21 +60,21 @@ function getLoadersFromObject(element) {
60
60
throw new Error ( "Element from loaders list should have one of the fields 'loader' or 'loaders'" ) ;
61
61
}
62
62
63
- LoadersList . prototype . matchPart = function matchPart ( str , test ) {
63
+ LoadersList . prototype . matchPart = function matchPart ( str , test , context ) {
64
64
if ( ! test ) return true ;
65
65
var matcher = asMatcher ( test ) ;
66
- return matcher ( str ) ;
66
+ return matcher ( str , context ) ;
67
67
} ;
68
68
69
- LoadersList . prototype . match = function match ( str ) {
69
+ LoadersList . prototype . match = function match ( str , context ) {
70
70
return this . list . map ( function ( element ) {
71
71
if ( Array . isArray ( element ) ) {
72
72
for ( var i = 0 ; i < element . length ; i ++ ) {
73
- if ( this . matchObject ( str , element [ i ] ) )
73
+ if ( this . matchObject ( str , element [ i ] , context ) )
74
74
return getLoadersFromObject ( element [ i ] ) ;
75
75
}
76
76
} else {
77
- if ( this . matchObject ( str , element ) )
77
+ if ( this . matchObject ( str , element , context ) )
78
78
return getLoadersFromObject ( element ) ;
79
79
}
80
80
} , this ) . filter ( Boolean ) . reduce ( function ( array , r ) {
@@ -85,12 +85,12 @@ LoadersList.prototype.match = function match(str) {
85
85
} , [ ] ) || [ ] ;
86
86
} ;
87
87
88
- LoadersList . prototype . matchObject = function matchObject ( str , obj ) {
88
+ LoadersList . prototype . matchObject = function matchObject ( str , obj , context ) {
89
89
if ( obj . test )
90
- if ( ! this . matchPart ( str , obj . test ) ) return false ;
90
+ if ( ! this . matchPart ( str , obj . test , context ) ) return false ;
91
91
if ( obj . include )
92
- if ( ! this . matchPart ( str , obj . include ) ) return false ;
92
+ if ( ! this . matchPart ( str , obj . include , context ) ) return false ;
93
93
if ( obj . exclude )
94
- if ( this . matchPart ( str , obj . exclude ) ) return false ;
94
+ if ( this . matchPart ( str , obj . exclude , context ) ) return false ;
95
95
return true ;
96
96
} ;
0 commit comments