🐛 Problem: - Dev server hardcoded to http://localhost:5173 - Local by Flywheel uses *.local domains with HTTPS - Dev mode was blank page (couldn't connect to Vite) ✅ Solution: Auto-detect dev server URL based on current host: - Reads $_SERVER['HTTP_HOST'] - Detects *.local domains (Local by Flywheel) - Uses HTTPS for *.local domains - Falls back to HTTP for localhost 📝 Examples: - woonoow.local → https://woonoow.local:5173 - localhost → http://localhost:5173 - example.test → http://example.test:5173 🎯 Result: - Dev mode works on Local by Flywheel - Dev mode works on standard localhost - No hardcoded URLs - Still filterable via 'woonoow/admin_dev_server' 💡 Usage: 1. Set WOONOOW_ADMIN_DEV=true in wp-config.php 2. Run: npm run dev 3. Visit wp-admin - Vite HMR works!
6.5 KiB
6.5 KiB