#!/bin/sh
# Static build for the HF Space (relative base, no platform scripts)
set -e
cd "$(dirname "$0")/../frontend"
rm -rf ../dist_static
BASE_PATH=./ npx vite build --base ./ --outDir ../dist_static
python3 - <<'P'
import re
p='../dist_static/index.html'; s=open(p).read()
s=re.sub(r'\s*','',s,flags=re.S)
s=re.sub(r'\s*','',s,flags=re.S)
s=re.sub(r'.*?\s*','',s,flags=re.S)
s=re.sub(r'','')
open(p,'w').write(s)
P
echo built