diff --git a/src/core/identifiers.ts b/src/core/identifiers.ts index e8e0ae3..919fe0d 100644 --- a/src/core/identifiers.ts +++ b/src/core/identifiers.ts @@ -70,6 +70,9 @@ export function getIdentifierUsages(node?: Expression | TSType | SpreadElement | else if (node.type === 'MemberExpression') { getIdentifierUsages(node.object, identifiers) } + else if (node.type === 'OptionalMemberExpression') { + getIdentifierUsages(node.object, identifiers) + } else if (node.type === 'CallExpression') { getIdentifierUsages(node.callee as Expression, identifiers) node.arguments.forEach(arg => getIdentifierUsages(arg as Expression, identifiers)) diff --git a/test/__snapshots__/transform.test.ts.snap b/test/__snapshots__/transform.test.ts.snap index fafc642..9a03518 100644 --- a/test/__snapshots__/transform.test.ts.snap +++ b/test/__snapshots__/transform.test.ts.snap @@ -251,17 +251,23 @@ export default __sfc_main; exports[`transform fixtures test/fixtures/MacrosDefineExpose.vue 1`] = ` " -