Allow adding plugins via @import (plugin)

This commit is contained in:
rjgotten
2015-02-25 17:36:00 +01:00
parent 51ead08691
commit 83db6e8d90
3 changed files with 19 additions and 5 deletions

View File

@@ -50,7 +50,7 @@ Import.prototype.accept = function (visitor) {
this.features = visitor.visit(this.features);
}
this.path = visitor.visit(this.path);
if (!this.options.inline && this.root) {
if (!this.options.plugin && !this.options.inline && this.root) {
this.root = visitor.visit(this.root);
}
};
@@ -120,7 +120,9 @@ Import.prototype.eval = function (context) {
}
}
if (this.options.inline) {
if (this.options.plugin) {
return [];
} else if (this.options.inline) {
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) {