You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//@import url("//fonts.googleapis.com/css?family=Lobster|Cabin:400,700"); // line 1
@import url("//use.edgefonts.net/c/950482/alegreya:i4:i7:n4:n7.b6D:N:2,b6G:N:2,b6C:N:2,b6F:N:2/d"); // line 2
test.js:
var less = require('less'),
fs = require('fs'),
path = require('path');
fs.readFile(path.join(__dirname, 'test.less'), 'utf8', function(err, content){
if (err) return console.error('fs-error:', err);
less.render(content, {paths: [__dirname], filename: 'test.less'}, function(err, css){
// will not be called if test.less is line 2
if (err) return console.error('less-error:', err);
console.log('less-css:', css);
});
});
I am not sure how less handle @import url("..."), however, in the above codes,
less will not callback, because it stuck on import-visitor.js line 33, due to
this.importCount is 1 at that time.
If I switch the tess.less to line 1, less.render will go.
The text was updated successfully, but these errors were encountered:
it seems less is treating it like its a less import because there is no mention of css in the URL. I'll look into why importCount isn't getting decremented.
Okay also fixed the problem, which was that it was trying to fetch the file but erroring because there was no protocol and then the code incorrectly checked error after it checked the result status code. Now it checks error first and it uses http if there is no protocol.
But if you want it to just output the import, you will have to use the (css) option when the filename doesn't end in css.
test.less
test.js:
I am not sure how less handle @import url("..."), however, in the above codes,
less will not callback, because it stuck on import-visitor.js line 33, due to
this.importCount is 1 at that time.
If I switch the tess.less to line 1, less.render will go.
The text was updated successfully, but these errors were encountered: