babel-plugin-transform-rename-import
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -47,3 +47,3 @@ "use strict"; | ||
}, | ||
CallExpression: function CallExpression(path, state) { | ||
ExportDeclaration: function ExportDeclaration(path, state) { | ||
var replacements = getReplacements(state); | ||
@@ -55,2 +55,14 @@ replacements.forEach(function (_ref3) { | ||
if (node.source && isModule(node.source.value, original)) { | ||
path.node.source = source(node.source.value, original, replacement); | ||
} | ||
}); | ||
}, | ||
CallExpression: function CallExpression(path, state) { | ||
var replacements = getReplacements(state); | ||
replacements.forEach(function (_ref4) { | ||
var original = _ref4.original, | ||
replacement = _ref4.replacement; | ||
var node = path.node; | ||
if (node.callee.name === "require" && node.arguments && node.arguments.length === 1 && t.isStringLiteral(node.arguments[0]) && isModule(node.arguments[0].value, original)) { | ||
@@ -57,0 +69,0 @@ path.node.arguments = [source(node.arguments[0].value, original, replacement)]; |
{ | ||
"name": "babel-plugin-transform-rename-import", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "Replace import sources", | ||
@@ -5,0 +5,0 @@ "main": "lib/index", |
6550
64
66053