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(
|
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/**',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in new issue
Block a user