(source, target)
| 2 | import fs from 'fs'; |
| 3 | |
| 4 | const copyFiles = (source, target) => { |
| 5 | const files = fs.readdirSync(source); |
| 6 | files.forEach(file => { |
| 7 | const filePath = path.join(source, file); |
| 8 | const targetPath = path.join(target, file); |
| 9 | if (fs.lstatSync(filePath).isDirectory()) { |
| 10 | if (!fs.existsSync(targetPath)) fs.mkdirSync(targetPath); |
| 11 | copyFiles(filePath, targetPath); |
| 12 | } else { |
| 13 | fs.copyFileSync(filePath, targetPath); |
| 14 | } |
| 15 | }); |
| 16 | } |
| 17 | |
| 18 | export async function copyComponents() { |
| 19 | var isUsingSrc = false; |