We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e9184a commit f51ad23Copy full SHA for f51ad23
copy-file.js
@@ -1,4 +1,5 @@
1
import fs from 'fs/promises';
2
+import path from 'path';
3
4
const copyFile = (options = {}) => {
5
const { targets = [], hook = 'writeBundle' } = options;
@@ -8,7 +9,7 @@ const copyFile = (options = {}) => {
8
9
targets.forEach(async (target) => {
10
try {
11
console.log(`copying ${target.src}...`);
- const destPath = target.dest + target.src.split('/').pop();
12
+ const destPath = path.join(target.dest, path.basename(target.src));
13
await fs.copyFile(target.src, destPath);
14
} catch (error) {
15
console.log(error);
0 commit comments