#!/bin/bash # serve.sh - Build optimized WASM and serve with Trunk set -e echo "🔧 Building optimized WASM bundle..." trunk build --release echo "đŸ“Ļ Checking bundle sizes..." if [ -d "dist" ]; then echo "Bundle sizes:" find dist -name "*.wasm" -exec ls -lh {} \; | awk '{print " WASM: " $5 " - " $9}' find dist -name "*.js" -exec ls -lh {} \; | awk '{print " JS: " $5 " - " $9}' find dist -name "*.css" -exec ls -lh {} \; | awk '{print " CSS: " $5 " - " $9}' echo "" fi echo "🚀 Starting Trunk development server..." echo "📍 Server will be available at: http://127.0.0.1:8080" echo "" echo "💡 Tips:" echo " - Make sure your Flask backend is running on http://127.0.0.1:5000" echo " - Check CORS configuration in your backend" echo " - Upload files will use TUS protocol for resumable uploads" echo "" echo "âšī¸ Press Ctrl+C to stop the server" echo "" # Start Trunk serve trunk serve --release