#!/usr/bin/env bash
# Production build must not reuse a dev .next folder.
set -euo pipefail
cd "$(dirname "$0")/.."

pkill -f "next dev" 2>/dev/null || true
rm -rf .next
echo "Building production bundle (clean cache)…"
exec npx next build