Skip to content

Commit

Permalink
build: improve pnpm run generate performance part 2 (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sysix authored Nov 9, 2024
1 parent 66f9fa1 commit f187cbc
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions scripts/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ if (!fs.existsSync(generateFolder)) {
fs.mkdirSync(generateFolder);
}

const promises = [rulesGenerator, configGenerator].map(
(generator) => async () => {
generator.setRulesGrouping(RulesGrouping.SCOPE);
await generator.generateRules(generateFolder);
generator.setRulesGrouping(RulesGrouping.CATEGORY);
await generator.generateRules(generateFolder);
}
);
const promises = [rulesGenerator, configGenerator].map(async (generator) => {
generator.setRulesGrouping(RulesGrouping.SCOPE);
await generator.generateRules(generateFolder);
generator.setRulesGrouping(RulesGrouping.CATEGORY);
await generator.generateRules(generateFolder);
});

await Promise.all(promises);

0 comments on commit f187cbc

Please sign in to comment.