This commit is contained in:
Luke Page
2015-01-26 22:28:42 +00:00
2 changed files with 6 additions and 4 deletions

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 = {

View File

@@ -1173,7 +1173,7 @@ var Parser = function Parser(context, imports, fileInfo) {
},
importOption: function() {
var opt = parserInput.$re(/^(less|css|multiple|once|inline|reference)/);
var opt = parserInput.$re(/^(less|css|multiple|once|inline|reference|optional)/);
if (opt) {
return opt[1];
}