Files

52 lines
1.2 KiB
TypeScript

import { withPayload } from '@payloadcms/next/withPayload'
import type { NextConfig } from 'next'
import path from 'path'
import { fileURLToPath } from 'url'
const __filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(__filename)
const nextConfig: NextConfig = {
output: 'standalone',
async headers() {
const { buildSecurityHeaders } = await import('@intecion/ipal-kit')
return [
{
source: '/(.*)',
headers: buildSecurityHeaders(),
},
]
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'images.unsplash.com',
},
],
localPatterns: [
{
pathname: '/api/media/file/**',
},
],
},
webpack: (webpackConfig) => {
webpackConfig.resolve.extensionAlias = {
'.cjs': ['.cts', '.cjs'],
'.js': ['.ts', '.tsx', '.js', '.jsx'],
'.mjs': ['.mts', '.mjs'],
}
return webpackConfig
},
turbopack: {
root: path.resolve(dirname),
},
experimental: {
// @ts-expect-error - Undocumented Next.js feature required for SEO streaming
htmlLimitedBots: /Googlebot|bingbot|yandex|baiduspider/i,
},
}
export default withPayload(nextConfig, { devBundleServerPackages: false })