build(copy-dist): simplify "copyNodeModuleFileOrFolder" copying

there's no benefit from stripping "node_modules/" from the string, to later add it again using the `DEST_DIR_NODE_MODULES` constant

=> just copy directly into the `DEST_DIR` folder and preserver the `node_modules` part in the path
This commit is contained in:
Panagiotis Papadopoulos 2025-02-27 08:53:02 +01:00 committed by Panagiotis Papadopoulos
parent ac3e96291a
commit dbeae62709

View File

@ -14,9 +14,7 @@ function log(...args: any[]) {
}
async function copyNodeModuleFileOrFolder(source: string) {
const adjustedSource = source.substring(13);
const destination = path.join(DEST_DIR_NODE_MODULES, adjustedSource);
const destination = path.join(DEST_DIR, source);
log(`Copying ${source} to ${destination}`);
await fs.ensureDir(path.dirname(destination));
await fs.copy(source, destination);