async function copyResourcesToDest()

in build/copyResource.js [70:103]


async function copyResourcesToDest(config) {
  const basePath = path.resolve(projectDir, '../public');
  const filePaths = await globby(
    [
      '**/*',
      // Use jade in echarts-www
      '!zh/*',
      '!en/*'
    ],
    {
      cwd: basePath
    }
  );

  console.log();

  for (const filePath of filePaths) {
    fse.ensureDirSync(
      path.resolve(config.releaseDestDir, path.dirname(filePath))
    );
    const destPath = path.resolve(config.releaseDestDir, filePath);
    fse.copyFileSync(path.resolve(basePath, filePath), destPath);

    if (process.stdout.clearLine) {
      process.stdout.clearLine();
      process.stdout.cursorTo(0);
      process.stdout.write(chalk.green(`resource copied to: ${destPath}`));
    } else {
      console.log(chalk.green(`resource copied to: ${destPath}`));
    }
  }

  console.log('\ncopyResourcesToDest done.');
}