File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
test/moduleTestCases/urls Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -114,19 +114,16 @@ module.exports = function(content, map) {
114114 if ( ! stuff . urls [ idx ] ) return str ;
115115 var urlItem = stuff . urls [ idx ] ;
116116 var url = urlItem . url ;
117- if ( ! moduleMode && ! loaderUtils . isUrlRequest ( url , root ) )
117+ if ( ! loaderUtils . isUrlRequest ( url , root ) )
118118 return toEmbStr ( urlItem . raw ) ;
119119 idx = url . indexOf ( "?#" ) ;
120120 if ( idx < 0 ) idx = url . indexOf ( "#" ) ;
121121 var urlRequest ;
122- if ( idx > 0 ) {
122+ if ( idx > 0 ) { // idx === 0 is catched by isUrlRequest
123123 // in cases like url('webfont.eot?#iefix')
124124 urlRequest = url . substr ( 0 , idx ) ;
125125 if ( ! moduleMode ) urlRequest = loaderUtils . urlToRequest ( urlRequest , root ) ;
126126 return "\"+require(" + loaderUtils . stringifyRequest ( this , urlRequest ) + ")+\"" + url . substr ( idx ) ;
127- } else if ( idx === 0 ) {
128- // only hash
129- return toEmbStr ( urlItem . raw ) ;
130127 }
131128 urlRequest = url ;
132129 if ( ! moduleMode ) urlRequest = loaderUtils . urlToRequest ( url , root ) ;
Original file line number Diff line number Diff line change 55 background: url({./ module}# ?iefix);
66 background: url("#hash" );
77 background: url("#" );
8+ background: url(data: image/ png;base64, AAA );
9+ background: url(http: / / example.com / image.jpg );
10+ background: url(/ / example.com / image.png );
11+ background: green url(data: image/ png;base64, AAA ) url(http: / / example.com / image.jpg ) url(/ / example.com / image.png ) url({./ module}) xyz;
812}
Original file line number Diff line number Diff line change 55 background : url ("./module#?iefix" );
66 background : url ("#hash" );
77 background : url ("#" );
8+ background : url (data:image/png;base64, AAA);
9+ background : url (http://example.com/image.jpg);
10+ background : url (//example.com/image.png);
11+ background : green url (data:image/png;base64, AAA) url (http://example.com/image.jpg) url (//example.com/image.png) url (./ module) xyz;
812}
You can’t perform that action at this time.
0 commit comments