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 distDir = path.join(rootDir, "dist-firefox"); if (existsSync(distDir)) { rmSync(distDir, { recursive: true, force: true }); console.log(`Cleaned ${path.relative(rootDir, distDir)}`); }