diff --git a/lib/less/tree/import.js b/lib/less/tree/import.js index 18e439285..b084eef34 100644 --- a/lib/less/tree/import.js +++ b/lib/less/tree/import.js @@ -127,7 +127,7 @@ Import.prototype.eval = function (context) { } } - if (this.options.inline) { + if (this.options.inline && !this.path.currentFileInfo.reference) { var contents = new Anonymous(this.root, 0, {filename: this.importedFilename}, true, true); return this.features ? new Media([contents], this.features.value) : [contents]; } else if (this.css) { diff --git a/test/less/import/import-inline-invalid-css.less b/test/less/import/import-inline-invalid-css.less new file mode 100644 index 000000000..274a76e3b --- /dev/null +++ b/test/less/import/import-inline-invalid-css.less @@ -0,0 +1 @@ +@import (inline) "invalid-css.less"; \ No newline at end of file diff --git a/test/less/import/import-reference.less b/test/less/import/import-reference.less index cadf09f65..77d06765f 100644 --- a/test/less/import/import-reference.less +++ b/test/less/import/import-reference.less @@ -86,4 +86,7 @@ } @rules1: {property: value;}; @rules2: {property: value;}; -} \ No newline at end of file +} + +@import (inline) "invalid-css.less"; +@import "import-inline-invalid-css.less"; \ No newline at end of file