File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,11 @@ module.exports = function(content, map) {
49
49
var importUrlPrefix = getImportPrefix ( this , query ) ;
50
50
51
51
var alreadyImported = { } ;
52
- var importJs = result . importItems . filter ( function ( imp ) {
52
+ var importJs = result . importItems . map ( function ( imp ) {
53
+ // fixes #781 when importing `url(filename.css )`
54
+ imp . url = imp . url . trim ( ) ;
55
+ return imp ;
56
+ } ) . filter ( function ( imp ) {
53
57
if ( ! imp . mediaQuery ) {
54
58
if ( alreadyImported [ imp . url ] )
55
59
return false ;
Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ describe("import", function() {
13
13
] , "" , {
14
14
"./test.css" : [ [ 2 , ".test{a: b}" , "" ] ]
15
15
} ) ;
16
+ test ( "import with trailing whitespace" , "@import url(test.css );\n.class { a: b c d; }" , [
17
+ [ 2 , ".test{a: b}" , "" ] ,
18
+ [ 1 , ".class { a: b c d; }" , "" ]
19
+ ] , "" , {
20
+ "./test.css" : [ [ 2 , ".test{a: b}" , "" ] ]
21
+ } ) ;
16
22
test ( "import camelcase" , "@IMPORT url(test.css);\n.class { a: b c d; }" , [
17
23
[ 2 , ".test{a: b}" , "" ] ,
18
24
[ 1 , ".class { a: b c d; }" , "" ]
You can’t perform that action at this time.
0 commit comments