Files
dyolink/frontend/next.config.ts

44 lines
1.1 KiB
TypeScript
Raw Normal View History

import type { NextConfig } from 'next';
import createNextIntlPlugin from 'next-intl/plugin';
const withNextIntl = createNextIntlPlugin('./src/i18n/request.ts');
function publicAppHostname(): string | null {
const url = process.env.NEXT_PUBLIC_APP_URL;
if (!url) return null;
try {
return new URL(url).hostname;
} catch {
return null;
}
}
const appHost = publicAppHostname();
const nextConfig: NextConfig = {
reactStrictMode: true,
poweredByHeader: false,
images: {
remotePatterns: [
{ protocol: 'http', hostname: 'localhost' },
...(appHost
? [
{ protocol: 'http' as const, hostname: appHost },
{ protocol: 'https' as const, hostname: appHost },
]
: []),
{ protocol: 'https', hostname: 'dyolink.com' },
{ protocol: 'https', hostname: 'www.dyolink.com' },
],
},
env: {
NEXT_PUBLIC_APP_NAME: process.env.NEXT_PUBLIC_APP_NAME,
NEXT_PUBLIC_APP_URL: process.env.NEXT_PUBLIC_APP_URL,
NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL,
},
output: 'standalone',
compress: true,
};
export default withNextIntl(nextConfig);