clean-chrome-dist.mjs

472 B · raw

1import { existsSync, rmSync } from "node:fs";2import path from "node:path";3import { fileURLToPath } from "node:url";45const __filename = fileURLToPath(import.meta.url);6const __dirname = path.dirname(__filename);7const rootDir = path.resolve(__dirname, "..");89for (const dir of ["dist-chrome", "dist"]) {10  const target = path.join(rootDir, dir);11  if (existsSync(target)) {12    rmSync(target, { recursive: true, force: true });13    console.log(`Cleaned ${dir}`);14  }15}