use a strict regex when splitting string plugins - fixes #1361
This commit is contained in:
parent
ee0c88a070
commit
ea03f67505
@ -29,7 +29,8 @@ export default class PluginManager {
|
|||||||
// this is a plugin in the form of "foobar" or "foobar:after"
|
// 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
|
// 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}`);
|
var loc = util.resolveRelative(name) || util.resolveRelative(`babel-plugin-${name}`);
|
||||||
if (loc) {
|
if (loc) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user