function compileTypeScript()

in scripts/build.js [67:105]


function compileTypeScript(seriesPath, dirName) {
  const tscPath = path.join(__dirname, '../node_modules/.bin/tsc');
  // Remove dir of lib
  if (fs.existsSync(path.join(seriesPath, 'lib'))) {
    fs.rmSync(path.join(seriesPath, 'lib'), { recursive: true, force: true });
  }

  try {
    execSync(
      `${tscPath} ${seriesPath}/src/index.ts \
        --outDir ${seriesPath}/lib \
        --target ES5 \
        --noImplicitAny \
        --noImplicitThis \
        --strictBindCallApply \
        --removeComments true \
        --sourceMap \
        --moduleResolution node \
        --esModuleInterop \
        --declaration \
        --declarationMap false \
        --importHelpers \
        --pretty \
        --ignoreDeprecations 5.0 \
        --module es2015`
    );
  } catch (e) {
    // There may be some error compiling ECharts, which can be ignored
    // as long as `lib/index.js` exists
  }
  if (!fs.existsSync(path.join(seriesPath, 'lib/index.js'))) {
    console.error(
      chalk.red(`Error compiling TypeScript for custom series ${dirName}:`)
    );
    console.error(e);
    process.exit(1);
  }
  console.log(`Compiled TypeScript for custom series ${dirName}`);
}