import { existsSync, rmSync } from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const rootDir = path.resolve(__dirname, ".."); const dir = "dist-chrome"; const target = path.join(rootDir, dir); if (existsSync(target)) { rmSync(target, { recursive: true, force: true }); console.log(`Cleaned ${dir}`); }