Files
websitedev/proto/next.config.ts
T
Do Siki bd7287aa58 fix: address code review findings from 2026-08-17
- scope no-cache headers to non-static routes (restore immutable asset caching)
- reset cached rejected MongoDB promise so retries can succeed
- use last X-Forwarded-For entry in Content Editor rate limiter (anti-spoofing)
- remove weak Mongo defaults from compose files (fail loudly on missing env)
- move staging banner text to common.json content
- read APP_PORT from env file in deploy.sh healthcheck
- filter network noise from staging smoke console assertions

Closes MITHOME-48, MITHOME-49, MITHOME-50, MITHOME-51, MITHOME-52, MITHOME-53, MITHOME-54
2026-08-18 12:21:32 +02:00

77 lines
1.8 KiB
TypeScript
Executable File

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
// Enable standalone output for Docker deployment
output: 'standalone',
// Skip linting during build for faster Docker builds
eslint: {
ignoreDuringBuilds: true,
},
// Skip TypeScript checking during build (for faster Docker builds)
typescript: {
ignoreBuildErrors: true,
},
// Optimize for production builds
experimental: {
// Enable turbo mode for faster builds
turbo: {
rules: {
'*.svg': {
loaders: ['@svgr/webpack'],
as: '*.js',
},
},
},
},
// Image optimization
images: {
formats: ['image/webp', 'image/avif'],
minimumCacheTTL: 60 * 60 * 24 * 30, // 30 days
},
// Security headers
async headers() {
return [
{
// Security headers apply to every route, including static assets.
source: '/:path*',
headers: [
{
key: 'X-Frame-Options',
value: 'DENY',
},
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: 'Referrer-Policy',
value: 'origin-when-cross-origin',
},
],
},
{
// WHY: no-cache must not hit hashed build assets (_next/static) or
// optimized images (_next/image); they are content-addressed and rely on
// long-lived caching. Overriding them would re-download the bundle on
// every page load.
source: '/((?!_next/static|_next/image).*)',
headers: [
{
key: 'Cache-Control',
value: 'private, no-cache, must-revalidate, max-age=0',
},
{ key: 'Pragma', value: 'no-cache' },
{ key: 'Expires', value: '0' },
],
},
];
},
};
export default nextConfig;