From ac3e96291aad41ac2f21abc776667f78f79aea07 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Thu, 27 Feb 2025 08:32:08 +0100 Subject: [PATCH] build(copy-dist): simplify "build" copying there's no need to read the folder structure and then copy each single file in a loop => just copy the whole folder and be done with it :-) --- bin/copy-dist.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bin/copy-dist.ts b/bin/copy-dist.ts index c7bd8c809..45514e900 100644 --- a/bin/copy-dist.ts +++ b/bin/copy-dist.ts @@ -23,11 +23,8 @@ async function copyNodeModuleFileOrFolder(source: string) { } const copy = async () => { - for (const srcFile of fs.readdirSync("build")) { - const destFile = path.join(DEST_DIR, path.basename(srcFile)); - log(`Copying source ${srcFile} -> ${destFile}.`); - fs.copySync(path.join("build", srcFile), destFile, { recursive: true }); - } + log(`Copying build into dist folder.`); + fs.copySync("./build", DEST_DIR); const assetsToCopy = new Set([ "./images",