const pc = require ( 'picocolors' ) ; const packageJson = require ( './package.json' ) ; const NEXTJS_IGNORE_ESLINT = process . env . NEXTJS_IGNORE_ESLINT === '1' || false ; const NEXTJS_IGNORE_TYPECHECK = process . env . NEXTJS_IGNORE_TYPECHECK === '1' || false ; const isProd = process . env . NODE_ENV === 'production' ; const tmModules = [ ... ( isProd ? [ ] : [ ] ) , ... [ ] , ] ; const withNextTranspileModules = require ( 'next-transpile-modules' ) ( tmModules , { resolveSymlinks : true , debug : false , } ) ; link const disableSourceMaps = process . env . NEXT_DISABLE_SOURCEMAPS === 'true' ; if ( disableSourceMaps ) { console . info ( `${ pc . green ( 'notice' ) }- Sourcemaps generation have been disabled through NEXT_DISABLE_SOURCEMAPS` ) ; } const { createSecureHeaders } = require ( 'next-secure-headers' ) ; const secureHeaders = createSecureHeaders ( { contentSecurityPolicy : { directives : { } , } , ... ( isProd ? { forceHTTPSRedirect : [ true , { maxAge : 60 * 60 * 24 * 4 , includeSubDomains : true } , ] , } : { } ) , referrerPolicy : 'same-origin' , } ) ; type { import ( 'next' ) . NextConfig } const nextConfig = { reactStrictMode : true , productionBrowserSourceMaps : ! disableSourceMaps , optimizeFonts : true , httpAgentOptions : { keepAlive : true , } , outputFileTracing : true , swcMinify : false , experimental : { reactRoot : true , concurrentFeatures : true , serverComponents : true , esmExternals : true , externalDir : true , } , typescript : { ignoreBuildErrors : NEXTJS_IGNORE_TYPECHECK , } , eslint : { ignoreDuringBuilds : NEXTJS_IGNORE_ESLINT , dirs : [ 'src' ] , } , async headers ( ) { todo return [ ] ; } , link images : { loader : 'default' , deviceSizes : [ 640 , 750 , 828 , 1080 , 1200 , 1920 , 2048 , 3840 ] , imageSizes : [ 16 , 32 , 48 , 64 , 96 , 128 , 256 , 384 ] , disableStaticImages : false , minimumCacheTTL : 60 , domains : [ 'source.unsplash.com' ] , } , webpack : ( config , { isServer } ) => { if ( isServer ) { } config . module . rules . push ( { test : /\.svg$/ , issuer : /\.(js|ts)x?$/ , use : [ { loader : '@svgr/webpack' , options : { svgo : true , svgoConfig : { multipass : false , datauri : 'base64' , js2svg : { indent : 2 , pretty : false , } , } , } , } , ] , } ) ; return config ; } , env : { APP_NAME : packageJson . name , APP_VERSION : packageJson . version , BUILD_TIME : new Date ( ) . getTime ( ) . toString ( 10 ) , } , } ; const config = withNextTranspileModules ( nextConfig ) ; if ( process . env . ANALYZE === 'true' ) { const withBundleAnalyzer = require ( '@next/bundle-analyzer' ) ( { enabled : true , } ) ; module . exports = withBundleAnalyzer ( config ) ; } else { module . exports = config ; }