( clean: UserConfig['clean'], outDir: string, cwd: string, )
| 53 | } |
| 54 | |
| 55 | export 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 | |
| 75 | export async function cleanChunks( |
| 76 | outDir: string, |
no test coverage detected
searching dependent graphs…