INNER CODE UNIT · TypeScript

logCompiled

onejs/one · packages/compiler/src/index.ts:88

function logCompiled(cached: boolean, ms: number) {
  if (cached) {
    compilerLog.cached++
  } else {
    compilerLog.compiled++
    compilerLog.time += ms
  }

  if (compilerLog.timer) clearTimeout(compilerLog.timer)
  compilerLog.timer = setTimeout(() => {
    const total = compilerLog.compiled + compilerLog.cached
    const detail = compilerLog.compiled
      ? `${compilerLog.compiled} compiled in ${compilerLog.time}ms${compilerLog.cached ? `, ${compilerLog.cached} cached` : ''}`
      : `all cached`
    console.info(` 🪄 [compiler] ${total} file${total === 1 ? '' : 's'} (${detail})`)
    compilerLog.compiled = 0
    compilerLog.cached = 0
    compilerLog.time = 0

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…