From 9b3c8569f753fed2bc186d2f594658cf3fd00d13 Mon Sep 17 00:00:00 2001 From: jquense Date: Mon, 18 May 2015 20:26:51 -0400 Subject: [PATCH] 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. --- src/babel/transformation/file/plugin-manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/babel/transformation/file/plugin-manager.js b/src/babel/transformation/file/plugin-manager.js index 1b3c4f15a3..577cea2171 100644 --- a/src/babel/transformation/file/plugin-manager.js +++ b/src/babel/transformation/file/plugin-manager.js @@ -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,