Skip to content

Commit 804f317

Browse files
committed
fix(sync): load task reporter lazily
1 parent e0fa25f commit 804f317

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/commands/sync.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { MANIFEST_FILENAME } from "#cache/manifest";
88
import { computeManifestHash, materializeSource } from "#cache/materialize";
99
import { applyTargetDir } from "#cache/targets";
1010
import { writeToc } from "#cache/toc";
11-
import { TaskReporter } from "#cli/task-reporter";
11+
import type { TaskReporter } from "#cli/task-reporter";
1212
import { isSilentMode, symbols, ui } from "#cli/ui";
1313
import { verifyCache } from "#commands/verify";
1414
import {
@@ -844,7 +844,9 @@ export const runSync = async (options: SyncOptions, deps: SyncDeps = {}) => {
844844
const isTestRunner = process.argv.includes("--test");
845845
const useLiveOutput =
846846
!options.json && !isSilentMode() && process.stdout.isTTY && !isTestRunner;
847-
const reporter = useLiveOutput ? new TaskReporter() : null;
847+
const reporter = useLiveOutput
848+
? new (await import("#cli/task-reporter")).TaskReporter()
849+
: null;
848850
const previous = plan.lockData;
849851
const requiredMissing = plan.results.filter((result) => {
850852
const source = plan.sources.find((entry) => entry.id === result.id);

0 commit comments

Comments
 (0)