Skip to content

Commit f861b0a

Browse files
committed
Resolve inputs files in the order of the render list
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.
1 parent 24e136a commit f861b0a

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/project/project-context.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -802,16 +802,18 @@ export async function projectInputFiles(
802802
const resolved = resolvePathGlobs(dir, renderFiles, exclude, {
803803
mode: "auto",
804804
});
805-
await Promise.all(
806-
(ld.difference(resolved.include, resolved.exclude) as string[])
807-
.map((file) => {
808-
if (Deno.statSync(file).isDirectory) {
809-
return addDir(file);
810-
} else {
811-
return addFile(file);
812-
}
813-
}),
814-
);
805+
for (
806+
const file of ld.difference(
807+
resolved.include,
808+
resolved.exclude,
809+
) as string[]
810+
) {
811+
if (Deno.statSync(file).isDirectory) {
812+
await addDir(file);
813+
} else {
814+
await addFile(file);
815+
}
816+
}
815817
} else {
816818
await addDir(dir);
817819
}

0 commit comments

Comments
 (0)