|
| 1 | +import type { NextConfig } from 'next'; |
| 2 | + |
| 3 | +const nextConfig: NextConfig = { |
| 4 | + /* Next.js 16 App Router Configuration */ |
| 5 | + reactStrictMode: true, |
| 6 | + |
| 7 | + /* Cache Components - disabled for now to avoid incompatibilities with |
| 8 | + * route segment config (e.g. `export const dynamic = 'force-dynamic'`). |
| 9 | + * The project plans to enable Cache Components once all routes are |
| 10 | + * updated to the new caching primitives. See docs in .github for notes. |
| 11 | + */ |
| 12 | + cacheComponents: false, |
| 13 | + |
| 14 | + /* TypeScript Configuration */ |
| 15 | + typescript: { |
| 16 | + ignoreBuildErrors: false, |
| 17 | + }, |
| 18 | + |
| 19 | + /* Image Optimization */ |
| 20 | + images: { |
| 21 | + remotePatterns: [ |
| 22 | + { |
| 23 | + protocol: 'https', |
| 24 | + hostname: '**.vercel-storage.com', |
| 25 | + }, |
| 26 | + { |
| 27 | + protocol: 'https', |
| 28 | + hostname: '**.public.blob.vercel-storage.com', |
| 29 | + }, |
| 30 | + // Allow placeholder images used in the demo and fixtures (e.g. placehold.co) |
| 31 | + { |
| 32 | + protocol: 'https', |
| 33 | + hostname: 'placehold.co', |
| 34 | + port: '', |
| 35 | + }, |
| 36 | + ], |
| 37 | + formats: ['image/webp', 'image/avif'], |
| 38 | + deviceSizes: [640, 768, 1024, 1280, 1536, 1920], |
| 39 | + imageSizes: [16, 32, 48, 64, 96, 128, 256, 384], |
| 40 | + }, |
| 41 | + |
| 42 | + /* Security Headers */ |
| 43 | + async headers() { |
| 44 | + return [ |
| 45 | + { |
| 46 | + source: '/:path*', |
| 47 | + headers: [ |
| 48 | + { |
| 49 | + key: 'X-DNS-Prefetch-Control', |
| 50 | + value: 'on', |
| 51 | + }, |
| 52 | + { |
| 53 | + key: 'Strict-Transport-Security', |
| 54 | + value: 'max-age=63072000; includeSubDomains; preload', |
| 55 | + }, |
| 56 | + { |
| 57 | + key: 'X-Frame-Options', |
| 58 | + value: 'SAMEORIGIN', |
| 59 | + }, |
| 60 | + { |
| 61 | + key: 'X-Content-Type-Options', |
| 62 | + value: 'nosniff', |
| 63 | + }, |
| 64 | + { |
| 65 | + key: 'X-XSS-Protection', |
| 66 | + value: '1; mode=block', |
| 67 | + }, |
| 68 | + { |
| 69 | + key: 'Referrer-Policy', |
| 70 | + value: 'strict-origin-when-cross-origin', |
| 71 | + }, |
| 72 | + { |
| 73 | + key: 'Permissions-Policy', |
| 74 | + value: 'camera=(), microphone=(), geolocation=()', |
| 75 | + }, |
| 76 | + ], |
| 77 | + }, |
| 78 | + ]; |
| 79 | + }, |
| 80 | + |
| 81 | + /* Performance Optimization */ |
| 82 | + // experimental: { |
| 83 | + // optimizeCss: true, |
| 84 | + // optimizePackageImports: [ |
| 85 | + // '@radix-ui/react-dialog', |
| 86 | + // '@radix-ui/react-dropdown-menu', |
| 87 | + // '@radix-ui/react-select', |
| 88 | + // '@radix-ui/react-toast', |
| 89 | + // 'lucide-react', |
| 90 | + // ], |
| 91 | + // }, |
| 92 | +}; |
| 93 | + |
| 94 | +export default nextConfig; |
0 commit comments