#!/bin/bash
# Build script for different environments

# Usage: ./build.sh [dev|prod]

ENV=${1:-dev}

case $ENV in
  dev)
    echo "Building for development..."
    cp static/config.json.dev static/config.json 2>/dev/null || echo "Using env variable VITE_API_URL"
    vite build
    ;;
  prod)
    echo "Building for production..."
    # Production uses env variable, no config.json needed
    rm -f static/config.json
    vite build
    ;;
  *)
    echo "Usage: ./build.sh [dev|prod]"
    exit 1
    ;;
esac
