UNPKG

29.6 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../../../next-server/server/config.ts"],"names":["targets","experimentalWarning","Log","warn","chalk","bold","console","assignDefaults","userConfig","exportTrailingSlash","yellow","trailingSlash","experimental","reactMode","reactRoot","includes","config","Object","keys","reduce","currentConfig","key","value","undefined","defaultConfig","Error","userDistDir","trim","length","Array","isArray","forEach","ext","constructor","c","k","v","result","assetPrefix","basePath","startsWith","endsWith","amp","canonicalBase","images","domains","invalid","filter","d","join","deviceSizes","imageSizes","loader","VALID_LOADERS","path","imageConfigDefault","i18n","i18nType","locales","defaultLocaleType","defaultLocale","invalidDomainItems","item","domain","hasInvalidLocale","locale","domainItem","map","JSON","stringify","invalidLocales","String","localeDetectionType","localeDetection","loadConfig","phase","dir","customConfig","PHASE_DEVELOPMENT_SERVER","configOrigin","CONFIG_FILE","cwd","userConfigModule","require","default","target","slice","hasNextSupport","process","env","NEXT_PRIVATE_TARGET","configFile","configBaseName","nonJsPath","findUp","sync","isTargetLikeServerless","isServerless","isServerlessTrace"],"mappings":"sKAAA,oDACA,0EACA,0BACA,mEACA,+CACA,2CACA,mCACA,6C,oJACA,2CACA,2CACA,8B,w4BAIA,KAAMA,CAAAA,OAAO,CAAG,CAAC,QAAD,CAAW,YAAX,CAAyB,+BAAzB,CAAhB,CAEA,KAAMC,CAAAA,mBAAmB,CAAG,oBAAS,IAAM,CACzCC,GAAG,CAACC,IAAJ,CAASC,eAAMC,IAAN,CAAW,2CAAX,CAAT,EACAH,GAAG,CAACC,IAAJ,CACG,4GAAD,CACG,4BAFL,EAIAG,OAAO,CAACH,IAAR,GACD,CAP2B,CAA5B,CASA,QAASI,CAAAA,cAAT,CAAwBC,UAAxB,CAA4D,2BAC1D,GAAI,MAAOA,CAAAA,UAAU,CAACC,mBAAlB,GAA0C,WAA9C,CAA2D,CACzDH,OAAO,CAACH,IAAR,CACEC,eAAMM,MAAN,CAAaL,IAAb,CAAkB,WAAlB,EACE,0GAFJ,EAIA,GAAI,M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F,CAED,MAAOrE,4BAAP,CACD,CAEM,QAASwE,CAAAA,sBAAT,CAAgCX,MAAhC,CAAgD,CACrD,KAAMY,CAAAA,YAAY,CAAGZ,MAAM,GAAK,YAAhC,CACA,KAAMa,CAAAA,iBAAiB,CAAGb,MAAM,GAAK,+BAArC,CACA,MAAOY,CAAAA,YAAY,EAAIC,iBAAvB,CACD","sourcesContent":["import chalk from 'chalk'\nimport findUp from 'next/dist/compiled/find-up'\nimport { basename, extname } from 'path'\nimport * as Log from '../../build/output/log'\nimport { hasNextSupport } from '../../telemetry/ci-info'\nimport { CONFIG_FILE, PHASE_DEVELOPMENT_SERVER } from '../lib/constants'\nimport { execOnce } from '../lib/utils'\nimport { defaultConfig, normalizeConfig } from './config-shared'\nimport { loadWebpackHook } from './config-utils'\nimport { ImageConfig, imageConfigDefault, VALID_LOADERS } from './image-config'\nimport { loadEnvConfig } from '@next/env'\n\nexport { DomainLocales, NextConfig, normalizeConfig } from './config-shared'\n\nconst targets = ['server', 'serverless', 'experimental-serverless-trace']\n\nconst experimentalWarning = execOnce(() => {\n Log.warn(chalk.bold('You have enabled experimental feature(s).'))\n Log.warn(\n `Experimental features are not covered by semver, and may cause unexpected or broken application behavior. ` +\n `Use them at your own risk.`\n )\n console.warn()\n})\n\nfunction assignDefaults(userConfig: { [key: string]: any }) {\n if (typeof userConfig.exportTrailingSlash !== 'undefined') {\n console.warn(\n chalk.yellow.bold('Warning: ') +\n 'The \"exportTrailingSlash\" option has been renamed to \"trailingSlash\". Please update your next.config.js.'\n )\n if (typeof userConfig.trailingSlash === 'undefined') {\n userConfig.trailingSlash = userConfig.exportTrailingSlash\n }\n delete userConfig.exportTrailingSlash\n }\n\n if (typeof userConfig.experimental?.reactMode !== 'undefined') {\n console.warn(\n chalk.yellow.bold('Warning: ') +\n 'The experimental \"reactMode\" option has been replaced with \"reactRoot\". Please update your next.config.js.'\n )\n if (typeof userConfig.experimental?.reactRoot === 'undefined') {\n userConfig.experimental.reactRoot = ['concurrent', 'blocking'].includes(\n userConfig.experimental.reactMode\n )\n }\n delete userConfig.experimental.reactMode\n }\n\n const config = Object.keys(userConfig).reduce<{ [key: string]: any }>(\n (currentConfig, key) => {\n const value = userConfig[key]\n\n if (value === undefined || value === null) {\n return currentConfig\n }\n\n if (\n key === 'experimental' &&\n value !== undefined &&\n value !== defaultConfig[key]\n ) {\n experimentalWarning()\n }\n\n if (key === 'distDir') {\n if (typeof value !== 'string') {\n throw new Error(\n `Specified distDir is not a string, found type \"${typeof value}\"`\n )\n }\n const userDistDir = value.trim()\n\n // don't allow public as the distDir as this is a reserved folder for\n // public files\n if (userDistDir === 'public') {\n throw new Error(\n `The 'public' directory is reserved in Next.js and can not be set as the 'distDir'. https://nextjs.org/docs/messages/can-not-output-to-public`\n )\n }\n // make sure distDir isn't an empty string as it can result in the provided\n // directory being deleted in development mode\n if (userDistDir.length === 0) {\n throw new Error(\n `Invalid distDir provided, distDir can not be an empty string. Please remove this config or set it to undefined`\n )\n }\n }\n\n if (key === 'pageExtensions') {\n if (!Array.isArray(value)) {\n throw new Error(\n `Specified pageExtensions is not an array of strings, found \"${value}\". Please update this config or remove it.`\n )\n }\n\n if (!value.length) {\n throw new Error(\n `Specified pageExtensions is an empty array. Please update it with the relevant extensions or remove it.`\n )\n }\n\n value.forEach((ext) => {\n if (typeof ext !== 'string') {\n throw new Error(\n `Specified pageExtensions is not an array of strings, found \"${ext}\" of type \"${typeof ext}\". Please update this config or remove it.`\n )\n }\n })\n }\n\n if (!!value && value.constructor === Object) {\n currentConfig[key] = {\n ...defaultConfig[key],\n ...Object.keys(value).reduce<any>((c, k) => {\n const v = value[k]\n if (v !== undefined && v !== null) {\n c[k] = v\n }\n return c\n }, {}),\n }\n } else {\n currentConfig[key] = value\n }\n\n return currentConfig\n },\n {}\n )\n\n const result = { ...defaultConfig, ...config }\n\n if (typeof result.assetPrefix !== 'string') {\n throw new Error(\n `Specified assetPrefix is not a string, found type \"${typeof result.assetPrefix}\" https://nextjs.org/docs/messages/invalid-assetprefix`\n )\n }\n\n if (typeof result.basePath !== 'string') {\n throw new Error(\n `Specified basePath is not a string, found type \"${typeof result.basePath}\"`\n )\n }\n\n if (result.basePath !== '') {\n if (result.basePath === '/') {\n throw new Error(\n `Specified basePath /. basePath has to be either an empty string or a path prefix\"`\n )\n }\n\n if (!result.basePath.startsWith('/')) {\n throw new Error(\n `Specified basePath has to start with a /, found \"${result.basePath}\"`\n )\n }\n\n if (result.basePath !== '/') {\n if (result.basePath.endsWith('/')) {\n throw new Error(\n `Specified basePath should not end with /, found \"${result.basePath}\"`\n )\n }\n\n if (result.assetPrefix === '') {\n result.assetPrefix = result.basePath\n }\n\n if (result.amp.canonicalBase === '') {\n result.amp.canonicalBase = result.basePath\n }\n }\n }\n\n if (result?.images) {\n const images: Partial<ImageConfig> = result.images\n\n if (typeof images !== 'object') {\n throw new Error(\n `Specified images should be an object received ${typeof images}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n )\n }\n\n if (images.domains) {\n if (!Array.isArray(images.domains)) {\n throw new Error(\n `Specified images.domains should be an Array received ${typeof images.domains}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n )\n }\n\n if (images.domains.length > 50) {\n throw new Error(\n `Specified images.domains exceeds length of 50, received length (${images.domains.length}), please reduce the length of the array to continue.\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n )\n }\n\n const invalid = images.domains.filter(\n (d: unknown) => typeof d !== 'string'\n )\n if (invalid.length > 0) {\n throw new Error(\n `Specified images.domains should be an Array of strings received invalid values (${invalid.join(\n ', '\n )}).\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n )\n }\n }\n if (images.deviceSizes) {\n const { deviceSizes } = images\n if (!Array.isArray(deviceSizes)) {\n throw new Error(\n `Specified images.deviceSizes should be an Array received ${typeof deviceSizes}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n )\n }\n\n if (deviceSizes.length > 25) {\n throw new Error(\n `Specified images.deviceSizes exceeds length of 25, received length (${deviceSizes.length}), please reduce the length of the array to continue.\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n )\n }\n\n const invalid = deviceSizes.filter((d: unknown) => {\n return typeof d !== 'number' || d < 1 || d > 10000\n })\n\n if (invalid.length > 0) {\n throw new Error(\n `Specified images.deviceSizes should be an Array of numbers that are between 1 and 10000, received invalid values (${invalid.join(\n ', '\n )}).\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n )\n }\n }\n if (images.imageSizes) {\n const { imageSizes } = images\n if (!Array.isArray(imageSizes)) {\n throw new Error(\n `Specified images.imageSizes should be an Array received ${typeof imageSizes}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n )\n }\n\n if (imageSizes.length > 25) {\n throw new Error(\n `Specified images.imageSizes exceeds length of 25, received length (${imageSizes.length}), please reduce the length of the array to continue.\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n )\n }\n\n const invalid = imageSizes.filter((d: unknown) => {\n return typeof d !== 'number' || d < 1 || d > 10000\n })\n\n if (invalid.length > 0) {\n throw new Error(\n `Specified images.imageSizes should be an Array of numbers that are between 1 and 10000, received invalid values (${invalid.join(\n ', '\n )}).\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n )\n }\n }\n\n if (!images.loader) {\n images.loader = 'default'\n }\n\n if (!VALID_LOADERS.includes(images.loader)) {\n throw new Error(\n `Specified images.loader should be one of (${VALID_LOADERS.join(\n ', '\n )}), received invalid value (${\n images.loader\n }).\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n )\n }\n\n // Append trailing slash for non-default loaders\n if (images.path) {\n if (\n images.loader !== 'default' &&\n images.path[images.path.length - 1] !== '/'\n ) {\n images.path += '/'\n }\n }\n\n if (images.path === imageConfigDefault.path && result.basePath) {\n images.path = `${result.basePath}${images.path}`\n }\n }\n\n if (result.i18n) {\n const { i18n } = result\n const i18nType = typeof i18n\n\n if (i18nType !== 'object') {\n throw new Error(\n `Specified i18n should be an object received ${i18nType}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n\n if (!Array.isArray(i18n.locales)) {\n throw new Error(\n `Specified i18n.locales should be an Array received ${typeof i18n.locales}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n\n const defaultLocaleType = typeof i18n.defaultLocale\n\n if (!i18n.defaultLocale || defaultLocaleType !== 'string') {\n throw new Error(\n `Specified i18n.defaultLocale should be a string.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n\n if (typeof i18n.domains !== 'undefined' && !Array.isArray(i18n.domains)) {\n throw new Error(\n `Specified i18n.domains must be an array of domain objects e.g. [ { domain: 'example.fr', defaultLocale: 'fr', locales: ['fr'] } ] received ${typeof i18n.domains}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n\n if (i18n.domains) {\n const invalidDomainItems = i18n.domains.filter((item) => {\n if (!item || typeof item !== 'object') return true\n if (!item.defaultLocale) return true\n if (!item.domain || typeof item.domain !== 'string') return true\n\n let hasInvalidLocale = false\n\n if (Array.isArray(item.locales)) {\n for (const locale of item.locales) {\n if (typeof locale !== 'string') hasInvalidLocale = true\n\n for (const domainItem of i18n.domains || []) {\n if (domainItem === item) continue\n if (domainItem.locales && domainItem.locales.includes(locale)) {\n console.warn(\n `Both ${item.domain} and ${domainItem.domain} configured the locale (${locale}) but only one can. Remove it from one i18n.domains config to continue`\n )\n hasInvalidLocale = true\n break\n }\n }\n }\n }\n\n return hasInvalidLocale\n })\n\n if (invalidDomainItems.length > 0) {\n throw new Error(\n `Invalid i18n.domains values:\\n${invalidDomainItems\n .map((item: any) => JSON.stringify(item))\n .join(\n '\\n'\n )}\\n\\ndomains value must follow format { domain: 'example.fr', defaultLocale: 'fr', locales: ['fr'] }.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n }\n\n if (!Array.isArray(i18n.locales)) {\n throw new Error(\n `Specified i18n.locales must be an array of locale strings e.g. [\"en-US\", \"nl-NL\"] received ${typeof i18n.locales}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n\n const invalidLocales = i18n.locales.filter(\n (locale: any) => typeof locale !== 'string'\n )\n\n if (invalidLocales.length > 0) {\n throw new Error(\n `Specified i18n.locales contains invalid values (${invalidLocales\n .map(String)\n .join(\n ', '\n )}), locales must be valid locale tags provided as strings e.g. \"en-US\".\\n` +\n `See here for list of valid language sub-tags: http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry`\n )\n }\n\n if (!i18n.locales.includes(i18n.defaultLocale)) {\n throw new Error(\n `Specified i18n.defaultLocale should be included in i18n.locales.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n\n // make sure default Locale is at the front\n i18n.locales = [\n i18n.defaultLocale,\n ...i18n.locales.filter((locale) => locale !== i18n.defaultLocale),\n ]\n\n const localeDetectionType = typeof i18n.localeDetection\n\n if (\n localeDetectionType !== 'boolean' &&\n localeDetectionType !== 'undefined'\n ) {\n throw new Error(\n `Specified i18n.localeDetection should be undefined or a boolean received ${localeDetectionType}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n )\n }\n }\n\n return result\n}\n\nexport default async function loadConfig(\n phase: string,\n dir: string,\n customConfig?: object | null\n) {\n await loadEnvConfig(dir, phase === PHASE_DEVELOPMENT_SERVER, Log)\n await loadWebpackHook(phase, dir)\n\n if (customConfig) {\n return assignDefaults({ configOrigin: 'server', ...customConfig })\n }\n\n const path = await findUp(CONFIG_FILE, { cwd: dir })\n\n // If config file was found\n if (path?.length) {\n const userConfigModule = require(path)\n const userConfig = normalizeConfig(\n phase,\n userConfigModule.default || userConfigModule\n )\n\n if (Object.keys(userConfig).length === 0) {\n Log.warn(\n 'Detected next.config.js, no exported configuration found. https://nextjs.org/docs/messages/empty-configuration'\n )\n }\n\n if (userConfig.target && !targets.includes(userConfig.target)) {\n throw new Error(\n `Specified target is invalid. Provided: \"${\n userConfig.target\n }\" should be one of ${targets.join(', ')}`\n )\n }\n\n if (userConfig.amp?.canonicalBase) {\n const { canonicalBase } = userConfig.amp || ({} as any)\n userConfig.amp = userConfig.amp || {}\n userConfig.amp.canonicalBase =\n (canonicalBase.endsWith('/')\n ? canonicalBase.slice(0, -1)\n : canonicalBase) || ''\n }\n\n if (hasNextSupport) {\n userConfig.target = process.env.NEXT_PRIVATE_TARGET || 'server'\n }\n\n return assignDefaults({\n configOrigin: CONFIG_FILE,\n configFile: path,\n ...userConfig,\n })\n } else {\n const configBaseName = basename(CONFIG_FILE, extname(CONFIG_FILE))\n const nonJsPath = findUp.sync(\n [\n `${configBaseName}.jsx`,\n `${configBaseName}.ts`,\n `${configBaseName}.tsx`,\n `${configBaseName}.json`,\n ],\n { cwd: dir }\n )\n if (nonJsPath?.length) {\n throw new Error(\n `Configuring Next.js via '${basename(\n nonJsPath\n )}' is not supported. Please replace the file with 'next.config.js'.`\n )\n }\n }\n\n return defaultConfig\n}\n\nexport function isTargetLikeServerless(target: string) {\n const isServerless = target === 'serverless'\n const isServerlessTrace = target === 'experimental-serverless-trace'\n return isServerless || isServerlessTrace\n}\n"]}
\No newline at end of file