Skip to content

Commit

Permalink
fix issue resulting in duplicate files being parsed
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Siekmann committed Sep 24, 2021
1 parent ee9d304 commit 47d00ff
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion addon/src/parsers/postcss.parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ export async function parseCssFiles(
sourceType: TokenSourceType,
injectVariables?: boolean
): Promise<{ categories: Category[]; injectionStyles: string }> {
const nodes = await getNodes(files.filter((file) => file.content));
const relevantFiles = files.filter(
(file, index, files) =>
file.content &&
!files.some((f, i) => f.content === file.content && i < index)
);

const nodes = await getNodes(relevantFiles.filter((file) => file.content));

const categories = determineCategories(
nodes.comments,
Expand Down

0 comments on commit 47d00ff

Please sign in to comment.