diff --git a/lib/less/import-manager.js b/lib/less/import-manager.js index d70c1605..386320aa 100644 --- a/lib/less/import-manager.js +++ b/lib/less/import-manager.js @@ -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 = {