diff --git a/packages/babel-plugin-transform-modules-systemjs/src/index.js b/packages/babel-plugin-transform-modules-systemjs/src/index.js index d551c2f9510f..947d56031009 100644 --- a/packages/babel-plugin-transform-modules-systemjs/src/index.js +++ b/packages/babel-plugin-transform-modules-systemjs/src/index.js @@ -390,26 +390,16 @@ export default declare((api, options) => { for (const specifier of specifiers) { const binding = scope.getBinding(specifier.local.name); - if (binding) { - // hoisted function export - const bindingPath = binding.path; - if (bindingPath.isFunctionDeclaration()) { - exportNames.push(specifier.exported.name); - exportValues.push(t.cloneNode(specifier.local)); - } else { - // the exportNames will be later added in hoistVariables - addExportName( - specifier.local.name, - specifier.exported.name, - ); - } + // hoisted function export + const bindingPath = binding.path; + if (bindingPath.isFunctionDeclaration()) { + exportNames.push(specifier.exported.name); + exportValues.push(t.cloneNode(specifier.local)); } else { - // only globals also exported this way - nodes.push( - buildExportCall( - specifier.exported.name, - specifier.local, - ), + // the exportNames will be later added in hoistVariables + addExportName( + specifier.local.name, + specifier.exported.name, ); } }