import fs from 'node:fs'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..'); const legacyLoginDir = path.join(root, 'dist', 'login'); if (fs.existsSync(legacyLoginDir)) { fs.rmSync(legacyLoginDir, { recursive: true, force: true }); console.log('[postbuild] removed dist/login (conflicts with SPA route /login)'); }