From f187cbcddaceb48b7eb2d296b6edf640ee073783 Mon Sep 17 00:00:00 2001 From: "Alexander S." Date: Sat, 9 Nov 2024 16:49:01 +0100 Subject: [PATCH] build: improve `pnpm run generate` performance part 2 (#243) --- scripts/generate.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/scripts/generate.ts b/scripts/generate.ts index a2b129c..25914cd 100644 --- a/scripts/generate.ts +++ b/scripts/generate.ts @@ -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);