File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 1
1
/node_modules
2
- test /output /*
2
+ test /output /*
3
+ .idea /
Original file line number Diff line number Diff line change @@ -22,9 +22,18 @@ module.exports = function(input, inputMap) {
22
22
var resolve = this . resolve ;
23
23
var addDependency = this . addDependency ;
24
24
var emitWarning = this . emitWarning || function ( ) { } ;
25
- var match = input . match ( regex1 ) || input . match ( regex2 ) ;
25
+
26
+ var match1 = regex1 . exec ( input ) ; // TODO: Take into account multi-occurences too
27
+ var match2 = regex2 . exec ( input ) ; // TODO: Take into account multi-occurences too
28
+
29
+ var match = ( match1 && match1 [ 1 ] ) || ( match2 && match2 [ 1 ] ) ;
30
+
31
+ if ( match1 != null && match2 != null ) {
32
+ match = ( match1 . index > match2 . index ) ? match1 [ 1 ] : match2 [ 1 ] ;
33
+ }
34
+
26
35
if ( match ) {
27
- var url = match [ 1 ] ;
36
+ var url = match ;
28
37
var dataUrlMatch = regexDataUrl . exec ( url ) ;
29
38
var callback = this . async ( ) ;
30
39
if ( dataUrlMatch ) {
You can’t perform that action at this time.
0 commit comments