diff --git a/src/babel/transformation/file/plugin-manager.js b/src/babel/transformation/file/plugin-manager.js index 61c580748e..e05f7a27b0 100644 --- a/src/babel/transformation/file/plugin-manager.js +++ b/src/babel/transformation/file/plugin-manager.js @@ -29,7 +29,8 @@ export default class PluginManager { // 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 - var [name, position = _position] = key.split(":"); + var match = key.match(/^(.*?):(after|before)$/); + if (match) [, name, position] = match; var loc = util.resolveRelative(name) || util.resolveRelative(`babel-plugin-${name}`); if (loc) {