fix(build): avoid imports to @babel/types in client build of compiler-core

This commit is contained in:
Evan You 2021-08-24 12:39:38 -04:00
parent a137d73e91
commit 4c468eb30a

View 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
}