updated next.config for deployment
This commit is contained in:
1 parent
a0a76b48c7
commit
ab4e9f846e
1 file changed
+14
-7
+14
-7
@@ -1,16 +1,23 @@
|
||||
import type { NextConfig } from "next";
|
||||
import type { NextConfig } from 'next';
|
||||
|
||||
const { hostname: supabaseHostname } = new URL(
|
||||
process.env.NEXT_PUBLIC_SUPABASE_URL!,
|
||||
)
|
||||
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",
|
||||
basePath: process.env.BASE_PATH,
|
||||
output: 'standalone',
|
||||
images: {
|
||||
remotePatterns: [
|
||||
{
|
||||
hostname: supabaseHostname,
|
||||
protocol: 'https',
|
||||
hostname: supabaseHostname ?? '**.supabase.co',
|
||||
pathname: '/storage/v1/object/**',
|
||||
},
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user