Resolve 'babel-plugin-' name before the plain name

Otherwise you get situations like the following: `plugins: [
'object-assign']` resolves the module `object-assign` (an Object.assign
polyfill) instead of the intended babel plugin:
babel-plugin-object-assign.
This commit is contained in:
jquense 2015-05-18 20:26:51 -04:00
parent e9eced846f
commit 9b3c8569f7

View File

@ -35,7 +35,7 @@ export default class PluginManager {
var match = name.match(/^(.*?):(after|before)$/);
if (match) [, name, position] = match;
var loc = util.resolveRelative(name) || util.resolveRelative(`babel-plugin-${name}`);
var loc = util.resolveRelative(`babel-plugin-${name}`) || util.resolveRelative(name);
if (loc) {
return {
position: position,