diff --git a/src/babel/index.ts b/src/babel/index.ts index c7595a8..71f0b89 100644 --- a/src/babel/index.ts +++ b/src/babel/index.ts @@ -307,7 +307,7 @@ function bubbleFunctionDeclaration( decl.params.length < 2 ) { const first = program.get('body')[0]; - const [tmp] = first.insertBefore(decl); + const [tmp] = first.insertBefore(t.cloneNode(decl)); program.scope.registerDeclaration(tmp); tmp.skip(); if (path.parentPath.isExportNamedDeclaration()) {