From afa8dacdebbdd64787eca89c1494bbef72b6da12 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 28 Mar 2023 11:58:33 +0200 Subject: [PATCH] fix(babel): only transform exported functions with meta --- src/loader/babel.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/loader/babel.ts b/src/loader/babel.ts index 17de62d..22964c0 100644 --- a/src/loader/babel.ts +++ b/src/loader/babel.ts @@ -100,6 +100,11 @@ const babelPluginUntyped: PluginItem = function ( return; } + // Do not add meta to internal functions + if (p.parent.type !== "ExportNamedDeclaration") { + return; + } + const _getLines = cachedFn(() => this.file.code.split("\n")); const getCode: GetCodeFn = (loc) => { const _lines = _getLines();