137 lines
3.2 KiB
TypeScript
137 lines
3.2 KiB
TypeScript
import type { NextConfig } from 'next';
|
|
import createMDX from '@next/mdx';
|
|
import createNextIntlPlugin from 'next-intl/plugin';
|
|
|
|
const withNextIntl = createNextIntlPlugin('./src/i18n/request.ts');
|
|
|
|
const nextConfig: NextConfig = {
|
|
output: 'standalone',
|
|
|
|
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
|
|
|
|
images: {
|
|
formats: ['image/avif', 'image/webp'],
|
|
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048],
|
|
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
|
|
remotePatterns: [
|
|
{
|
|
protocol: 'https',
|
|
hostname: 'mxadgucxhmstlzsbgmoz.supabase.co',
|
|
},
|
|
],
|
|
},
|
|
|
|
experimental: {
|
|
optimizePackageImports: ['lucide-react', 'framer-motion'],
|
|
},
|
|
|
|
async headers() {
|
|
return [
|
|
{
|
|
source: '/:path*',
|
|
headers: [
|
|
{
|
|
key: 'X-DNS-Prefetch-Control',
|
|
value: 'on',
|
|
},
|
|
{
|
|
key: 'X-Frame-Options',
|
|
value: 'SAMEORIGIN',
|
|
},
|
|
{
|
|
key: 'X-Content-Type-Options',
|
|
value: 'nosniff',
|
|
},
|
|
{
|
|
key: 'Content-Security-Policy',
|
|
value: [
|
|
"default-src 'self'",
|
|
"script-src 'self' 'unsafe-inline' 'unsafe-eval'",
|
|
"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com",
|
|
"font-src 'self' https://fonts.gstatic.com data:",
|
|
"img-src 'self' data: blob: https://mxadgucxhmstlzsbgmoz.supabase.co",
|
|
"connect-src 'self' https://mxadgucxhmstlzsbgmoz.supabase.co",
|
|
"frame-ancestors 'self'",
|
|
"base-uri 'self'",
|
|
"form-action 'self'",
|
|
].join('; '),
|
|
},
|
|
{
|
|
key: 'Strict-Transport-Security',
|
|
value: 'max-age=31536000; includeSubDomains; preload',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
source: '/fonts/:path*',
|
|
headers: [
|
|
{
|
|
key: 'Cache-Control',
|
|
value: 'public, max-age=31536000, immutable',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
source: '/images/:path*',
|
|
headers: [
|
|
{
|
|
key: 'Cache-Control',
|
|
value: 'public, max-age=31536000, immutable',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
source: '/_next/static/:path*',
|
|
headers: [
|
|
{
|
|
key: 'Cache-Control',
|
|
value: 'public, max-age=31536000, immutable',
|
|
},
|
|
],
|
|
},
|
|
// Content-Language Headers für jede Sprache (wichtig für Bing)
|
|
{
|
|
source: '/de/:path*',
|
|
headers: [
|
|
{
|
|
key: 'Content-Language',
|
|
value: 'de-DE',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
source: '/en/:path*',
|
|
headers: [
|
|
{
|
|
key: 'Content-Language',
|
|
value: 'en-US',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
source: '/sr/:path*',
|
|
headers: [
|
|
{
|
|
key: 'Content-Language',
|
|
value: 'sr-RS',
|
|
},
|
|
],
|
|
},
|
|
];
|
|
},
|
|
|
|
// Compiler-Optimierungen
|
|
compiler: {
|
|
removeConsole: process.env.NODE_ENV === 'production',
|
|
},
|
|
};
|
|
|
|
const withMDX = createMDX({
|
|
options: {
|
|
remarkPlugins: [],
|
|
rehypePlugins: [],
|
|
},
|
|
});
|
|
|
|
export default withNextIntl(withMDX(nextConfig));
|