| 1 | import { fileURLToPath } from 'node:url' |
| 2 | import { withContentCollections } |
| 3 | import bundleAnalyzer from '@next/bundle-analyzer |
| 4 | import type { NextConfig |
| 5 | |
| 6 | async function createNextConfig() |
| 7 | const { createJiti |
| 8 | const jiti = |
| 9 | if (process.env |
| 10 | await jiti.import |
| 11 | } |
| 12 | |
| 13 | const nextConfig: |
| 14 | output: 'standalone', |
| 15 | reactStrictMode: true, |
| 16 | productionBrowserSourceMaps: process.env |
| 17 | logging: { |
| 18 | fetches: { |
| 19 | fullUrl: true, |
| 20 | }, |
| 21 | }, |
| 22 | typescript: { |
| 23 | ignoreBuildErrors: true, |
| 24 | }, |
| 25 | typedRoutes: true, |
| 26 | images: { |
| 27 | remotePatterns: [ |
| 28 | new URL('https://github.com/** |
| 29 | new URL('https://avatars.githubusercontent.com/** |
| 30 | ], |
| 31 | }, |
| 32 | headers: async () |
| 33 | { |
| 34 | source: '/(.*)', |
| 35 | headers: [ |
| 36 | { |
| 37 | key: 'X-Content-Type-Options', |
| 38 | value: 'nosniff', |
| 39 | }, |
| 40 | { |
| 41 | key: 'Content-Security-Policy', |
| 42 | value: "frame-ancestors 'self';", |
| 43 | }, |
| 44 | { |
| 45 | key: 'X-Frame-Options', |
| 46 | value: 'SAMEORIGIN', |
| 47 | }, |
| 48 | ], |
| 49 | }, |
| 50 | ], |
| 51 | } |
| 52 | |
| 53 | return nextConfig |
| 54 | } |
| 55 | |
| 56 | const bundleAnalyzerPlugin = bundleAnalyzer |
| 57 | enabled: process.env |
| 58 | }) |
| 59 | |
| 60 | const NextApp = async |
| 61 | const nextConfig = |
| 62 | return withContentCollections(bundleAnalyzerPlugin |
| 63 | } |
| 64 | |
| 65 | export default NextApp |