#!/bin/bash
set -e

# Force clean build (clears Vite cache to avoid stale chunks)
npm run frontend:build -- --force

# Clean destination and copy - ensures old hashed assets are removed
mkdir -p frontend/public
rm -rf frontend/public/*
cp -r frontend/dist/* frontend/public/

echo "Build copied to frontend/public/"
