From: Evan You Date: Tue, 24 Aug 2021 16:39:38 +0000 (-0400) Subject: fix(build): avoid imports to @babel/types in client build of compiler-core X-Git-Tag: v3.2.6~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c468eb30a87f726d43c94476b75063640c3ff1c;p=thirdparty%2Fvuejs%2Fcore.git fix(build): avoid imports to @babel/types in client build of compiler-core --- diff --git a/packages/compiler-core/src/babelUtils.ts b/packages/compiler-core/src/babelUtils.ts index 706832a8a8..571f617564 100644 --- a/packages/compiler-core/src/babelUtils.ts +++ b/packages/compiler-core/src/babelUtils.ts @@ -22,6 +22,10 @@ export function walkIdentifiers( parentStack: Node[] = [], knownIds: Record = Object.create(null) ) { + if (__BROWSER__) { + return + } + const rootExp = root.type === 'Program' && root.body[0].type === 'ExpressionStatement' && @@ -81,6 +85,10 @@ export function isReferencedIdentifier( parent: Node | null, parentStack: Node[] ) { + if (__BROWSER__) { + return false + } + if (!parent) { return true }