Skip to content

Commit

Permalink
Resolve inputs files in the order of the render list
Browse files Browse the repository at this point in the history
Using Promise.all() with current `addFile()` logic without keeping track of index does not allow us to comply with render list order

This creates various problem, including breaking the promise of render target config controlling the order of rendering.
  • Loading branch information
cderv committed Oct 14, 2024
1 parent 24e136a commit f861b0a
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/project/project-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -802,16 +802,18 @@ export async function projectInputFiles(
const resolved = resolvePathGlobs(dir, renderFiles, exclude, {
mode: "auto",
});
await Promise.all(
(ld.difference(resolved.include, resolved.exclude) as string[])
.map((file) => {
if (Deno.statSync(file).isDirectory) {
return addDir(file);
} else {
return addFile(file);
}
}),
);
for (
const file of ld.difference(
resolved.include,
resolved.exclude,
) as string[]
) {
if (Deno.statSync(file).isDirectory) {
await addDir(file);
} else {
await addFile(file);
}
}
} else {
await addDir(dir);
}
Expand Down

0 comments on commit f861b0a

Please sign in to comment.