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