MCPcopy
hub / github.com/rolldown/tsdown / resolveClean

Function resolveClean

src/features/clean.ts:55–73  ·  view source on GitHub ↗
(
  clean: UserConfig['clean'],
  outDir: string,
  cwd: string,
)

Source from the content-addressed store, hash-verified

53}
54
55export function resolveClean(
56 clean: UserConfig['clean'],
57 outDir: string,
58 cwd: string,
59): string[] {
60 if (clean === true) {
61 clean = [slash(outDir)]
62 } else if (!clean) {
63 clean = []
64 }
65
66 if (clean.some((item) => path.resolve(item) === cwd)) {
67 throw new Error(
68 'Cannot clean the current working directory. Please specify a different path to clean option.',
69 )
70 }
71
72 return clean
73}
74
75export async function cleanChunks(
76 outDir: string,

Callers 1

resolveUserConfigFunction · 0.90

Calls 1

slashFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…