]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(build): avoid imports to @babel/types in client build of compiler-core
authorEvan You <yyx990803@gmail.com>
Tue, 24 Aug 2021 16:39:38 +0000 (12:39 -0400)
committerEvan You <yyx990803@gmail.com>
Tue, 24 Aug 2021 16:39:38 +0000 (12:39 -0400)
packages/compiler-core/src/babelUtils.ts

index 706832a8a8beca7c10ff6f9f677bf13827f04510..571f6175643ee7728757d187bd15c603be7d50ec 100644 (file)
@@ -22,6 +22,10 @@ export function walkIdentifiers(
   parentStack: Node[] = [],
   knownIds: Record<string, number> = 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
   }