build(copy-dist): execute filterableDirs cleanup in one chain

This commit is contained in:
Panagiotis Papadopoulos 2025-03-16 02:10:47 +01:00
parent a9643174cc
commit 8275f3c867

View File

@ -82,13 +82,10 @@ function cleanupNodeModules() {
"tests"
]);
const filteredDirs = nodeDir
nodeDir
.filter(el => el.isDirectory() && filterableDirs.has(el.name))
.map(el => path.join(DEST_DIR, el.parentPath, el.name));
filteredDirs.forEach(dir => {
fs.removeSync(dir);
})
.map(el => path.join(DEST_DIR, el.parentPath, el.name))
.forEach(dir => fs.removeSync(dir));
}