Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx authored Mar 21, 2024
1 parent 247f111 commit 3603f62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/macros/src/babel/macros-babel-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ export default function main(context: typeof Babel): unknown {
if (specifier?.type !== 'StringLiteral') {
let relativePath;
let property;
if (specifier.type === 'BinaryExpression' && specifier.left.type === 'Identifier') {
if (specifier.type === 'BinaryExpression' && specifier.left.type === 'StringLiteral' && specifier.right.type === 'Identifier') {
relativePath = specifier.left.value;
property = specifier.right.value;
property = specifier.right;
}
if (specifier.type === 'TemplateLiteral' && specifier.expressions[0].type === 'Identifier') {
relativePath = specifier.quasis[0].value.cooked;
Expand Down

0 comments on commit 3603f62

Please sign in to comment.