Merge pull request #2316 from andrewimm/development
Let dead code elimination run over exported functions
This commit is contained in:
commit
bd9b86d6d5
@ -21,6 +21,7 @@ export default function ({ Plugin, types: t }) {
|
||||
var binding = scope.getBinding(node.name);
|
||||
if (!binding || binding.references > 1 || !binding.constant) return;
|
||||
if (binding.kind === "param" || binding.kind === "module") return;
|
||||
if (t.isExportDeclaration(binding.path.parent)) return;
|
||||
|
||||
var replacement = binding.path.node;
|
||||
if (t.isVariableDeclarator(replacement)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user