diff --git a/src/babel/transformation/file/index.js b/src/babel/transformation/file/index.js index c053910ad8..41250e8773 100644 --- a/src/babel/transformation/file/index.js +++ b/src/babel/transformation/file/index.js @@ -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