Skip to content

Commit

Permalink
fix: traverse exported declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
bmstefanski committed Aug 4, 2023
1 parent 1338ada commit b0b5def
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/ASTtoCSS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@ export function convertASTtoCSS(ast: t.File): Array<{
styledComponents.push(component)
}
}
} else if (t.isExportNamedDeclaration(node) || t.isExportDefaultDeclaration(node)) {
if (node.declaration && t.isVariableDeclaration(node.declaration)) {
for (const declaration of node.declaration.declarations) {
if (t.isVariableDeclarator(declaration) && t.isIdentifier(declaration.id)) {
const component = traverseComponent(declaration)
styledComponents.push(component)
}
}
}
}
}

Expand Down

0 comments on commit b0b5def

Please sign in to comment.