// Tapecast Build — reine SPA, kein Backend.
// Output: dist/public/  (statisch deploybar auf jedem HTTPS-Host)

import { build as viteBuild } from "vite";
import { rm } from "node:fs/promises";

async function buildAll() {
  await rm("dist", { recursive: true, force: true });
  console.log("building client (PWA)...");
  await viteBuild();
  console.log("\n✓ build done → dist/public/");
  console.log("  serve mit jedem static-host (Nginx, Caddy, GitHub Pages, …)");
}

buildAll().catch((err) => {
  console.error(err);
  process.exit(1);
});
