optional imports

should fix https://github.com/less/less.js/issues/2145
This commit is contained in:
Bass Jobsen
2015-01-19 09:09:14 +01:00
parent 8ed6a9748e
commit 12969de390

View File

@@ -40,12 +40,14 @@ module.exports = function(environment) {
importManager.queue.splice(importManager.queue.indexOf(path), 1); // Remove the path from the queue
var importedEqualsRoot = fullPath === importManager.rootFilename;
if (importOptions.optional && e) {
callback(null, {rules:[]}, false, null);
}
else {
importManager.files[fullPath] = root;
if (e && !importManager.error) { importManager.error = e; }
callback(e, root, importedEqualsRoot, fullPath);
}
};
var newFileInfo = {