From 47f1df5a5ad06e8aab5b6d2d53fc64eafcdb1a3e Mon Sep 17 00:00:00 2001 From: Slyn Date: Tue, 21 Jun 2022 18:54:12 +0800 Subject: [PATCH] chore: copy shared files in parallel (#823) --- scripts/copyShared.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/copyShared.js b/scripts/copyShared.js index ed5f55d9..465f2853 100644 --- a/scripts/copyShared.js +++ b/scripts/copyShared.js @@ -1,7 +1,9 @@ import { copy } from 'fs-extra' import fg from 'fast-glob' -fg.sync('src/shared/**/*.ts').map(async (file) => { - await copy(file, file.replace(/^src\/shared\//, 'src/node/')) - await copy(file, file.replace(/^src\/shared\//, 'src/client/')) +fg.sync('src/shared/**/*.ts').forEach(async (file) => { + await Promise.all([ + copy(file, file.replace(/^src\/shared\//, 'src/node/')), + copy(file, file.replace(/^src\/shared\//, 'src/client/')) + ]) })