- Remove static/config.json from git tracking - Add .env.example and config.json.example as templates - Update config store to fallback to VITE_API_URL env variable - Add build.sh script for dev/prod builds
25 lines
509 B
Bash
25 lines
509 B
Bash
#!/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
|