use a strict regex when splitting string plugins - fixes #1361

This commit is contained in:
Sebastian McKenzie 2015-04-30 18:13:17 +01:00
parent ee0c88a070
commit ea03f67505

View File

@ -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) {