Payload 3.88.0's peer range for `next` is >=15.2.9 <15.3.0 || >=15.3.9 <15.4.0 || >=15.4.11 <15.5.0 || >=16.2.6 <17.0.0 — the project's previous 15.5.23 fell in the unsupported gap between the 15.4.x and 16.2.x ranges. Upgrading to 16.3.4 (React 19.1.0 stays compatible) unblocks MITHOME-86. - next.config.ts: drop the removed `eslint.ignoreDuringBuilds` option (Next 16 no longer runs ESLint during `next build`) - eslint.config.mjs: import eslint-config-next's native flat-config arrays directly instead of bridging through FlatCompat, which threw "Converting circular structure to JSON" under ESLint 9 with the upgraded config - tsconfig.json: Next 16's own migration set `jsx: react-jsx` and added `.next/dev/types/**/*.ts` to `include` - ThemeProvider.tsx: suppress two react-hooks/set-state-in-effect false positives (new rule shipped with eslint-config-next 16) — these effects intentionally sync state from localStorage/DOM on mount, there is no subscription to move the setState into Verified: npm run build, npm run lint, tsc --noEmit, npm test (58 passed) all clean on this change alone, before installing Payload. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
74 lines
2.0 KiB
TypeScript
Executable File
74 lines
2.0 KiB
TypeScript
Executable File
import type { NextConfig } from "next";
|
|
|
|
const nextConfig: NextConfig = {
|
|
// Enable standalone output for Docker deployment
|
|
output: 'standalone',
|
|
|
|
// NOTE (Next.js 16): `eslint.ignoreDuringBuilds` was removed — `next build`
|
|
// no longer runs ESLint itself (lint is now only `next lint` / `npm run lint`),
|
|
// so there is nothing left to ignore here.
|
|
|
|
// Skip TypeScript checking during build (for faster Docker builds)
|
|
typescript: {
|
|
ignoreBuildErrors: true,
|
|
},
|
|
|
|
// Optimize for production builds — Turbopack rules moved from the deprecated
|
|
// experimental.turbo to the top-level turbopack key (Next 15.5).
|
|
turbopack: {
|
|
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;
|