import { rmSync, existsSync } from 'node:fs' import { join } from 'node:path' import { fileURLToPath } from 'node:url' const root = join(fileURLToPath(new URL('.', import.meta.url)), '..') const cache = join(root, 'docs', '.vuepress', '.cache') if (existsSync(cache)) { rmSync(cache, { recursive: true, force: true }) console.log('cleared:', cache) } else { console.log('no cache dir:', cache) }