Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/core/src/generators/ast/generate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ const isMdxFile = (path, content) => {
export async function processChunk(inputSlice, itemIndices) {
const filePaths = itemIndices.map(idx => inputSlice[idx]);

// Reads overlap within the chunk; parsing below stays sequential.
const contents = await Promise.all(
filePaths.map(([path]) => readFile(path, 'utf-8'))
);

const results = [];

for (const [path, parent] of filePaths) {
const content = await readFile(path, 'utf-8');
for (const [i, [path, parent]] of filePaths.entries()) {
const content = contents[i];

const mdx = isMdxFile(path, content);

Expand Down
Loading