diff --git a/src/generators/ast-js/index.mjs b/src/generators/ast-js/index.mjs index 44f7f270..cdc72799 100644 --- a/src/generators/ast-js/index.mjs +++ b/src/generators/ast-js/index.mjs @@ -36,9 +36,17 @@ export default { async processChunk(inputSlice, itemIndices) { const filePaths = itemIndices.map(idx => inputSlice[idx]); - return Promise.all( - filePaths.map(async path => parseJsSource(await read(path, 'utf-8'))) - ); + const results = []; + + for (const path of filePaths) { + const vfile = await read(path, 'utf-8'); + + const parsedJS = await parseJsSource(vfile); + + results.push(parsedJS); + } + + return results; }, /** diff --git a/src/generators/ast/index.mjs b/src/generators/ast/index.mjs index eaec9ff1..03ce0c16 100644 --- a/src/generators/ast/index.mjs +++ b/src/generators/ast/index.mjs @@ -38,18 +38,20 @@ export default { async processChunk(inputSlice, itemIndices) { const filePaths = itemIndices.map(idx => inputSlice[idx]); - return Promise.all( - filePaths.map(async path => { - const vfile = await read(path, 'utf-8'); + const results = []; - updateStabilityPrefixToLink(vfile); + for (const path of filePaths) { + const vfile = await read(path, 'utf-8'); - return { - tree: remarkProcessor.parse(vfile), - file: { stem: vfile.stem, basename: vfile.basename }, - }; - }) - ); + updateStabilityPrefixToLink(vfile); + + results.push({ + tree: remarkProcessor.parse(vfile), + file: { stem: vfile.stem, basename: vfile.basename }, + }); + } + + return results; }, /**