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 :-)
This commit is contained in:
Panagiotis Papadopoulos 2025-02-27 08:32:08 +01:00 committed by Panagiotis Papadopoulos
parent 9ac451e2b2
commit ac3e96291a

View File

@ -23,11 +23,8 @@ async function copyNodeModuleFileOrFolder(source: string) {
} }
const copy = async () => { const copy = async () => {
for (const srcFile of fs.readdirSync("build")) { log(`Copying build into dist folder.`);
const destFile = path.join(DEST_DIR, path.basename(srcFile)); fs.copySync("./build", DEST_DIR);
log(`Copying source ${srcFile} -> ${destFile}.`);
fs.copySync(path.join("build", srcFile), destFile, { recursive: true });
}
const assetsToCopy = new Set([ const assetsToCopy = new Set([
"./images", "./images",