import type { NextConfig } from 'next'; const getHostname = (urlStr: string | undefined): string | null => { if (!urlStr || urlStr.trim() === '') return null; try { return new URL(urlStr).hostname; } catch { return null; } }; const supabaseHostname = getHostname(process.env.NEXT_PUBLIC_SUPABASE_URL); const nextConfig: NextConfig = { output: 'standalone', images: { remotePatterns: [ { protocol: 'https', hostname: supabaseHostname ?? '**.supabase.co', pathname: '/storage/v1/object/**', }, ], }, }; export default nextConfig;