(config: BuildConfig, srcDir: string, destDir: string)
| 315 | } |
| 316 | |
| 317 | export async function copyDir(config: BuildConfig, srcDir: string, destDir: string) { |
| 318 | await mkdir(destDir); |
| 319 | const items = await readdir(srcDir); |
| 320 | await Promise.all( |
| 321 | items.map(async (itemName) => { |
| 322 | if (!IGNORE[itemName] && !itemName.includes('.test')) { |
| 323 | const srcPath = join(srcDir, itemName); |
| 324 | const destPath = join(destDir, itemName); |
| 325 | const itemStat = await stat(srcPath); |
| 326 | if (itemStat.isDirectory()) { |
| 327 | await copyDir(config, srcPath, destPath); |
| 328 | } else if (itemStat.isFile()) { |
| 329 | await copyFile(srcPath, destPath); |
| 330 | } |
| 331 | } |
| 332 | }) |
| 333 | ); |
| 334 | } |
| 335 | |
| 336 | const IGNORE: { [path: string]: boolean } = { |
| 337 | '.rollup.cache': true, |
no test coverage detected
searching dependent graphs…