import fs from "node:fs"; import path from "node:path"; const PUBLIC_DIR = path.resolve(import.meta.dirname, "../public"); function cleanDotfiles(directory) { for (const entry of fs.readdirSync(directory, { withFileTypes: true })) { const fullPath = path.join(directory, entry.name); if (entry.isDirectory()) { cleanDotfiles(fullPath); continue; } if (entry.isFile() && entry.name === ".DS_Store") { fs.rmSync(fullPath); } } } if (fs.existsSync(PUBLIC_DIR)) { cleanDotfiles(PUBLIC_DIR); }