Skip to content

Commit

Permalink
fix(build): avoid imports to @babel/types in client build of compiler…
Browse files Browse the repository at this point in the history
…-core
  • Loading branch information
yyx990803 committed Aug 24, 2021
1 parent a137d73 commit 4c468eb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/compiler-core/src/babelUtils.ts
Expand Up @@ -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' &&
Expand Down Expand Up @@ -81,6 +85,10 @@ export function isReferencedIdentifier(
parent: Node | null,
parentStack: Node[]
) {
if (__BROWSER__) {
return false
}

if (!parent) {
return true
}
Expand Down

0 comments on commit 4c468eb

Please sign in to comment.