Skip to content

Commit 32c3594

Browse files
authored
perf(fmt): load stdin formatter on demand (#169)
1 parent e256fe8 commit 32c3594

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/rstack/src/fmt/cli.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { loadRstackConfig } from '../config.ts';
66
import { resolveFmtConfig } from './config.ts';
77
import { discoverFmtFiles } from './discovery.ts';
88
import { runFmtFiles } from './runner.ts';
9-
import { runFmtStdin } from './stdin.ts';
109
import type { FmtMode, FmtRunResult, ResolvedFmtConfig } from './types.ts';
1110

1211
interface ParsedFmtCLIArgs {
@@ -218,6 +217,10 @@ const runFmtCLI = async (args: string[]): Promise<void> => {
218217
}
219218

220219
if (stdinFilepath !== undefined) {
220+
const { runFmtStdin } = await import(
221+
/* rspackChunkName: 'fmtStdin' */
222+
'./stdin.ts'
223+
);
221224
await runFmtStdin({ filepath: stdinFilepath, cwd, loadConfig: () => loadFmtConfig(cwd) });
222225
return;
223226
}

0 commit comments

Comments
 (0)