allow plugins to be specified as an object with transformer and position - fixes #1300

This commit is contained in:
Sebastian McKenzie 2015-04-20 00:05:06 +01:00
parent c9518bb60d
commit 3564309a77

View File

@ -241,7 +241,10 @@ export default class File {
var plugin;
if (name) {
if (typeof name === "string") {
if (typeof name === "object" && name.transformer) {
plugin = name.transformer;
position ||= name.position;
} else if (typeof name === "string") {
// this is a plugin in the form of "foobar" or "foobar:after"
// where the optional colon is the delimiter for plugin position in the transformer stack