From 4c468eb30a87f726d43c94476b75063640c3ff1c Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 24 Aug 2021 12:39:38 -0400 Subject: [PATCH] fix(build): avoid imports to @babel/types in client build of compiler-core --- packages/compiler-core/src/babelUtils.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/compiler-core/src/babelUtils.ts b/packages/compiler-core/src/babelUtils.ts index 706832a8a8b..571f6175643 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 }