Skip to content

Commit a3384fa

Browse files
author
Alexis Sellier
committed
Merge pull request #355 from revolunet/import-querystrings
support imports with querystrings (google fonts) fix #265
2 parents 301b448 + f1695f6 commit a3384fa

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

lib/less/tree/import.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ tree.Import = function (path, imports) {
1818

1919
// The '.less' extension is optional
2020
if (path instanceof tree.Quoted) {
21-
this.path = /\.(le?|c)ss$/.test(path.value) ? path.value : path.value + '.less';
21+
this.path = /\.(le?|c)ss(\?.*)?$/.test(path.value) ? path.value : path.value + '.less';
2222
} else {
2323
this.path = path.value.value || path.value;
2424
}
2525

26-
this.css = /css$/.test(this.path);
26+
this.css = /css(\?.*)?$/.test(this.path);
2727

2828
// Only pre-compile .less files
2929
if (! this.css) {

test/css/import.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
@import "import-test-d.css";
2+
3+
@import url(http://fonts.googleapis.com/css?family=Open+Sans);
24
#import {
35
color: red;
46
}

test/less/import.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@import url("import/import-test-a.less");
22
//@import url("import/import-test-a.less");
3+
@import url(http://fonts.googleapis.com/css?family=Open+Sans);
34

45
#import-test {
56
.mixin;

0 commit comments

Comments
 (0)