less-middleware
Advanced tools
Comparing version 0.1.7 to 0.1.8
@@ -139,25 +139,29 @@ /*! | ||
parser.parse(str, function(err, tree) { | ||
if (err) { | ||
callback(err, css); | ||
return; | ||
} | ||
try { | ||
if (err) { | ||
callback(err, css); | ||
return; | ||
} | ||
var css = tree.toCSS({ | ||
compress: (options.compress == 'auto' ? regex.compress.test(cssPath) : options.compress), | ||
yuicompress: options.yuicompress | ||
}); | ||
// Store the less import paths | ||
imports[lessPath] = tree.rules | ||
.filter(function(rule) { | ||
return rule.path; | ||
}) | ||
.map(function(rule) { | ||
return { | ||
mtime : Date.now(), | ||
path : path.join(path.dirname(lessPath), rule.path) | ||
}; | ||
var css = tree.toCSS({ | ||
compress: (options.compress == 'auto' ? regex.compress.test(cssPath) : options.compress), | ||
yuicompress: options.yuicompress | ||
}); | ||
callback(err, css); | ||
// Store the less import paths | ||
imports[lessPath] = tree.rules | ||
.filter(function(rule) { | ||
return rule.path; | ||
}) | ||
.map(function(rule) { | ||
return { | ||
mtime : Date.now(), | ||
path : path.join(path.dirname(lessPath), rule.path) | ||
}; | ||
}); | ||
callback(err, css); | ||
} catch(parseError) { | ||
callback(parseError, null); | ||
} | ||
}); | ||
@@ -164,0 +168,0 @@ }; |
@@ -5,3 +5,3 @@ { | ||
"description": "LESS.js middleware for connect.", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
12517
229