updated next.config for deployment

This commit is contained in:
pascalyazid committed 2026-09-28 18:32:47 +02:00
1 parent a0a76b48c7
commit ab4e9f846e
1 file changed
+14 -7
+14 -7
View File
@@ -1,16 +1,23 @@
import type { NextConfig } from "next"; import type { NextConfig } from 'next';
const { hostname: supabaseHostname } = new URL( const getHostname = (urlStr: string | undefined): string | null => {
process.env.NEXT_PUBLIC_SUPABASE_URL!, 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 = { const nextConfig: NextConfig = {
output: "standalone", output: 'standalone',
basePath: process.env.BASE_PATH,
images: { images: {
remotePatterns: [ remotePatterns: [
{ {
hostname: supabaseHostname, protocol: 'https',
hostname: supabaseHostname ?? '**.supabase.co',
pathname: '/storage/v1/object/**', pathname: '/storage/v1/object/**',
}, },
], ],