next 15.3.0-canary.2 → 15.3.0-canary.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/next +1 -1
- package/dist/build/index.js +10 -2
- package/dist/build/index.js.map +1 -1
- package/dist/build/swc/index.js +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/components/react-dev-overlay/app/hot-reloader-client.js +10 -33
- package/dist/client/components/react-dev-overlay/app/hot-reloader-client.js.map +1 -1
- package/dist/client/components/react-dev-overlay/pages/hot-reloader-client.d.ts +1 -2
- package/dist/client/components/react-dev-overlay/pages/hot-reloader-client.js +13 -39
- package/dist/client/components/react-dev-overlay/pages/hot-reloader-client.js.map +1 -1
- package/dist/client/components/react-dev-overlay/shared.d.ts +3 -0
- package/dist/client/components/react-dev-overlay/shared.js +12 -0
- package/dist/client/components/react-dev-overlay/shared.js.map +1 -1
- package/dist/client/components/react-dev-overlay/utils/report-hmr-latency.d.ts +6 -0
- package/dist/client/components/react-dev-overlay/utils/report-hmr-latency.js +36 -0
- package/dist/client/components/react-dev-overlay/utils/report-hmr-latency.js.map +1 -0
- package/dist/client/dev/amp-dev.js +2 -2
- package/dist/client/dev/amp-dev.js.map +1 -1
- package/dist/client/dev/hot-middleware-client.d.ts +1 -1
- package/dist/client/dev/hot-middleware-client.js +2 -2
- package/dist/client/dev/hot-middleware-client.js.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/next-dev-turbopack.js +1 -1
- package/dist/client/next-dev-turbopack.js.map +1 -1
- package/dist/client/next-dev.js +1 -1
- package/dist/client/next-dev.js.map +1 -1
- package/dist/compiled/next-server/app-page-experimental.runtime.dev.js +3 -3
- package/dist/compiled/next-server/app-page-experimental.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/app-page.runtime.dev.js +3 -3
- package/dist/compiled/next-server/app-page.runtime.dev.js.map +1 -1
- package/dist/esm/build/index.js +10 -2
- package/dist/esm/build/index.js.map +1 -1
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/components/react-dev-overlay/app/hot-reloader-client.js +10 -33
- package/dist/esm/client/components/react-dev-overlay/app/hot-reloader-client.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/pages/hot-reloader-client.js +14 -40
- package/dist/esm/client/components/react-dev-overlay/pages/hot-reloader-client.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/shared.js +4 -0
- package/dist/esm/client/components/react-dev-overlay/shared.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/utils/report-hmr-latency.js +20 -0
- package/dist/esm/client/components/react-dev-overlay/utils/report-hmr-latency.js.map +1 -0
- package/dist/esm/client/dev/amp-dev.js +2 -2
- package/dist/esm/client/dev/amp-dev.js.map +1 -1
- package/dist/esm/client/dev/hot-middleware-client.js +2 -2
- package/dist/esm/client/dev/hot-middleware-client.js.map +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/client/next-dev-turbopack.js +1 -1
- package/dist/esm/client/next-dev-turbopack.js.map +1 -1
- package/dist/esm/client/next-dev.js +1 -1
- package/dist/esm/client/next-dev.js.map +1 -1
- package/dist/esm/server/config-schema.js +2 -1
- package/dist/esm/server/config-schema.js.map +1 -1
- package/dist/esm/server/config-shared.js +2 -1
- package/dist/esm/server/config-shared.js.map +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/router-server.js +1 -1
- package/dist/esm/server/lib/router-server.js.map +1 -1
- package/dist/esm/server/lib/router-utils/block-cross-site.js +5 -1
- package/dist/esm/server/lib/router-utils/block-cross-site.js.map +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/shared/lib/canary-only.js +1 -1
- package/dist/server/config-schema.js +2 -1
- package/dist/server/config-schema.js.map +1 -1
- package/dist/server/config-shared.d.ts +2 -1
- package/dist/server/config-shared.js +2 -1
- package/dist/server/config-shared.js.map +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/router-server.js +1 -1
- package/dist/server/lib/router-server.js.map +1 -1
- package/dist/server/lib/router-utils/block-cross-site.js +5 -1
- package/dist/server/lib/router-utils/block-cross-site.js.map +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/shared/lib/canary-only.js +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +15 -15
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/server/config-shared.ts"],"sourcesContent":["import os from 'os'\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport type { Header, Redirect, Rewrite } from '../lib/load-custom-routes'\nimport { imageConfigDefault } from '../shared/lib/image-config'\nimport type {\n ImageConfig,\n ImageConfigComplete,\n} from '../shared/lib/image-config'\nimport type { SubresourceIntegrityAlgorithm } from '../build/webpack/plugins/subresource-integrity-plugin'\nimport type { WEB_VITALS } from '../shared/lib/utils'\nimport type { NextParsedUrlQuery } from './request-meta'\nimport type { SizeLimit } from '../types'\nimport type { SupportedTestRunners } from '../cli/next-test'\nimport type { ExperimentalPPRConfig } from './lib/experimental/ppr'\nimport { INFINITE_CACHE } from '../lib/constants'\n\nexport type NextConfigComplete = Required<NextConfig> & {\n images: Required<ImageConfigComplete>\n typescript: Required<TypeScriptConfig>\n configOrigin?: string\n configFile?: string\n configFileName: string\n // override NextConfigComplete.experimental.htmlLimitedBots to string\n // because it's not defined in NextConfigComplete.experimental\n htmlLimitedBots: string | undefined\n experimental: ExperimentalConfig\n}\n\nexport type I18NDomains = readonly DomainLocale[]\n\nexport interface I18NConfig {\n defaultLocale: string\n domains?: I18NDomains\n localeDetection?: false\n locales: readonly string[]\n}\n\nexport interface DomainLocale {\n defaultLocale: string\n domain: string\n http?: true\n locales?: readonly string[]\n}\n\nexport interface ESLintConfig {\n /** Only run ESLint on these directories with `next lint` and `next build`. */\n dirs?: string[]\n /** Do not run ESLint during production builds (`next build`). */\n ignoreDuringBuilds?: boolean\n}\n\nexport interface TypeScriptConfig {\n /** Do not run TypeScript during production builds (`next build`). */\n ignoreBuildErrors?: boolean\n /** Relative path to a custom tsconfig file */\n tsconfigPath?: string\n}\n\nexport interface EmotionConfig {\n sourceMap?: boolean\n autoLabel?: 'dev-only' | 'always' | 'never'\n labelFormat?: string\n importMap?: {\n [importName: string]: {\n [exportName: string]: {\n canonicalImport?: [string, string]\n styledBaseImport?: [string, string]\n }\n }\n }\n}\n\nexport interface StyledComponentsConfig {\n /**\n * Enabled by default in development, disabled in production to reduce file size,\n * setting this will override the default for all environments.\n */\n displayName?: boolean\n topLevelImportPaths?: string[]\n ssr?: boolean\n fileName?: boolean\n meaninglessFileNames?: string[]\n minify?: boolean\n transpileTemplateLiterals?: boolean\n namespace?: string\n pure?: boolean\n cssProp?: boolean\n}\n\ntype JSONValue =\n | string\n | number\n | boolean\n | JSONValue[]\n | { [k: string]: JSONValue }\n\nexport type TurboLoaderItem =\n | string\n | {\n loader: string\n // At the moment, Turbopack options must be JSON-serializable, so restrict values.\n options: Record<string, JSONValue>\n }\n\nexport type TurboRuleConfigItemOrShortcut =\n | TurboLoaderItem[]\n | TurboRuleConfigItem\n\nexport type TurboRuleConfigItemOptions = {\n loaders: TurboLoaderItem[]\n as?: string\n}\n\nexport type TurboRuleConfigItem =\n | TurboRuleConfigItemOptions\n | { [condition: string]: TurboRuleConfigItem }\n | false\n\nexport interface ExperimentalTurboOptions {\n /**\n * (`next --turbopack` only) A mapping of aliased imports to modules to load in their place.\n *\n * @see [Resolve Alias](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#resolve-alias)\n */\n resolveAlias?: Record<\n string,\n string | string[] | Record<string, string | string[]>\n >\n\n /**\n * (`next --turbopack` only) A list of extensions to resolve when importing files.\n *\n * @see [Resolve Extensions](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#resolve-extensions)\n */\n resolveExtensions?: string[]\n\n /**\n * (`next --turbopack` only) A list of webpack loaders to apply when running with Turbopack.\n *\n * @see [Turbopack Loaders](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#webpack-loaders)\n */\n loaders?: Record<string, TurboLoaderItem[]>\n\n /**\n * (`next --turbopack` only) A list of webpack loaders to apply when running with Turbopack.\n *\n * @see [Turbopack Loaders](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#webpack-loaders)\n */\n rules?: Record<string, TurboRuleConfigItemOrShortcut>\n\n /**\n * A target memory limit for turbo, in bytes.\n */\n memoryLimit?: number\n\n /**\n * Enable persistent caching for the turbopack dev server and build.\n */\n unstablePersistentCaching?: boolean\n\n /**\n * Enable tree shaking for the turbopack dev server and build.\n */\n treeShaking?: boolean\n\n /**\n * The module ID strategy to use for Turbopack.\n * If not set, the default is `'named'` for development and `'deterministic'`\n * for production.\n */\n moduleIdStrategy?: 'named' | 'deterministic'\n\n /**\n * This is the repo root usually and only files above this\n * directory can be resolved by turbopack.\n */\n root?: string\n\n /**\n * Enable minification. Defaults to true in build mode and false in dev mode.\n */\n minify?: boolean\n\n /**\n * Enable source maps. Defaults to true.\n */\n sourceMaps?: boolean\n}\n\nexport interface WebpackConfigContext {\n /** Next.js root directory */\n dir: string\n /** Indicates if the compilation will be done in development */\n dev: boolean\n /** It's `true` for server-side compilation, and `false` for client-side compilation */\n isServer: boolean\n /** The build id, used as a unique identifier between builds */\n buildId: string\n /** The next.config.js merged with default values */\n config: NextConfigComplete\n /** Default loaders used internally by Next.js */\n defaultLoaders: {\n /** Default babel-loader configuration */\n babel: any\n }\n /** Number of total Next.js pages */\n totalPages: number\n /** The webpack configuration */\n webpack: any\n /** The current server runtime */\n nextRuntime?: 'nodejs' | 'edge'\n}\n\nexport interface NextJsWebpackConfig {\n (\n /** Existing Webpack config */\n config: any,\n context: WebpackConfigContext\n ): any\n}\n\n/**\n * Set of options for the react compiler next.js\n * currently supports.\n *\n * This can be changed without breaking changes while supporting\n * react compiler in the experimental phase.\n */\nexport interface ReactCompilerOptions {\n compilationMode?: 'infer' | 'annotation' | 'all'\n panicThreshold?: 'ALL_ERRORS' | 'CRITICAL_ERRORS' | 'NONE'\n}\n\nexport interface IncomingRequestLoggingConfig {\n /**\n * A regular expression array to match incoming requests that should not be logged.\n * You can specify multiple patterns to match incoming requests that should not be logged.\n */\n ignore?: RegExp[]\n}\n\nexport interface LoggingConfig {\n fetches?: {\n fullUrl?: boolean\n /**\n * If true, fetch requests that are restored from the HMR cache are logged\n * during an HMR refresh request, i.e. when editing a server component.\n */\n hmrRefreshes?: boolean\n }\n\n /**\n * If set to false, incoming request logging is disabled.\n * You can specify a pattern to match incoming requests that should not be logged.\n */\n incomingRequests?: boolean | IncomingRequestLoggingConfig\n}\n\nexport interface ExperimentalConfig {\n allowedDevOrigins?: string[]\n nodeMiddleware?: boolean\n cacheHandlers?: {\n default?: string\n remote?: string\n static?: string\n [handlerName: string]: string | undefined\n }\n multiZoneDraftMode?: boolean\n appNavFailHandling?: boolean\n prerenderEarlyExit?: boolean\n linkNoTouchStart?: boolean\n caseSensitiveRoutes?: boolean\n clientSegmentCache?: boolean\n appDocumentPreloading?: boolean\n preloadEntriesOnStart?: boolean\n /** @default true */\n strictNextHead?: boolean\n clientRouterFilter?: boolean\n clientRouterFilterRedirects?: boolean\n /**\n * This config can be used to override the cache behavior for the client router.\n * These values indicate the time, in seconds, that the cache should be considered\n * reusable. When the `prefetch` Link prop is left unspecified, this will use the `dynamic` value.\n * When the `prefetch` Link prop is set to `true`, this will use the `static` value.\n */\n staleTimes?: {\n dynamic?: number\n static?: number\n }\n cacheLife?: {\n [profile: string]: {\n // How long the client can cache a value without checking with the server.\n stale?: number\n // How frequently you want the cache to refresh on the server.\n // Stale values may be served while revalidating.\n revalidate?: number\n // In the worst case scenario, where you haven't had traffic in a while,\n // how stale can a value be until you prefer deopting to dynamic.\n // Must be longer than revalidate.\n expire?: number\n }\n }\n // decimal for percent for possible false positives\n // e.g. 0.01 for 10% potential false matches lower\n // percent increases size of the filter\n clientRouterFilterAllowedRate?: number\n externalMiddlewareRewritesResolve?: boolean\n extensionAlias?: Record<string, any>\n allowedRevalidateHeaderKeys?: string[]\n fetchCacheKeyPrefix?: string\n imgOptConcurrency?: number | null\n imgOptTimeoutInSeconds?: number\n imgOptMaxInputPixels?: number\n imgOptSequentialRead?: boolean | null\n optimisticClientCache?: boolean\n /**\n * @deprecated use config.expireTime instead\n */\n expireTime?: number\n middlewarePrefetch?: 'strict' | 'flexible'\n manualClientBasePath?: boolean\n /**\n * CSS Chunking strategy. Defaults to `true` (\"loose\" mode), which guesses dependencies\n * between CSS files to keep ordering of them.\n * An alternative is 'strict', which will try to keep correct ordering as\n * much as possible, even when this leads to many requests.\n */\n cssChunking?: boolean | 'strict'\n disablePostcssPresetEnv?: boolean\n cpus?: number\n memoryBasedWorkersCount?: boolean\n proxyTimeout?: number\n isrFlushToDisk?: boolean\n workerThreads?: boolean\n // optimizeCss can be boolean or critters' option object\n // Use Record<string, unknown> as critters doesn't export its Option type\n // https://github.com/GoogleChromeLabs/critters/blob/a590c05f9197b656d2aeaae9369df2483c26b072/packages/critters/src/index.d.ts\n optimizeCss?: boolean | Record<string, unknown>\n nextScriptWorkers?: boolean\n scrollRestoration?: boolean\n externalDir?: boolean\n amp?: {\n optimizer?: any\n validator?: string\n skipValidation?: boolean\n }\n disableOptimizedLoading?: boolean\n gzipSize?: boolean\n craCompat?: boolean\n esmExternals?: boolean | 'loose'\n fullySpecified?: boolean\n urlImports?: NonNullable<webpack.Configuration['experiments']>['buildHttp']\n swcTraceProfiling?: boolean\n forceSwcTransforms?: boolean\n\n swcPlugins?: Array<[string, Record<string, unknown>]>\n largePageDataBytes?: number\n /**\n * If set to `false`, webpack won't fall back to polyfill Node.js modules in the browser\n * Full list of old polyfills is accessible here:\n * [webpack/webpack#ModuleNotoundError.js#L13-L42](https://github.com/webpack/webpack/blob/2a0536cf510768111a3a6dceeb14cb79b9f59273/lib/ModuleNotFoundError.js#L13-L42)\n */\n fallbackNodePolyfills?: false\n sri?: {\n algorithm?: SubresourceIntegrityAlgorithm\n }\n\n webVitalsAttribution?: Array<(typeof WEB_VITALS)[number]>\n\n /**\n * Automatically apply the \"modularizeImports\" optimization to imports of the specified packages.\n */\n optimizePackageImports?: string[]\n\n /**\n * Optimize React APIs for server builds.\n */\n optimizeServerReact?: boolean\n\n turbo?: ExperimentalTurboOptions\n\n /**\n * For use with `@next/mdx`. Compile MDX files using the new Rust compiler.\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/mdxRs\n */\n mdxRs?:\n | boolean\n | {\n development?: boolean\n jsx?: boolean\n jsxRuntime?: string\n jsxImportSource?: string\n providerImportSource?: string\n mdxType?: 'gfm' | 'commonmark'\n }\n\n /**\n * Generate Route types and enable type checking for Link and Router.push, etc.\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/typedRoutes\n */\n typedRoutes?: boolean\n\n /**\n * Enable type-checking and autocompletion for environment variables.\n *\n * @default false\n */\n typedEnv?: boolean\n\n /**\n * Runs the compilations for server and edge in parallel instead of in serial.\n * This will make builds faster if there is enough server and edge functions\n * in the application at the cost of more memory.\n *\n * NOTE: This option is only valid when the build process can use workers. See\n * the documentation for `webpackBuildWorker` for more details.\n */\n parallelServerCompiles?: boolean\n\n /**\n * Runs the logic to collect build traces for the server routes in parallel\n * with other work during the compilation. This will increase the speed of\n * the build at the cost of more memory. This option may incur some additional\n * work compared to if the option was disabled since the work is started\n * before data from the client compilation is available to potentially reduce\n * the amount of code that needs to be traced. Despite that, this may still\n * result in faster builds for some applications.\n *\n * Valid values are:\n * - `true`: Collect the server build traces in parallel.\n * - `false`: Do not collect the server build traces in parallel.\n * - `undefined`: Collect server build traces in parallel only in the `experimental-compile` mode.\n *\n * NOTE: This option is only valid when the build process can use workers. See\n * the documentation for `webpackBuildWorker` for more details.\n */\n parallelServerBuildTraces?: boolean\n\n /**\n * Run the Webpack build in a separate process to optimize memory usage during build.\n * Valid values are:\n * - `false`: Disable the Webpack build worker\n * - `true`: Enable the Webpack build worker\n * - `undefined`: Enable the Webpack build worker only if the webpack config is not customized\n */\n webpackBuildWorker?: boolean\n\n /**\n * Enables optimizations to reduce memory usage in Webpack. This reduces the max size of the heap\n * but may increase compile times slightly.\n * Valid values are:\n * - `false`: Disable Webpack memory optimizations (default).\n * - `true`: Enables Webpack memory optimizations.\n */\n webpackMemoryOptimizations?: boolean\n\n /**\n * The array of the meta tags to the client injected by tracing propagation data.\n */\n clientTraceMetadata?: string[]\n\n /**\n * Enables experimental Partial Prerendering feature of Next.js.\n * Using this feature will enable the `react@experimental` for the `app` directory.\n */\n ppr?: ExperimentalPPRConfig\n\n /**\n * Enables experimental taint APIs in React.\n * Using this feature will enable the `react@experimental` for the `app` directory.\n */\n taint?: boolean\n\n serverActions?: {\n /**\n * Allows adjusting body parser size limit for server actions.\n */\n bodySizeLimit?: SizeLimit\n\n /**\n * Allowed origins that can bypass Server Action's CSRF check. This is helpful\n * when you have reverse proxy in front of your app.\n * @example\n * [\"my-app.com\", \"*.my-app.com\"]\n */\n allowedOrigins?: string[]\n }\n\n /**\n * enables the minification of server code.\n */\n serverMinification?: boolean\n\n /**\n * Enables source maps generation for the server production bundle.\n */\n serverSourceMaps?: boolean\n\n /**\n * @internal Used by the Next.js internals only.\n */\n trustHostHeader?: boolean\n\n useWasmBinary?: boolean\n\n /**\n * Use lightningcss instead of postcss-loader\n */\n useLightningcss?: boolean\n\n /**\n * Enables early import feature for app router modules\n */\n useEarlyImport?: boolean\n\n /**\n * Enables view transitions by using the {@link https://github.com/facebook/react/pull/31975 unstable_ViewTransition} Component.\n */\n viewTransition?: boolean\n\n /**\n * Enables `fetch` requests to be proxied to the experimental test proxy server\n */\n testProxy?: boolean\n\n /**\n * Set a default test runner to be used by `next experimental-test`.\n */\n defaultTestRunner?: SupportedTestRunners\n /**\n * Allow NODE_ENV=development even for `next build`.\n */\n allowDevelopmentBuild?: true\n /**\n * @deprecated use `config.bundlePagesRouterDependencies` instead\n *\n */\n bundlePagesExternals?: boolean\n /**\n * @deprecated use `config.serverExternalPackages` instead\n *\n */\n serverComponentsExternalPackages?: string[]\n /**\n * Enable experimental React compiler optimization.\n * Configuration accepts partial config object to the compiler, if provided\n * compiler will be enabled.\n */\n reactCompiler?: boolean | ReactCompilerOptions\n\n /**\n * The number of times to retry static generation (per page) before giving up.\n */\n staticGenerationRetryCount?: number\n\n /**\n * The amount of pages to export per worker during static generation.\n */\n staticGenerationMaxConcurrency?: number\n\n /**\n * The minimum number of pages to be chunked into each export worker.\n */\n staticGenerationMinPagesPerWorker?: number\n\n /**\n * Allows previously fetched data to be re-used when editing server components.\n */\n serverComponentsHmrCache?: boolean\n\n /**\n * When enabled will cause IO in App Router to be excluded from prerenders\n * unless explicitly cached.\n */\n dynamicIO?: boolean\n\n /**\n * Render <style> tags inline in the HTML for imported CSS assets.\n * Supports app-router in production mode only.\n */\n inlineCss?: boolean\n\n // TODO: Remove this config when the API is stable.\n /**\n * This config allows you to enable the experimental navigation API `forbidden` and `unauthorized`.\n */\n authInterrupts?: boolean\n\n /**\n * Enables the use of the `\"use cache\"` directive.\n */\n useCache?: boolean\n\n /**\n * Enables detection and reporting of slow modules during development builds.\n * Enabling this may impact build performance to ensure accurate measurements.\n */\n slowModuleDetection?: {\n /**\n * The time threshold in milliseconds for identifying slow modules.\n * Modules taking longer than this build time threshold will be reported.\n */\n buildTimeThresholdMs: number\n }\n}\n\nexport type ExportPathMap = {\n [path: string]: {\n page: string\n query?: NextParsedUrlQuery\n\n /**\n * When true, this indicates that this is a pages router page that should\n * be rendered as a fallback.\n *\n * @internal\n */\n _pagesFallback?: boolean\n\n /**\n * The locale that this page should be rendered in.\n *\n * @internal\n */\n _locale?: string\n\n /**\n * The path that was used to generate the page.\n *\n * @internal\n */\n _ssgPath?: string\n\n /**\n * The parameters that are currently unknown.\n *\n * @internal\n */\n _fallbackRouteParams?: readonly string[]\n\n /**\n * @internal\n */\n _isAppDir?: boolean\n\n /**\n * @internal\n */\n _isDynamicError?: boolean\n\n /**\n * @internal\n */\n _isRoutePPREnabled?: boolean\n\n /**\n * When true, it indicates that this page is being rendered in an attempt to\n * discover if the page will be safe to generate with PPR. This is only\n * enabled when the app has `experimental.dynamicIO` enabled but does not\n * have `experimental.ppr` enabled.\n *\n * @internal\n */\n _isProspectiveRender?: boolean\n }\n}\n\n/**\n * Next.js can be configured through a `next.config.js` file in the root of your project directory.\n *\n * This can change the behavior, enable experimental features, and configure other advanced options.\n *\n * Read more: [Next.js Docs: `next.config.js`](https://nextjs.org/docs/app/api-reference/config/next-config-js)\n */\nexport interface NextConfig extends Record<string, any> {\n exportPathMap?: (\n defaultMap: ExportPathMap,\n ctx: {\n dev: boolean\n dir: string\n outDir: string | null\n distDir: string\n buildId: string\n }\n ) => Promise<ExportPathMap> | ExportPathMap\n\n /**\n * Internationalization configuration\n *\n * @see [Internationalization docs](https://nextjs.org/docs/advanced-features/i18n-routing)\n */\n i18n?: I18NConfig | null\n\n /**\n * @since version 11\n * @see [ESLint configuration](https://nextjs.org/docs/app/api-reference/config/eslint)\n */\n eslint?: ESLintConfig\n\n /**\n * @see [Next.js TypeScript documentation](https://nextjs.org/docs/app/api-reference/config/typescript)\n */\n typescript?: TypeScriptConfig\n\n /**\n * Headers allow you to set custom HTTP headers for an incoming request path.\n *\n * @see [Headers configuration documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/headers)\n */\n headers?: () => Promise<Header[]>\n\n /**\n * Rewrites allow you to map an incoming request path to a different destination path.\n *\n * @see [Rewrites configuration documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/rewrites)\n */\n rewrites?: () => Promise<\n | Rewrite[]\n | {\n beforeFiles?: Rewrite[]\n afterFiles?: Rewrite[]\n fallback?: Rewrite[]\n }\n >\n\n /**\n * Redirects allow you to redirect an incoming request path to a different destination path.\n *\n * @see [Redirects configuration documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/redirects)\n */\n redirects?: () => Promise<Redirect[]>\n\n /**\n * @see [Moment.js locales excluded by default](https://nextjs.org/docs/upgrading#momentjs-locales-excluded-by-default)\n */\n excludeDefaultMomentLocales?: boolean\n\n /**\n * Before continuing to add custom webpack configuration to your application make sure Next.js doesn't already support your use-case\n *\n * @see [Custom Webpack Config documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/webpack)\n */\n webpack?: NextJsWebpackConfig | null\n\n /**\n * By default Next.js will redirect urls with trailing slashes to their counterpart without a trailing slash.\n *\n * @default false\n * @see [Trailing Slash Configuration](https://nextjs.org/docs/app/api-reference/config/next-config-js/trailingSlash)\n */\n trailingSlash?: boolean\n\n /**\n * Next.js comes with built-in support for environment variables\n *\n * @see [Environment Variables documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/env)\n */\n env?: Record<string, string | undefined>\n\n /**\n * Destination directory (defaults to `.next`)\n */\n distDir?: string\n\n /**\n * The build output directory (defaults to `.next`) is now cleared by default except for the Next.js caches.\n */\n cleanDistDir?: boolean\n\n /**\n * To set up a CDN, you can set up an asset prefix and configure your CDN's origin to resolve to the domain that Next.js is hosted on.\n *\n * @see [CDN Support with Asset Prefix](https://nextjs.org/docs/app/api-reference/config/next-config-js/assetPrefix)\n */\n assetPrefix?: string\n\n /**\n * The default cache handler for the Pages and App Router uses the filesystem cache. This requires no configuration, however, you can customize the cache handler if you prefer.\n *\n * @see [Configuring Caching](https://nextjs.org/docs/app/building-your-application/deploying#configuring-caching) and the [API Reference](https://nextjs.org/docs/app/api-reference/next-config-js/incrementalCacheHandlerPath).\n */\n cacheHandler?: string | undefined\n\n /**\n * Configure the in-memory cache size in bytes. Defaults to 50 MB.\n * If `cacheMaxMemorySize: 0`, this disables in-memory caching entirely.\n *\n * @see [Configuring Caching](https://nextjs.org/docs/app/building-your-application/deploying#configuring-caching).\n */\n cacheMaxMemorySize?: number\n\n /**\n * By default, `Next` will serve each file in the `pages` folder under a pathname matching the filename.\n * To disable this behavior and prevent routing based set this to `true`.\n *\n * @default true\n * @see [Disabling file-system routing](https://nextjs.org/docs/advanced-features/custom-server#disabling-file-system-routing)\n */\n useFileSystemPublicRoutes?: boolean\n\n /**\n * @see [Configuring the build ID](https://nextjs.org/docs/app/api-reference/config/next-config-js/generateBuildId)\n */\n generateBuildId?: () => string | null | Promise<string | null>\n\n /** @see [Disabling ETag Configuration](https://nextjs.org/docs/app/api-reference/config/next-config-js/generateEtags) */\n generateEtags?: boolean\n\n /** @see [Including non-page files in the pages directory](https://nextjs.org/docs/app/api-reference/config/next-config-js/pageExtensions) */\n pageExtensions?: string[]\n\n /** @see [Compression documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/compress) */\n compress?: boolean\n\n /** @see [Disabling x-powered-by](https://nextjs.org/docs/app/api-reference/config/next-config-js/poweredByHeader) */\n poweredByHeader?: boolean\n\n /** @see [Using the Image Component](https://nextjs.org/docs/app/api-reference/next-config-js/images) */\n images?: ImageConfig\n\n /** Configure indicators in development environment */\n devIndicators?:\n | false\n | {\n /**\n * @deprecated The dev tools indicator has it enabled by default. To disable, set `devIndicators` to `false`.\n * */\n appIsrStatus?: boolean\n\n /**\n * Show \"building...\" indicator in development\n * @deprecated The dev tools indicator has it enabled by default. To disable, set `devIndicators` to `false`.\n */\n buildActivity?: boolean\n\n /**\n * Position of \"building...\" indicator in browser\n * @default \"bottom-right\"\n * @deprecated Renamed as `position`.\n */\n buildActivityPosition?:\n | 'top-left'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-right'\n\n /**\n * Position of the development tools indicator in the browser window.\n * @default \"bottom-left\"\n * */\n position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n }\n\n /**\n * Next.js exposes some options that give you some control over how the server will dispose or keep in memory built pages in development.\n *\n * @see [Configuring `onDemandEntries`](https://nextjs.org/docs/app/api-reference/config/next-config-js/onDemandEntries)\n */\n onDemandEntries?: {\n /** period (in ms) where the server will keep pages in the buffer */\n maxInactiveAge?: number\n /** number of pages that should be kept simultaneously without being disposed */\n pagesBufferLength?: number\n }\n\n /** @see [`next/amp`](https://nextjs.org/docs/api-reference/next/amp) */\n amp?: {\n canonicalBase?: string\n }\n\n /**\n * A unique identifier for a deployment that will be included in each request's query string or header.\n */\n deploymentId?: string\n\n /**\n * Deploy a Next.js application under a sub-path of a domain\n *\n * @see [Base path configuration](https://nextjs.org/docs/app/api-reference/config/next-config-js/basePath)\n */\n basePath?: string\n\n /** @see [Customizing sass options](https://nextjs.org/docs/app/api-reference/next-config-js/sassOptions) */\n sassOptions?: {\n implementation?: string\n [key: string]: any\n }\n\n /**\n * Enable browser source map generation during the production build\n *\n * @see [Source Maps](https://nextjs.org/docs/advanced-features/source-maps)\n */\n productionBrowserSourceMaps?: boolean\n\n /**\n * Enable react profiling in production\n *\n */\n reactProductionProfiling?: boolean\n\n /**\n * The Next.js runtime is Strict Mode-compliant.\n *\n * @see [React Strict Mode](https://nextjs.org/docs/app/api-reference/config/next-config-js/reactStrictMode)\n */\n reactStrictMode?: boolean | null\n\n /**\n * The maximum length of the headers that are emitted by React and added to\n * the response.\n *\n * @see [React Max Headers Length](https://nextjs.org/docs/app/api-reference/config/next-config-js/reactMaxHeadersLength)\n */\n reactMaxHeadersLength?: number\n\n /**\n * Add public (in browser) runtime configuration to your app\n *\n * @see [Runtime configuration](https://nextjs.org/docs/pages/api-reference/config/next-config-js/runtime-configuration\n */\n publicRuntimeConfig?: { [key: string]: any }\n\n /**\n * Add server runtime configuration to your app\n *\n * @see [Runtime configuration](https://nextjs.org/docs/pages/api-reference/config/next-config-js/runtime-configuration\n */\n serverRuntimeConfig?: { [key: string]: any }\n\n /**\n * Next.js enables HTTP Keep-Alive by default.\n * You may want to disable HTTP Keep-Alive for certain `fetch()` calls or globally.\n *\n * @see [Disabling HTTP Keep-Alive](https://nextjs.org/docs/app/api-reference/next-config-js/httpAgentOptions)\n */\n httpAgentOptions?: { keepAlive?: boolean }\n\n /**\n * Timeout after waiting to generate static pages in seconds\n *\n * @default 60\n */\n staticPageGenerationTimeout?: number\n\n /**\n * Add `\"crossorigin\"` attribute to generated `<script>` elements generated by `<Head />` or `<NextScript />` components\n *\n *\n * @see [`crossorigin` attribute documentation](https://developer.mozilla.org/docs/Web/HTML/Attributes/crossorigin)\n */\n crossOrigin?: 'anonymous' | 'use-credentials'\n\n /**\n * Optionally enable compiler transforms\n *\n * @see [Supported Compiler Options](https://nextjs.org/docs/advanced-features/compiler#supported-features)\n */\n compiler?: {\n reactRemoveProperties?:\n | boolean\n | {\n properties?: string[]\n }\n relay?: {\n src: string\n artifactDirectory?: string\n language?: 'typescript' | 'javascript' | 'flow'\n eagerEsModules?: boolean\n }\n removeConsole?:\n | boolean\n | {\n exclude?: string[]\n }\n styledComponents?: boolean | StyledComponentsConfig\n emotion?: boolean | EmotionConfig\n\n styledJsx?:\n | boolean\n | {\n useLightningcss?: boolean\n }\n\n /**\n * Replaces variables in your code during compile time. Each key will be\n * replaced with the respective values.\n */\n define?: Record<string, string>\n }\n\n /**\n * The type of build output.\n * - `undefined`: The default build output, `.next` directory, that works with production mode `next start` or a hosting provider like Vercel\n * - `'standalone'`: A standalone build output, `.next/standalone` directory, that only includes necessary files/dependencies. Useful for self-hosting in a Docker container.\n * - `'export'`: An exported build output, `out` directory, that only includes static HTML/CSS/JS. Useful for self-hosting without a Node.js server.\n * @see [Output File Tracing](https://nextjs.org/docs/advanced-features/output-file-tracing)\n * @see [Static HTML Export](https://nextjs.org/docs/advanced-features/static-html-export)\n */\n output?: 'standalone' | 'export'\n\n /**\n * Automatically transpile and bundle dependencies from local packages (like monorepos) or from external dependencies (`node_modules`). This replaces the\n * `next-transpile-modules` package.\n * @see [transpilePackages](https://nextjs.org/docs/advanced-features/compiler#module-transpilation)\n */\n transpilePackages?: string[]\n\n skipMiddlewareUrlNormalize?: boolean\n\n skipTrailingSlashRedirect?: boolean\n\n modularizeImports?: Record<\n string,\n {\n transform: string | Record<string, string>\n preventFullImport?: boolean\n skipDefaultConversion?: boolean\n }\n >\n\n /**\n * Logging configuration. Set to `false` to disable logging.\n */\n logging?: LoggingConfig | false\n\n /**\n * period (in seconds) where the server allow to serve stale cache\n */\n expireTime?: number\n\n /**\n * Enable experimental features. Note that all experimental features are subject to breaking changes in the future.\n */\n experimental?: ExperimentalConfig\n\n /**\n * Enables the bundling of node_modules packages (externals) for pages server-side bundles.\n * @see https://nextjs.org/docs/pages/api-reference/next-config-js/bundlePagesRouterDependencies\n */\n bundlePagesRouterDependencies?: boolean\n\n /**\n * A list of packages that should be treated as external in the server build.\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/serverExternalPackages\n */\n serverExternalPackages?: string[]\n\n /**\n * This is the repo root usually and only files above this\n * directory are traced and included.\n */\n outputFileTracingRoot?: string\n\n /**\n * This allows manually excluding traced files if too many\n * are included incorrectly on a per-page basis.\n */\n outputFileTracingExcludes?: Record<string, string[]>\n\n /**\n * This allows manually including traced files if some\n * were not detected on a per-page basis.\n */\n outputFileTracingIncludes?: Record<string, string[]>\n\n watchOptions?: {\n pollIntervalMs?: number\n }\n\n /**\n * User Agent of bots that can handle streaming metadata.\n * Besides the default behavior, Next.js act differently on serving metadata to bots based on their capability.\n *\n * @default\n * /Mediapartners-Google|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview/i\n */\n htmlLimitedBots?: RegExp\n}\n\nexport const defaultConfig: NextConfig = {\n env: {},\n webpack: null,\n eslint: {\n ignoreDuringBuilds: false,\n },\n typescript: {\n ignoreBuildErrors: false,\n tsconfigPath: 'tsconfig.json',\n },\n distDir: '.next',\n cleanDistDir: true,\n assetPrefix: '',\n cacheHandler: process.env.NEXT_CACHE_HANDLER_PATH,\n // default to 50MB limit\n cacheMaxMemorySize: 50 * 1024 * 1024,\n configOrigin: 'default',\n useFileSystemPublicRoutes: true,\n generateBuildId: () => null,\n generateEtags: true,\n pageExtensions: ['tsx', 'ts', 'jsx', 'js'],\n poweredByHeader: true,\n compress: true,\n images: imageConfigDefault,\n devIndicators: {\n position: 'bottom-left',\n },\n onDemandEntries: {\n maxInactiveAge: 60 * 1000,\n pagesBufferLength: 5,\n },\n amp: {\n canonicalBase: '',\n },\n basePath: '',\n sassOptions: {},\n trailingSlash: false,\n i18n: null,\n productionBrowserSourceMaps: false,\n excludeDefaultMomentLocales: true,\n serverRuntimeConfig: {},\n publicRuntimeConfig: {},\n reactProductionProfiling: false,\n reactStrictMode: null,\n reactMaxHeadersLength: 6000,\n httpAgentOptions: {\n keepAlive: true,\n },\n logging: {},\n expireTime: process.env.NEXT_PRIVATE_CDN_CONSUMED_SWR_CACHE_CONTROL\n ? undefined\n : 31536000, // one year\n staticPageGenerationTimeout: 60,\n output: !!process.env.NEXT_PRIVATE_STANDALONE ? 'standalone' : undefined,\n modularizeImports: undefined,\n outputFileTracingRoot: process.env.NEXT_PRIVATE_OUTPUT_TRACE_ROOT || '',\n experimental: {\n allowedDevOrigins: [],\n nodeMiddleware: false,\n cacheLife: {\n default: {\n stale: undefined, // defaults to staleTimes.static\n revalidate: 60 * 15, // 15 minutes\n expire: INFINITE_CACHE,\n },\n seconds: {\n stale: undefined, // defaults to staleTimes.dynamic\n revalidate: 1, // 1 second\n expire: 60, // 1 minute\n },\n minutes: {\n stale: 60 * 5, // 5 minutes\n revalidate: 60, // 1 minute\n expire: 60 * 60, // 1 hour\n },\n hours: {\n stale: 60 * 5, // 5 minutes\n revalidate: 60 * 60, // 1 hour\n expire: 60 * 60 * 24, // 1 day\n },\n days: {\n stale: 60 * 5, // 5 minutes\n revalidate: 60 * 60 * 24, // 1 day\n expire: 60 * 60 * 24 * 7, // 1 week\n },\n weeks: {\n stale: 60 * 5, // 5 minutes\n revalidate: 60 * 60 * 24 * 7, // 1 week\n expire: 60 * 60 * 24 * 30, // 1 month\n },\n max: {\n stale: 60 * 5, // 5 minutes\n revalidate: 60 * 60 * 24 * 30, // 1 month\n expire: INFINITE_CACHE, // Unbounded.\n },\n },\n cacheHandlers: {\n default: process.env.NEXT_DEFAULT_CACHE_HANDLER_PATH,\n remote: process.env.NEXT_REMOTE_CACHE_HANDLER_PATH,\n static: process.env.NEXT_STATIC_CACHE_HANDLER_PATH,\n },\n cssChunking: true,\n multiZoneDraftMode: false,\n appNavFailHandling: false,\n prerenderEarlyExit: true,\n serverMinification: true,\n serverSourceMaps: false,\n linkNoTouchStart: false,\n caseSensitiveRoutes: false,\n clientSegmentCache: false,\n appDocumentPreloading: undefined,\n preloadEntriesOnStart: true,\n clientRouterFilter: true,\n clientRouterFilterRedirects: false,\n fetchCacheKeyPrefix: '',\n middlewarePrefetch: 'flexible',\n optimisticClientCache: true,\n manualClientBasePath: false,\n cpus: Math.max(\n 1,\n (Number(process.env.CIRCLE_NODE_TOTAL) ||\n (os.cpus() || { length: 1 }).length) - 1\n ),\n memoryBasedWorkersCount: false,\n imgOptConcurrency: null,\n imgOptTimeoutInSeconds: 7,\n imgOptMaxInputPixels: 268_402_689, // https://sharp.pixelplumbing.com/api-constructor#:~:text=%5Boptions.limitInputPixels%5D\n imgOptSequentialRead: null,\n isrFlushToDisk: true,\n workerThreads: false,\n proxyTimeout: undefined,\n optimizeCss: false,\n nextScriptWorkers: false,\n scrollRestoration: false,\n externalDir: false,\n disableOptimizedLoading: false,\n gzipSize: true,\n craCompat: false,\n esmExternals: true,\n fullySpecified: false,\n swcTraceProfiling: false,\n forceSwcTransforms: false,\n swcPlugins: undefined,\n largePageDataBytes: 128 * 1000, // 128KB by default\n disablePostcssPresetEnv: undefined,\n amp: undefined,\n urlImports: undefined,\n turbo: undefined,\n typedRoutes: false,\n typedEnv: false,\n clientTraceMetadata: undefined,\n parallelServerCompiles: false,\n parallelServerBuildTraces: false,\n ppr:\n // TODO: remove once we've made PPR default\n // If we're testing, and the `__NEXT_EXPERIMENTAL_PPR` environment variable\n // has been set to `true`, enable the experimental PPR feature so long as it\n // wasn't explicitly disabled in the config.\n !!(\n process.env.__NEXT_TEST_MODE &&\n process.env.__NEXT_EXPERIMENTAL_PPR === 'true'\n ),\n authInterrupts: false,\n webpackBuildWorker: undefined,\n webpackMemoryOptimizations: false,\n optimizeServerReact: true,\n useEarlyImport: false,\n viewTransition: false,\n staleTimes: {\n dynamic: 0,\n static: 300,\n },\n allowDevelopmentBuild: undefined,\n reactCompiler: undefined,\n staticGenerationRetryCount: undefined,\n serverComponentsHmrCache: true,\n staticGenerationMaxConcurrency: 8,\n staticGenerationMinPagesPerWorker: 25,\n dynamicIO: false,\n inlineCss: false,\n useCache: undefined,\n slowModuleDetection: undefined,\n },\n htmlLimitedBots: undefined,\n bundlePagesRouterDependencies: false,\n}\n\nexport async function normalizeConfig(phase: string, config: any) {\n if (typeof config === 'function') {\n config = config(phase, { defaultConfig })\n }\n // Support `new Promise` and `async () =>` as return values of the config export\n return await config\n}\n"],"names":["os","imageConfigDefault","INFINITE_CACHE","defaultConfig","env","webpack","eslint","ignoreDuringBuilds","typescript","ignoreBuildErrors","tsconfigPath","distDir","cleanDistDir","assetPrefix","cacheHandler","process","NEXT_CACHE_HANDLER_PATH","cacheMaxMemorySize","configOrigin","useFileSystemPublicRoutes","generateBuildId","generateEtags","pageExtensions","poweredByHeader","compress","images","devIndicators","position","onDemandEntries","maxInactiveAge","pagesBufferLength","amp","canonicalBase","basePath","sassOptions","trailingSlash","i18n","productionBrowserSourceMaps","excludeDefaultMomentLocales","serverRuntimeConfig","publicRuntimeConfig","reactProductionProfiling","reactStrictMode","reactMaxHeadersLength","httpAgentOptions","keepAlive","logging","expireTime","NEXT_PRIVATE_CDN_CONSUMED_SWR_CACHE_CONTROL","undefined","staticPageGenerationTimeout","output","NEXT_PRIVATE_STANDALONE","modularizeImports","outputFileTracingRoot","NEXT_PRIVATE_OUTPUT_TRACE_ROOT","experimental","allowedDevOrigins","nodeMiddleware","cacheLife","default","stale","revalidate","expire","seconds","minutes","hours","days","weeks","max","cacheHandlers","NEXT_DEFAULT_CACHE_HANDLER_PATH","remote","NEXT_REMOTE_CACHE_HANDLER_PATH","static","NEXT_STATIC_CACHE_HANDLER_PATH","cssChunking","multiZoneDraftMode","appNavFailHandling","prerenderEarlyExit","serverMinification","serverSourceMaps","linkNoTouchStart","caseSensitiveRoutes","clientSegmentCache","appDocumentPreloading","preloadEntriesOnStart","clientRouterFilter","clientRouterFilterRedirects","fetchCacheKeyPrefix","middlewarePrefetch","optimisticClientCache","manualClientBasePath","cpus","Math","Number","CIRCLE_NODE_TOTAL","length","memoryBasedWorkersCount","imgOptConcurrency","imgOptTimeoutInSeconds","imgOptMaxInputPixels","imgOptSequentialRead","isrFlushToDisk","workerThreads","proxyTimeout","optimizeCss","nextScriptWorkers","scrollRestoration","externalDir","disableOptimizedLoading","gzipSize","craCompat","esmExternals","fullySpecified","swcTraceProfiling","forceSwcTransforms","swcPlugins","largePageDataBytes","disablePostcssPresetEnv","urlImports","turbo","typedRoutes","typedEnv","clientTraceMetadata","parallelServerCompiles","parallelServerBuildTraces","ppr","__NEXT_TEST_MODE","__NEXT_EXPERIMENTAL_PPR","authInterrupts","webpackBuildWorker","webpackMemoryOptimizations","optimizeServerReact","useEarlyImport","viewTransition","staleTimes","dynamic","allowDevelopmentBuild","reactCompiler","staticGenerationRetryCount","serverComponentsHmrCache","staticGenerationMaxConcurrency","staticGenerationMinPagesPerWorker","dynamicIO","inlineCss","useCache","slowModuleDetection","htmlLimitedBots","bundlePagesRouterDependencies","normalizeConfig","phase","config"],"mappings":"AAAA,OAAOA,QAAQ,KAAI;AAGnB,SAASC,kBAAkB,QAAQ,6BAA4B;AAW/D,SAASC,cAAc,QAAQ,mBAAkB;AA0iCjD,OAAO,MAAMC,gBAA4B;IACvCC,KAAK,CAAC;IACNC,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,oBAAoB,MAAM;QAC1BC,yBAAyBtE;QACzBlB,KAAKkB;QACLuE,YAAYvE;QACZwE,OAAOxE;QACPyE,aAAa;QACbC,UAAU;QACVC,qBAAqB3E;QACrB4E,wBAAwB;QACxBC,2BAA2B;QAC3BC,KACE,2CAA2C;QAC3C,2EAA2E;QAC3E,4EAA4E;QAC5E,4CAA4C;QAC5C,CAAC,CACChH,CAAAA,QAAQX,GAAG,CAAC4H,gBAAgB,IAC5BjH,QAAQX,GAAG,CAAC6H,uBAAuB,KAAK,MAAK;QAEjDC,gBAAgB;QAChBC,oBAAoBlF;QACpBmF,4BAA4B;QAC5BC,qBAAqB;QACrBC,gBAAgB;QAChBC,gBAAgB;QAChBC,YAAY;YACVC,SAAS;YACT/D,QAAQ;QACV;QACAgE,uBAAuBzF;QACvB0F,eAAe1F;QACf2F,4BAA4B3F;QAC5B4F,0BAA0B;QAC1BC,gCAAgC;QAChCC,mCAAmC;QACnCC,WAAW;QACXC,WAAW;QACXC,UAAUjG;QACVkG,qBAAqBlG;IACvB;IACAmG,iBAAiBnG;IACjBoG,+BAA+B;AACjC,EAAC;AAED,OAAO,eAAeC,gBAAgBC,KAAa,EAAEC,MAAW;IAC9D,IAAI,OAAOA,WAAW,YAAY;QAChCA,SAASA,OAAOD,OAAO;YAAEpJ;QAAc;IACzC;IACA,gFAAgF;IAChF,OAAO,MAAMqJ;AACf"}
|
1
|
+
{"version":3,"sources":["../../src/server/config-shared.ts"],"sourcesContent":["import os from 'os'\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport type { Header, Redirect, Rewrite } from '../lib/load-custom-routes'\nimport { imageConfigDefault } from '../shared/lib/image-config'\nimport type {\n ImageConfig,\n ImageConfigComplete,\n} from '../shared/lib/image-config'\nimport type { SubresourceIntegrityAlgorithm } from '../build/webpack/plugins/subresource-integrity-plugin'\nimport type { WEB_VITALS } from '../shared/lib/utils'\nimport type { NextParsedUrlQuery } from './request-meta'\nimport type { SizeLimit } from '../types'\nimport type { SupportedTestRunners } from '../cli/next-test'\nimport type { ExperimentalPPRConfig } from './lib/experimental/ppr'\nimport { INFINITE_CACHE } from '../lib/constants'\n\nexport type NextConfigComplete = Required<NextConfig> & {\n images: Required<ImageConfigComplete>\n typescript: Required<TypeScriptConfig>\n configOrigin?: string\n configFile?: string\n configFileName: string\n // override NextConfigComplete.experimental.htmlLimitedBots to string\n // because it's not defined in NextConfigComplete.experimental\n htmlLimitedBots: string | undefined\n experimental: ExperimentalConfig\n}\n\nexport type I18NDomains = readonly DomainLocale[]\n\nexport interface I18NConfig {\n defaultLocale: string\n domains?: I18NDomains\n localeDetection?: false\n locales: readonly string[]\n}\n\nexport interface DomainLocale {\n defaultLocale: string\n domain: string\n http?: true\n locales?: readonly string[]\n}\n\nexport interface ESLintConfig {\n /** Only run ESLint on these directories with `next lint` and `next build`. */\n dirs?: string[]\n /** Do not run ESLint during production builds (`next build`). */\n ignoreDuringBuilds?: boolean\n}\n\nexport interface TypeScriptConfig {\n /** Do not run TypeScript during production builds (`next build`). */\n ignoreBuildErrors?: boolean\n /** Relative path to a custom tsconfig file */\n tsconfigPath?: string\n}\n\nexport interface EmotionConfig {\n sourceMap?: boolean\n autoLabel?: 'dev-only' | 'always' | 'never'\n labelFormat?: string\n importMap?: {\n [importName: string]: {\n [exportName: string]: {\n canonicalImport?: [string, string]\n styledBaseImport?: [string, string]\n }\n }\n }\n}\n\nexport interface StyledComponentsConfig {\n /**\n * Enabled by default in development, disabled in production to reduce file size,\n * setting this will override the default for all environments.\n */\n displayName?: boolean\n topLevelImportPaths?: string[]\n ssr?: boolean\n fileName?: boolean\n meaninglessFileNames?: string[]\n minify?: boolean\n transpileTemplateLiterals?: boolean\n namespace?: string\n pure?: boolean\n cssProp?: boolean\n}\n\ntype JSONValue =\n | string\n | number\n | boolean\n | JSONValue[]\n | { [k: string]: JSONValue }\n\nexport type TurboLoaderItem =\n | string\n | {\n loader: string\n // At the moment, Turbopack options must be JSON-serializable, so restrict values.\n options: Record<string, JSONValue>\n }\n\nexport type TurboRuleConfigItemOrShortcut =\n | TurboLoaderItem[]\n | TurboRuleConfigItem\n\nexport type TurboRuleConfigItemOptions = {\n loaders: TurboLoaderItem[]\n as?: string\n}\n\nexport type TurboRuleConfigItem =\n | TurboRuleConfigItemOptions\n | { [condition: string]: TurboRuleConfigItem }\n | false\n\nexport interface ExperimentalTurboOptions {\n /**\n * (`next --turbopack` only) A mapping of aliased imports to modules to load in their place.\n *\n * @see [Resolve Alias](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#resolve-alias)\n */\n resolveAlias?: Record<\n string,\n string | string[] | Record<string, string | string[]>\n >\n\n /**\n * (`next --turbopack` only) A list of extensions to resolve when importing files.\n *\n * @see [Resolve Extensions](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#resolve-extensions)\n */\n resolveExtensions?: string[]\n\n /**\n * (`next --turbopack` only) A list of webpack loaders to apply when running with Turbopack.\n *\n * @see [Turbopack Loaders](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#webpack-loaders)\n */\n loaders?: Record<string, TurboLoaderItem[]>\n\n /**\n * (`next --turbopack` only) A list of webpack loaders to apply when running with Turbopack.\n *\n * @see [Turbopack Loaders](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#webpack-loaders)\n */\n rules?: Record<string, TurboRuleConfigItemOrShortcut>\n\n /**\n * A target memory limit for turbo, in bytes.\n */\n memoryLimit?: number\n\n /**\n * Enable persistent caching for the turbopack dev server and build.\n */\n unstablePersistentCaching?: boolean\n\n /**\n * Enable tree shaking for the turbopack dev server and build.\n */\n treeShaking?: boolean\n\n /**\n * The module ID strategy to use for Turbopack.\n * If not set, the default is `'named'` for development and `'deterministic'`\n * for production.\n */\n moduleIdStrategy?: 'named' | 'deterministic'\n\n /**\n * This is the repo root usually and only files above this\n * directory can be resolved by turbopack.\n */\n root?: string\n\n /**\n * Enable minification. Defaults to true in build mode and false in dev mode.\n */\n minify?: boolean\n\n /**\n * Enable source maps. Defaults to true.\n */\n sourceMaps?: boolean\n}\n\nexport interface WebpackConfigContext {\n /** Next.js root directory */\n dir: string\n /** Indicates if the compilation will be done in development */\n dev: boolean\n /** It's `true` for server-side compilation, and `false` for client-side compilation */\n isServer: boolean\n /** The build id, used as a unique identifier between builds */\n buildId: string\n /** The next.config.js merged with default values */\n config: NextConfigComplete\n /** Default loaders used internally by Next.js */\n defaultLoaders: {\n /** Default babel-loader configuration */\n babel: any\n }\n /** Number of total Next.js pages */\n totalPages: number\n /** The webpack configuration */\n webpack: any\n /** The current server runtime */\n nextRuntime?: 'nodejs' | 'edge'\n}\n\nexport interface NextJsWebpackConfig {\n (\n /** Existing Webpack config */\n config: any,\n context: WebpackConfigContext\n ): any\n}\n\n/**\n * Set of options for the react compiler next.js\n * currently supports.\n *\n * This can be changed without breaking changes while supporting\n * react compiler in the experimental phase.\n */\nexport interface ReactCompilerOptions {\n compilationMode?: 'infer' | 'annotation' | 'all'\n panicThreshold?: 'ALL_ERRORS' | 'CRITICAL_ERRORS' | 'NONE'\n}\n\nexport interface IncomingRequestLoggingConfig {\n /**\n * A regular expression array to match incoming requests that should not be logged.\n * You can specify multiple patterns to match incoming requests that should not be logged.\n */\n ignore?: RegExp[]\n}\n\nexport interface LoggingConfig {\n fetches?: {\n fullUrl?: boolean\n /**\n * If true, fetch requests that are restored from the HMR cache are logged\n * during an HMR refresh request, i.e. when editing a server component.\n */\n hmrRefreshes?: boolean\n }\n\n /**\n * If set to false, incoming request logging is disabled.\n * You can specify a pattern to match incoming requests that should not be logged.\n */\n incomingRequests?: boolean | IncomingRequestLoggingConfig\n}\n\nexport interface ExperimentalConfig {\n generateOnlyEnv?: boolean\n nodeMiddleware?: boolean\n cacheHandlers?: {\n default?: string\n remote?: string\n static?: string\n [handlerName: string]: string | undefined\n }\n multiZoneDraftMode?: boolean\n appNavFailHandling?: boolean\n prerenderEarlyExit?: boolean\n linkNoTouchStart?: boolean\n caseSensitiveRoutes?: boolean\n clientSegmentCache?: boolean\n appDocumentPreloading?: boolean\n preloadEntriesOnStart?: boolean\n /** @default true */\n strictNextHead?: boolean\n clientRouterFilter?: boolean\n clientRouterFilterRedirects?: boolean\n /**\n * This config can be used to override the cache behavior for the client router.\n * These values indicate the time, in seconds, that the cache should be considered\n * reusable. When the `prefetch` Link prop is left unspecified, this will use the `dynamic` value.\n * When the `prefetch` Link prop is set to `true`, this will use the `static` value.\n */\n staleTimes?: {\n dynamic?: number\n static?: number\n }\n cacheLife?: {\n [profile: string]: {\n // How long the client can cache a value without checking with the server.\n stale?: number\n // How frequently you want the cache to refresh on the server.\n // Stale values may be served while revalidating.\n revalidate?: number\n // In the worst case scenario, where you haven't had traffic in a while,\n // how stale can a value be until you prefer deopting to dynamic.\n // Must be longer than revalidate.\n expire?: number\n }\n }\n // decimal for percent for possible false positives\n // e.g. 0.01 for 10% potential false matches lower\n // percent increases size of the filter\n clientRouterFilterAllowedRate?: number\n externalMiddlewareRewritesResolve?: boolean\n extensionAlias?: Record<string, any>\n allowedRevalidateHeaderKeys?: string[]\n fetchCacheKeyPrefix?: string\n imgOptConcurrency?: number | null\n imgOptTimeoutInSeconds?: number\n imgOptMaxInputPixels?: number\n imgOptSequentialRead?: boolean | null\n optimisticClientCache?: boolean\n /**\n * @deprecated use config.expireTime instead\n */\n expireTime?: number\n middlewarePrefetch?: 'strict' | 'flexible'\n manualClientBasePath?: boolean\n /**\n * CSS Chunking strategy. Defaults to `true` (\"loose\" mode), which guesses dependencies\n * between CSS files to keep ordering of them.\n * An alternative is 'strict', which will try to keep correct ordering as\n * much as possible, even when this leads to many requests.\n */\n cssChunking?: boolean | 'strict'\n disablePostcssPresetEnv?: boolean\n cpus?: number\n memoryBasedWorkersCount?: boolean\n proxyTimeout?: number\n isrFlushToDisk?: boolean\n workerThreads?: boolean\n // optimizeCss can be boolean or critters' option object\n // Use Record<string, unknown> as critters doesn't export its Option type\n // https://github.com/GoogleChromeLabs/critters/blob/a590c05f9197b656d2aeaae9369df2483c26b072/packages/critters/src/index.d.ts\n optimizeCss?: boolean | Record<string, unknown>\n nextScriptWorkers?: boolean\n scrollRestoration?: boolean\n externalDir?: boolean\n amp?: {\n optimizer?: any\n validator?: string\n skipValidation?: boolean\n }\n disableOptimizedLoading?: boolean\n gzipSize?: boolean\n craCompat?: boolean\n esmExternals?: boolean | 'loose'\n fullySpecified?: boolean\n urlImports?: NonNullable<webpack.Configuration['experiments']>['buildHttp']\n swcTraceProfiling?: boolean\n forceSwcTransforms?: boolean\n\n swcPlugins?: Array<[string, Record<string, unknown>]>\n largePageDataBytes?: number\n /**\n * If set to `false`, webpack won't fall back to polyfill Node.js modules in the browser\n * Full list of old polyfills is accessible here:\n * [webpack/webpack#ModuleNotoundError.js#L13-L42](https://github.com/webpack/webpack/blob/2a0536cf510768111a3a6dceeb14cb79b9f59273/lib/ModuleNotFoundError.js#L13-L42)\n */\n fallbackNodePolyfills?: false\n sri?: {\n algorithm?: SubresourceIntegrityAlgorithm\n }\n\n webVitalsAttribution?: Array<(typeof WEB_VITALS)[number]>\n\n /**\n * Automatically apply the \"modularizeImports\" optimization to imports of the specified packages.\n */\n optimizePackageImports?: string[]\n\n /**\n * Optimize React APIs for server builds.\n */\n optimizeServerReact?: boolean\n\n turbo?: ExperimentalTurboOptions\n\n /**\n * For use with `@next/mdx`. Compile MDX files using the new Rust compiler.\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/mdxRs\n */\n mdxRs?:\n | boolean\n | {\n development?: boolean\n jsx?: boolean\n jsxRuntime?: string\n jsxImportSource?: string\n providerImportSource?: string\n mdxType?: 'gfm' | 'commonmark'\n }\n\n /**\n * Generate Route types and enable type checking for Link and Router.push, etc.\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/typedRoutes\n */\n typedRoutes?: boolean\n\n /**\n * Enable type-checking and autocompletion for environment variables.\n *\n * @default false\n */\n typedEnv?: boolean\n\n /**\n * Runs the compilations for server and edge in parallel instead of in serial.\n * This will make builds faster if there is enough server and edge functions\n * in the application at the cost of more memory.\n *\n * NOTE: This option is only valid when the build process can use workers. See\n * the documentation for `webpackBuildWorker` for more details.\n */\n parallelServerCompiles?: boolean\n\n /**\n * Runs the logic to collect build traces for the server routes in parallel\n * with other work during the compilation. This will increase the speed of\n * the build at the cost of more memory. This option may incur some additional\n * work compared to if the option was disabled since the work is started\n * before data from the client compilation is available to potentially reduce\n * the amount of code that needs to be traced. Despite that, this may still\n * result in faster builds for some applications.\n *\n * Valid values are:\n * - `true`: Collect the server build traces in parallel.\n * - `false`: Do not collect the server build traces in parallel.\n * - `undefined`: Collect server build traces in parallel only in the `experimental-compile` mode.\n *\n * NOTE: This option is only valid when the build process can use workers. See\n * the documentation for `webpackBuildWorker` for more details.\n */\n parallelServerBuildTraces?: boolean\n\n /**\n * Run the Webpack build in a separate process to optimize memory usage during build.\n * Valid values are:\n * - `false`: Disable the Webpack build worker\n * - `true`: Enable the Webpack build worker\n * - `undefined`: Enable the Webpack build worker only if the webpack config is not customized\n */\n webpackBuildWorker?: boolean\n\n /**\n * Enables optimizations to reduce memory usage in Webpack. This reduces the max size of the heap\n * but may increase compile times slightly.\n * Valid values are:\n * - `false`: Disable Webpack memory optimizations (default).\n * - `true`: Enables Webpack memory optimizations.\n */\n webpackMemoryOptimizations?: boolean\n\n /**\n * The array of the meta tags to the client injected by tracing propagation data.\n */\n clientTraceMetadata?: string[]\n\n /**\n * Enables experimental Partial Prerendering feature of Next.js.\n * Using this feature will enable the `react@experimental` for the `app` directory.\n */\n ppr?: ExperimentalPPRConfig\n\n /**\n * Enables experimental taint APIs in React.\n * Using this feature will enable the `react@experimental` for the `app` directory.\n */\n taint?: boolean\n\n serverActions?: {\n /**\n * Allows adjusting body parser size limit for server actions.\n */\n bodySizeLimit?: SizeLimit\n\n /**\n * Allowed origins that can bypass Server Action's CSRF check. This is helpful\n * when you have reverse proxy in front of your app.\n * @example\n * [\"my-app.com\", \"*.my-app.com\"]\n */\n allowedOrigins?: string[]\n }\n\n /**\n * enables the minification of server code.\n */\n serverMinification?: boolean\n\n /**\n * Enables source maps generation for the server production bundle.\n */\n serverSourceMaps?: boolean\n\n /**\n * @internal Used by the Next.js internals only.\n */\n trustHostHeader?: boolean\n\n useWasmBinary?: boolean\n\n /**\n * Use lightningcss instead of postcss-loader\n */\n useLightningcss?: boolean\n\n /**\n * Enables early import feature for app router modules\n */\n useEarlyImport?: boolean\n\n /**\n * Enables view transitions by using the {@link https://github.com/facebook/react/pull/31975 unstable_ViewTransition} Component.\n */\n viewTransition?: boolean\n\n /**\n * Enables `fetch` requests to be proxied to the experimental test proxy server\n */\n testProxy?: boolean\n\n /**\n * Set a default test runner to be used by `next experimental-test`.\n */\n defaultTestRunner?: SupportedTestRunners\n /**\n * Allow NODE_ENV=development even for `next build`.\n */\n allowDevelopmentBuild?: true\n /**\n * @deprecated use `config.bundlePagesRouterDependencies` instead\n *\n */\n bundlePagesExternals?: boolean\n /**\n * @deprecated use `config.serverExternalPackages` instead\n *\n */\n serverComponentsExternalPackages?: string[]\n /**\n * Enable experimental React compiler optimization.\n * Configuration accepts partial config object to the compiler, if provided\n * compiler will be enabled.\n */\n reactCompiler?: boolean | ReactCompilerOptions\n\n /**\n * The number of times to retry static generation (per page) before giving up.\n */\n staticGenerationRetryCount?: number\n\n /**\n * The amount of pages to export per worker during static generation.\n */\n staticGenerationMaxConcurrency?: number\n\n /**\n * The minimum number of pages to be chunked into each export worker.\n */\n staticGenerationMinPagesPerWorker?: number\n\n /**\n * Allows previously fetched data to be re-used when editing server components.\n */\n serverComponentsHmrCache?: boolean\n\n /**\n * When enabled will cause IO in App Router to be excluded from prerenders\n * unless explicitly cached.\n */\n dynamicIO?: boolean\n\n /**\n * Render <style> tags inline in the HTML for imported CSS assets.\n * Supports app-router in production mode only.\n */\n inlineCss?: boolean\n\n // TODO: Remove this config when the API is stable.\n /**\n * This config allows you to enable the experimental navigation API `forbidden` and `unauthorized`.\n */\n authInterrupts?: boolean\n\n /**\n * Enables the use of the `\"use cache\"` directive.\n */\n useCache?: boolean\n\n /**\n * Enables detection and reporting of slow modules during development builds.\n * Enabling this may impact build performance to ensure accurate measurements.\n */\n slowModuleDetection?: {\n /**\n * The time threshold in milliseconds for identifying slow modules.\n * Modules taking longer than this build time threshold will be reported.\n */\n buildTimeThresholdMs: number\n }\n}\n\nexport type ExportPathMap = {\n [path: string]: {\n page: string\n query?: NextParsedUrlQuery\n\n /**\n * When true, this indicates that this is a pages router page that should\n * be rendered as a fallback.\n *\n * @internal\n */\n _pagesFallback?: boolean\n\n /**\n * The locale that this page should be rendered in.\n *\n * @internal\n */\n _locale?: string\n\n /**\n * The path that was used to generate the page.\n *\n * @internal\n */\n _ssgPath?: string\n\n /**\n * The parameters that are currently unknown.\n *\n * @internal\n */\n _fallbackRouteParams?: readonly string[]\n\n /**\n * @internal\n */\n _isAppDir?: boolean\n\n /**\n * @internal\n */\n _isDynamicError?: boolean\n\n /**\n * @internal\n */\n _isRoutePPREnabled?: boolean\n\n /**\n * When true, it indicates that this page is being rendered in an attempt to\n * discover if the page will be safe to generate with PPR. This is only\n * enabled when the app has `experimental.dynamicIO` enabled but does not\n * have `experimental.ppr` enabled.\n *\n * @internal\n */\n _isProspectiveRender?: boolean\n }\n}\n\n/**\n * Next.js can be configured through a `next.config.js` file in the root of your project directory.\n *\n * This can change the behavior, enable experimental features, and configure other advanced options.\n *\n * Read more: [Next.js Docs: `next.config.js`](https://nextjs.org/docs/app/api-reference/config/next-config-js)\n */\nexport interface NextConfig extends Record<string, any> {\n allowedDevOrigins?: string[]\n\n exportPathMap?: (\n defaultMap: ExportPathMap,\n ctx: {\n dev: boolean\n dir: string\n outDir: string | null\n distDir: string\n buildId: string\n }\n ) => Promise<ExportPathMap> | ExportPathMap\n\n /**\n * Internationalization configuration\n *\n * @see [Internationalization docs](https://nextjs.org/docs/advanced-features/i18n-routing)\n */\n i18n?: I18NConfig | null\n\n /**\n * @since version 11\n * @see [ESLint configuration](https://nextjs.org/docs/app/api-reference/config/eslint)\n */\n eslint?: ESLintConfig\n\n /**\n * @see [Next.js TypeScript documentation](https://nextjs.org/docs/app/api-reference/config/typescript)\n */\n typescript?: TypeScriptConfig\n\n /**\n * Headers allow you to set custom HTTP headers for an incoming request path.\n *\n * @see [Headers configuration documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/headers)\n */\n headers?: () => Promise<Header[]>\n\n /**\n * Rewrites allow you to map an incoming request path to a different destination path.\n *\n * @see [Rewrites configuration documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/rewrites)\n */\n rewrites?: () => Promise<\n | Rewrite[]\n | {\n beforeFiles?: Rewrite[]\n afterFiles?: Rewrite[]\n fallback?: Rewrite[]\n }\n >\n\n /**\n * Redirects allow you to redirect an incoming request path to a different destination path.\n *\n * @see [Redirects configuration documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/redirects)\n */\n redirects?: () => Promise<Redirect[]>\n\n /**\n * @see [Moment.js locales excluded by default](https://nextjs.org/docs/upgrading#momentjs-locales-excluded-by-default)\n */\n excludeDefaultMomentLocales?: boolean\n\n /**\n * Before continuing to add custom webpack configuration to your application make sure Next.js doesn't already support your use-case\n *\n * @see [Custom Webpack Config documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/webpack)\n */\n webpack?: NextJsWebpackConfig | null\n\n /**\n * By default Next.js will redirect urls with trailing slashes to their counterpart without a trailing slash.\n *\n * @default false\n * @see [Trailing Slash Configuration](https://nextjs.org/docs/app/api-reference/config/next-config-js/trailingSlash)\n */\n trailingSlash?: boolean\n\n /**\n * Next.js comes with built-in support for environment variables\n *\n * @see [Environment Variables documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/env)\n */\n env?: Record<string, string | undefined>\n\n /**\n * Destination directory (defaults to `.next`)\n */\n distDir?: string\n\n /**\n * The build output directory (defaults to `.next`) is now cleared by default except for the Next.js caches.\n */\n cleanDistDir?: boolean\n\n /**\n * To set up a CDN, you can set up an asset prefix and configure your CDN's origin to resolve to the domain that Next.js is hosted on.\n *\n * @see [CDN Support with Asset Prefix](https://nextjs.org/docs/app/api-reference/config/next-config-js/assetPrefix)\n */\n assetPrefix?: string\n\n /**\n * The default cache handler for the Pages and App Router uses the filesystem cache. This requires no configuration, however, you can customize the cache handler if you prefer.\n *\n * @see [Configuring Caching](https://nextjs.org/docs/app/building-your-application/deploying#configuring-caching) and the [API Reference](https://nextjs.org/docs/app/api-reference/next-config-js/incrementalCacheHandlerPath).\n */\n cacheHandler?: string | undefined\n\n /**\n * Configure the in-memory cache size in bytes. Defaults to 50 MB.\n * If `cacheMaxMemorySize: 0`, this disables in-memory caching entirely.\n *\n * @see [Configuring Caching](https://nextjs.org/docs/app/building-your-application/deploying#configuring-caching).\n */\n cacheMaxMemorySize?: number\n\n /**\n * By default, `Next` will serve each file in the `pages` folder under a pathname matching the filename.\n * To disable this behavior and prevent routing based set this to `true`.\n *\n * @default true\n * @see [Disabling file-system routing](https://nextjs.org/docs/advanced-features/custom-server#disabling-file-system-routing)\n */\n useFileSystemPublicRoutes?: boolean\n\n /**\n * @see [Configuring the build ID](https://nextjs.org/docs/app/api-reference/config/next-config-js/generateBuildId)\n */\n generateBuildId?: () => string | null | Promise<string | null>\n\n /** @see [Disabling ETag Configuration](https://nextjs.org/docs/app/api-reference/config/next-config-js/generateEtags) */\n generateEtags?: boolean\n\n /** @see [Including non-page files in the pages directory](https://nextjs.org/docs/app/api-reference/config/next-config-js/pageExtensions) */\n pageExtensions?: string[]\n\n /** @see [Compression documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/compress) */\n compress?: boolean\n\n /** @see [Disabling x-powered-by](https://nextjs.org/docs/app/api-reference/config/next-config-js/poweredByHeader) */\n poweredByHeader?: boolean\n\n /** @see [Using the Image Component](https://nextjs.org/docs/app/api-reference/next-config-js/images) */\n images?: ImageConfig\n\n /** Configure indicators in development environment */\n devIndicators?:\n | false\n | {\n /**\n * @deprecated The dev tools indicator has it enabled by default. To disable, set `devIndicators` to `false`.\n * */\n appIsrStatus?: boolean\n\n /**\n * Show \"building...\" indicator in development\n * @deprecated The dev tools indicator has it enabled by default. To disable, set `devIndicators` to `false`.\n */\n buildActivity?: boolean\n\n /**\n * Position of \"building...\" indicator in browser\n * @default \"bottom-right\"\n * @deprecated Renamed as `position`.\n */\n buildActivityPosition?:\n | 'top-left'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-right'\n\n /**\n * Position of the development tools indicator in the browser window.\n * @default \"bottom-left\"\n * */\n position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n }\n\n /**\n * Next.js exposes some options that give you some control over how the server will dispose or keep in memory built pages in development.\n *\n * @see [Configuring `onDemandEntries`](https://nextjs.org/docs/app/api-reference/config/next-config-js/onDemandEntries)\n */\n onDemandEntries?: {\n /** period (in ms) where the server will keep pages in the buffer */\n maxInactiveAge?: number\n /** number of pages that should be kept simultaneously without being disposed */\n pagesBufferLength?: number\n }\n\n /** @see [`next/amp`](https://nextjs.org/docs/api-reference/next/amp) */\n amp?: {\n canonicalBase?: string\n }\n\n /**\n * A unique identifier for a deployment that will be included in each request's query string or header.\n */\n deploymentId?: string\n\n /**\n * Deploy a Next.js application under a sub-path of a domain\n *\n * @see [Base path configuration](https://nextjs.org/docs/app/api-reference/config/next-config-js/basePath)\n */\n basePath?: string\n\n /** @see [Customizing sass options](https://nextjs.org/docs/app/api-reference/next-config-js/sassOptions) */\n sassOptions?: {\n implementation?: string\n [key: string]: any\n }\n\n /**\n * Enable browser source map generation during the production build\n *\n * @see [Source Maps](https://nextjs.org/docs/advanced-features/source-maps)\n */\n productionBrowserSourceMaps?: boolean\n\n /**\n * Enable react profiling in production\n *\n */\n reactProductionProfiling?: boolean\n\n /**\n * The Next.js runtime is Strict Mode-compliant.\n *\n * @see [React Strict Mode](https://nextjs.org/docs/app/api-reference/config/next-config-js/reactStrictMode)\n */\n reactStrictMode?: boolean | null\n\n /**\n * The maximum length of the headers that are emitted by React and added to\n * the response.\n *\n * @see [React Max Headers Length](https://nextjs.org/docs/app/api-reference/config/next-config-js/reactMaxHeadersLength)\n */\n reactMaxHeadersLength?: number\n\n /**\n * Add public (in browser) runtime configuration to your app\n *\n * @see [Runtime configuration](https://nextjs.org/docs/pages/api-reference/config/next-config-js/runtime-configuration\n */\n publicRuntimeConfig?: { [key: string]: any }\n\n /**\n * Add server runtime configuration to your app\n *\n * @see [Runtime configuration](https://nextjs.org/docs/pages/api-reference/config/next-config-js/runtime-configuration\n */\n serverRuntimeConfig?: { [key: string]: any }\n\n /**\n * Next.js enables HTTP Keep-Alive by default.\n * You may want to disable HTTP Keep-Alive for certain `fetch()` calls or globally.\n *\n * @see [Disabling HTTP Keep-Alive](https://nextjs.org/docs/app/api-reference/next-config-js/httpAgentOptions)\n */\n httpAgentOptions?: { keepAlive?: boolean }\n\n /**\n * Timeout after waiting to generate static pages in seconds\n *\n * @default 60\n */\n staticPageGenerationTimeout?: number\n\n /**\n * Add `\"crossorigin\"` attribute to generated `<script>` elements generated by `<Head />` or `<NextScript />` components\n *\n *\n * @see [`crossorigin` attribute documentation](https://developer.mozilla.org/docs/Web/HTML/Attributes/crossorigin)\n */\n crossOrigin?: 'anonymous' | 'use-credentials'\n\n /**\n * Optionally enable compiler transforms\n *\n * @see [Supported Compiler Options](https://nextjs.org/docs/advanced-features/compiler#supported-features)\n */\n compiler?: {\n reactRemoveProperties?:\n | boolean\n | {\n properties?: string[]\n }\n relay?: {\n src: string\n artifactDirectory?: string\n language?: 'typescript' | 'javascript' | 'flow'\n eagerEsModules?: boolean\n }\n removeConsole?:\n | boolean\n | {\n exclude?: string[]\n }\n styledComponents?: boolean | StyledComponentsConfig\n emotion?: boolean | EmotionConfig\n\n styledJsx?:\n | boolean\n | {\n useLightningcss?: boolean\n }\n\n /**\n * Replaces variables in your code during compile time. Each key will be\n * replaced with the respective values.\n */\n define?: Record<string, string>\n }\n\n /**\n * The type of build output.\n * - `undefined`: The default build output, `.next` directory, that works with production mode `next start` or a hosting provider like Vercel\n * - `'standalone'`: A standalone build output, `.next/standalone` directory, that only includes necessary files/dependencies. Useful for self-hosting in a Docker container.\n * - `'export'`: An exported build output, `out` directory, that only includes static HTML/CSS/JS. Useful for self-hosting without a Node.js server.\n * @see [Output File Tracing](https://nextjs.org/docs/advanced-features/output-file-tracing)\n * @see [Static HTML Export](https://nextjs.org/docs/advanced-features/static-html-export)\n */\n output?: 'standalone' | 'export'\n\n /**\n * Automatically transpile and bundle dependencies from local packages (like monorepos) or from external dependencies (`node_modules`). This replaces the\n * `next-transpile-modules` package.\n * @see [transpilePackages](https://nextjs.org/docs/advanced-features/compiler#module-transpilation)\n */\n transpilePackages?: string[]\n\n skipMiddlewareUrlNormalize?: boolean\n\n skipTrailingSlashRedirect?: boolean\n\n modularizeImports?: Record<\n string,\n {\n transform: string | Record<string, string>\n preventFullImport?: boolean\n skipDefaultConversion?: boolean\n }\n >\n\n /**\n * Logging configuration. Set to `false` to disable logging.\n */\n logging?: LoggingConfig | false\n\n /**\n * period (in seconds) where the server allow to serve stale cache\n */\n expireTime?: number\n\n /**\n * Enable experimental features. Note that all experimental features are subject to breaking changes in the future.\n */\n experimental?: ExperimentalConfig\n\n /**\n * Enables the bundling of node_modules packages (externals) for pages server-side bundles.\n * @see https://nextjs.org/docs/pages/api-reference/next-config-js/bundlePagesRouterDependencies\n */\n bundlePagesRouterDependencies?: boolean\n\n /**\n * A list of packages that should be treated as external in the server build.\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/serverExternalPackages\n */\n serverExternalPackages?: string[]\n\n /**\n * This is the repo root usually and only files above this\n * directory are traced and included.\n */\n outputFileTracingRoot?: string\n\n /**\n * This allows manually excluding traced files if too many\n * are included incorrectly on a per-page basis.\n */\n outputFileTracingExcludes?: Record<string, string[]>\n\n /**\n * This allows manually including traced files if some\n * were not detected on a per-page basis.\n */\n outputFileTracingIncludes?: Record<string, string[]>\n\n watchOptions?: {\n pollIntervalMs?: number\n }\n\n /**\n * User Agent of bots that can handle streaming metadata.\n * Besides the default behavior, Next.js act differently on serving metadata to bots based on their capability.\n *\n * @default\n * /Mediapartners-Google|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview/i\n */\n htmlLimitedBots?: RegExp\n}\n\nexport const defaultConfig: NextConfig = {\n env: {},\n webpack: null,\n eslint: {\n ignoreDuringBuilds: false,\n },\n typescript: {\n ignoreBuildErrors: false,\n tsconfigPath: 'tsconfig.json',\n },\n distDir: '.next',\n cleanDistDir: true,\n assetPrefix: '',\n cacheHandler: process.env.NEXT_CACHE_HANDLER_PATH,\n // default to 50MB limit\n cacheMaxMemorySize: 50 * 1024 * 1024,\n configOrigin: 'default',\n useFileSystemPublicRoutes: true,\n generateBuildId: () => null,\n generateEtags: true,\n pageExtensions: ['tsx', 'ts', 'jsx', 'js'],\n poweredByHeader: true,\n compress: true,\n images: imageConfigDefault,\n devIndicators: {\n position: 'bottom-left',\n },\n onDemandEntries: {\n maxInactiveAge: 60 * 1000,\n pagesBufferLength: 5,\n },\n amp: {\n canonicalBase: '',\n },\n basePath: '',\n sassOptions: {},\n trailingSlash: false,\n i18n: null,\n productionBrowserSourceMaps: false,\n excludeDefaultMomentLocales: true,\n serverRuntimeConfig: {},\n publicRuntimeConfig: {},\n reactProductionProfiling: false,\n reactStrictMode: null,\n reactMaxHeadersLength: 6000,\n httpAgentOptions: {\n keepAlive: true,\n },\n logging: {},\n expireTime: process.env.NEXT_PRIVATE_CDN_CONSUMED_SWR_CACHE_CONTROL\n ? undefined\n : 31536000, // one year\n staticPageGenerationTimeout: 60,\n output: !!process.env.NEXT_PRIVATE_STANDALONE ? 'standalone' : undefined,\n modularizeImports: undefined,\n outputFileTracingRoot: process.env.NEXT_PRIVATE_OUTPUT_TRACE_ROOT || '',\n allowedDevOrigins: [],\n experimental: {\n generateOnlyEnv: false,\n nodeMiddleware: false,\n cacheLife: {\n default: {\n stale: undefined, // defaults to staleTimes.static\n revalidate: 60 * 15, // 15 minutes\n expire: INFINITE_CACHE,\n },\n seconds: {\n stale: undefined, // defaults to staleTimes.dynamic\n revalidate: 1, // 1 second\n expire: 60, // 1 minute\n },\n minutes: {\n stale: 60 * 5, // 5 minutes\n revalidate: 60, // 1 minute\n expire: 60 * 60, // 1 hour\n },\n hours: {\n stale: 60 * 5, // 5 minutes\n revalidate: 60 * 60, // 1 hour\n expire: 60 * 60 * 24, // 1 day\n },\n days: {\n stale: 60 * 5, // 5 minutes\n revalidate: 60 * 60 * 24, // 1 day\n expire: 60 * 60 * 24 * 7, // 1 week\n },\n weeks: {\n stale: 60 * 5, // 5 minutes\n revalidate: 60 * 60 * 24 * 7, // 1 week\n expire: 60 * 60 * 24 * 30, // 1 month\n },\n max: {\n stale: 60 * 5, // 5 minutes\n revalidate: 60 * 60 * 24 * 30, // 1 month\n expire: INFINITE_CACHE, // Unbounded.\n },\n },\n cacheHandlers: {\n default: process.env.NEXT_DEFAULT_CACHE_HANDLER_PATH,\n remote: process.env.NEXT_REMOTE_CACHE_HANDLER_PATH,\n static: process.env.NEXT_STATIC_CACHE_HANDLER_PATH,\n },\n cssChunking: true,\n multiZoneDraftMode: false,\n appNavFailHandling: false,\n prerenderEarlyExit: true,\n serverMinification: true,\n serverSourceMaps: false,\n linkNoTouchStart: false,\n caseSensitiveRoutes: false,\n clientSegmentCache: false,\n appDocumentPreloading: undefined,\n preloadEntriesOnStart: true,\n clientRouterFilter: true,\n clientRouterFilterRedirects: false,\n fetchCacheKeyPrefix: '',\n middlewarePrefetch: 'flexible',\n optimisticClientCache: true,\n manualClientBasePath: false,\n cpus: Math.max(\n 1,\n (Number(process.env.CIRCLE_NODE_TOTAL) ||\n (os.cpus() || { length: 1 }).length) - 1\n ),\n memoryBasedWorkersCount: false,\n imgOptConcurrency: null,\n imgOptTimeoutInSeconds: 7,\n imgOptMaxInputPixels: 268_402_689, // https://sharp.pixelplumbing.com/api-constructor#:~:text=%5Boptions.limitInputPixels%5D\n imgOptSequentialRead: null,\n isrFlushToDisk: true,\n workerThreads: false,\n proxyTimeout: undefined,\n optimizeCss: false,\n nextScriptWorkers: false,\n scrollRestoration: false,\n externalDir: false,\n disableOptimizedLoading: false,\n gzipSize: true,\n craCompat: false,\n esmExternals: true,\n fullySpecified: false,\n swcTraceProfiling: false,\n forceSwcTransforms: false,\n swcPlugins: undefined,\n largePageDataBytes: 128 * 1000, // 128KB by default\n disablePostcssPresetEnv: undefined,\n amp: undefined,\n urlImports: undefined,\n turbo: undefined,\n typedRoutes: false,\n typedEnv: false,\n clientTraceMetadata: undefined,\n parallelServerCompiles: false,\n parallelServerBuildTraces: false,\n ppr:\n // TODO: remove once we've made PPR default\n // If we're testing, and the `__NEXT_EXPERIMENTAL_PPR` environment variable\n // has been set to `true`, enable the experimental PPR feature so long as it\n // wasn't explicitly disabled in the config.\n !!(\n process.env.__NEXT_TEST_MODE &&\n process.env.__NEXT_EXPERIMENTAL_PPR === 'true'\n ),\n authInterrupts: false,\n webpackBuildWorker: undefined,\n webpackMemoryOptimizations: false,\n optimizeServerReact: true,\n useEarlyImport: false,\n viewTransition: false,\n staleTimes: {\n dynamic: 0,\n static: 300,\n },\n allowDevelopmentBuild: undefined,\n reactCompiler: undefined,\n staticGenerationRetryCount: undefined,\n serverComponentsHmrCache: true,\n staticGenerationMaxConcurrency: 8,\n staticGenerationMinPagesPerWorker: 25,\n dynamicIO: false,\n inlineCss: false,\n useCache: undefined,\n slowModuleDetection: undefined,\n },\n htmlLimitedBots: undefined,\n bundlePagesRouterDependencies: false,\n}\n\nexport async function normalizeConfig(phase: string, config: any) {\n if (typeof config === 'function') {\n config = config(phase, { defaultConfig })\n }\n // Support `new Promise` and `async () =>` as return values of the config export\n return await config\n}\n"],"names":["os","imageConfigDefault","INFINITE_CACHE","defaultConfig","env","webpack","eslint","ignoreDuringBuilds","typescript","ignoreBuildErrors","tsconfigPath","distDir","cleanDistDir","assetPrefix","cacheHandler","process","NEXT_CACHE_HANDLER_PATH","cacheMaxMemorySize","configOrigin","useFileSystemPublicRoutes","generateBuildId","generateEtags","pageExtensions","poweredByHeader","compress","images","devIndicators","position","onDemandEntries","maxInactiveAge","pagesBufferLength","amp","canonicalBase","basePath","sassOptions","trailingSlash","i18n","productionBrowserSourceMaps","excludeDefaultMomentLocales","serverRuntimeConfig","publicRuntimeConfig","reactProductionProfiling","reactStrictMode","reactMaxHeadersLength","httpAgentOptions","keepAlive","logging","expireTime","NEXT_PRIVATE_CDN_CONSUMED_SWR_CACHE_CONTROL","undefined","staticPageGenerationTimeout","output","NEXT_PRIVATE_STANDALONE","modularizeImports","outputFileTracingRoot","NEXT_PRIVATE_OUTPUT_TRACE_ROOT","allowedDevOrigins","experimental","generateOnlyEnv","nodeMiddleware","cacheLife","default","stale","revalidate","expire","seconds","minutes","hours","days","weeks","max","cacheHandlers","NEXT_DEFAULT_CACHE_HANDLER_PATH","remote","NEXT_REMOTE_CACHE_HANDLER_PATH","static","NEXT_STATIC_CACHE_HANDLER_PATH","cssChunking","multiZoneDraftMode","appNavFailHandling","prerenderEarlyExit","serverMinification","serverSourceMaps","linkNoTouchStart","caseSensitiveRoutes","clientSegmentCache","appDocumentPreloading","preloadEntriesOnStart","clientRouterFilter","clientRouterFilterRedirects","fetchCacheKeyPrefix","middlewarePrefetch","optimisticClientCache","manualClientBasePath","cpus","Math","Number","CIRCLE_NODE_TOTAL","length","memoryBasedWorkersCount","imgOptConcurrency","imgOptTimeoutInSeconds","imgOptMaxInputPixels","imgOptSequentialRead","isrFlushToDisk","workerThreads","proxyTimeout","optimizeCss","nextScriptWorkers","scrollRestoration","externalDir","disableOptimizedLoading","gzipSize","craCompat","esmExternals","fullySpecified","swcTraceProfiling","forceSwcTransforms","swcPlugins","largePageDataBytes","disablePostcssPresetEnv","urlImports","turbo","typedRoutes","typedEnv","clientTraceMetadata","parallelServerCompiles","parallelServerBuildTraces","ppr","__NEXT_TEST_MODE","__NEXT_EXPERIMENTAL_PPR","authInterrupts","webpackBuildWorker","webpackMemoryOptimizations","optimizeServerReact","useEarlyImport","viewTransition","staleTimes","dynamic","allowDevelopmentBuild","reactCompiler","staticGenerationRetryCount","serverComponentsHmrCache","staticGenerationMaxConcurrency","staticGenerationMinPagesPerWorker","dynamicIO","inlineCss","useCache","slowModuleDetection","htmlLimitedBots","bundlePagesRouterDependencies","normalizeConfig","phase","config"],"mappings":"AAAA,OAAOA,QAAQ,KAAI;AAGnB,SAASC,kBAAkB,QAAQ,6BAA4B;AAW/D,SAASC,cAAc,QAAQ,mBAAkB;AA4iCjD,OAAO,MAAMC,gBAA4B;IACvCC,KAAK,CAAC;IACNC,SAAS;IACTC,QAAQ;QACNC,oBAAoB;IACtB;IACAC,YAAY;QACVC,mBAAmB;QACnBC,cAAc;IAChB;IACAC,SAAS;IACTC,cAAc;IACdC,aAAa;IACbC,cAAcC,QAAQX,GAAG,CAACY,uBAAuB;IACjD,wBAAwB;IACxBC,oBAAoB,KAAK,OAAO;IAChCC,cAAc;IACdC,2BAA2B;IAC3BC,iBAAiB,IAAM;IACvBC,eAAe;IACfC,gBAAgB;QAAC;QAAO;QAAM;QAAO;KAAK;IAC1CC,iBAAiB;IACjBC,UAAU;IACVC,QAAQxB;IACRyB,eAAe;QACbC,UAAU;IACZ;IACAC,iBAAiB;QACfC,gBAAgB,KAAK;QACrBC,mBAAmB;IACrB;IACAC,KAAK;QACHC,eAAe;IACjB;IACAC,UAAU;IACVC,aAAa,CAAC;IACdC,eAAe;IACfC,MAAM;IACNC,6BAA6B;IAC7BC,6BAA6B;IAC7BC,qBAAqB,CAAC;IACtBC,qBAAqB,CAAC;IACtBC,0BAA0B;IAC1BC,iBAAiB;IACjBC,uBAAuB;IACvBC,kBAAkB;QAChBC,WAAW;IACb;IACAC,SAAS,CAAC;IACVC,YAAYhC,QAAQX,GAAG,CAAC4C,2CAA2C,GAC/DC,YACA;IACJC,6BAA6B;IAC7BC,QAAQ,CAAC,CAACpC,QAAQX,GAAG,CAACgD,uBAAuB,GAAG,e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AgF;IAChF,OAAO,MAAMsJ;AACf"}
|
@@ -83,7 +83,7 @@ export async function createHotReloaderTurbopack(opts, serverFields, distDir, re
|
|
83
83
|
}
|
84
84
|
const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
|
85
85
|
const hotReloaderSpan = trace('hot-reloader', undefined, {
|
86
|
-
version: "15.3.0-canary.
|
86
|
+
version: "15.3.0-canary.4"
|
87
87
|
});
|
88
88
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
89
89
|
// of the current `next dev` invocation.
|
@@ -180,7 +180,7 @@ export default class HotReloaderWebpack {
|
|
180
180
|
this.previewProps = previewProps;
|
181
181
|
this.rewrites = rewrites;
|
182
182
|
this.hotReloaderSpan = trace('hot-reloader', undefined, {
|
183
|
-
version: "15.3.0-canary.
|
183
|
+
version: "15.3.0-canary.4"
|
184
184
|
});
|
185
185
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
186
186
|
// of the current `next dev` invocation.
|
@@ -4,7 +4,7 @@ import { bold, purple } from '../../lib/picocolors';
|
|
4
4
|
import { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD } from '../../shared/lib/constants';
|
5
5
|
import loadConfig, { getConfiguredExperimentalFeatures } from '../config';
|
6
6
|
export function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures, maxExperimentalFeatures = Infinity }) {
|
7
|
-
Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.3.0-canary.
|
7
|
+
Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.3.0-canary.4"}`))}${process.env.TURBOPACK ? ' (Turbopack)' : ''}`);
|
8
8
|
if (appUrl) {
|
9
9
|
Log.bootstrap(`- Local: ${appUrl}`);
|
10
10
|
}
|
@@ -97,7 +97,7 @@ export async function initialize(opts) {
|
|
97
97
|
renderServer.instance = require('./render-server');
|
98
98
|
const allowedOrigins = [
|
99
99
|
'localhost',
|
100
|
-
...config.
|
100
|
+
...config.allowedDevOrigins || []
|
101
101
|
];
|
102
102
|
if (opts.hostname) {
|
103
103
|
allowedOrigins.push(opts.hostname);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/server/lib/router-server.ts"],"sourcesContent":["// this must come first as it includes require hooks\nimport type { WorkerRequestHandler, WorkerUpgradeHandler } from './types'\nimport type { DevBundler, ServerFields } from './router-utils/setup-dev-bundler'\nimport type { NextUrlWithParsedQuery, RequestMeta } from '../request-meta'\n\n// This is required before other imports to ensure the require hook is setup.\nimport '../node-environment'\nimport '../require-hook'\n\nimport url from 'url'\nimport path from 'path'\nimport loadConfig from '../config'\nimport { serveStatic } from '../serve-static'\nimport setupDebug from 'next/dist/compiled/debug'\nimport * as Log from '../../build/output/log'\nimport { DecodeError } from '../../shared/lib/utils'\nimport { findPagesDir } from '../../lib/find-pages-dir'\nimport { setupFsCheck } from './router-utils/filesystem'\nimport { proxyRequest } from './router-utils/proxy-request'\nimport { isAbortError, pipeToNodeResponse } from '../pipe-readable'\nimport { getResolveRoutes } from './router-utils/resolve-routes'\nimport { addRequestMeta, getRequestMeta } from '../request-meta'\nimport { pathHasPrefix } from '../../shared/lib/router/utils/path-has-prefix'\nimport { removePathPrefix } from '../../shared/lib/router/utils/remove-path-prefix'\nimport setupCompression from 'next/dist/compiled/compression'\nimport { NoFallbackError } from '../base-server'\nimport { signalFromNodeResponse } from '../web/spec-extension/adapters/next-request'\nimport { isPostpone } from './router-utils/is-postpone'\nimport { parseUrl as parseUrlUtil } from '../../shared/lib/router/utils/parse-url'\n\nimport {\n PHASE_PRODUCTION_SERVER,\n PHASE_DEVELOPMENT_SERVER,\n UNDERSCORE_NOT_FOUND_ROUTE,\n} from '../../shared/lib/constants'\nimport { RedirectStatusCode } from '../../client/components/redirect-status-code'\nimport { DevBundlerService } from './dev-bundler-service'\nimport { type Span, trace } from '../../trace'\nimport { ensureLeadingSlash } from '../../shared/lib/page-path/ensure-leading-slash'\nimport { getNextPathnameInfo } from '../../shared/lib/router/utils/get-next-pathname-info'\nimport { getHostname } from '../../shared/lib/get-hostname'\nimport { detectDomainLocale } from '../../shared/lib/i18n/detect-domain-locale'\nimport { MockedResponse } from './mock-request'\nimport {\n HMR_ACTIONS_SENT_TO_BROWSER,\n type AppIsrManifestAction,\n} from '../dev/hot-reloader-types'\nimport { normalizedAssetPrefix } from '../../shared/lib/normalized-asset-prefix'\nimport { NEXT_PATCH_SYMBOL } from './patch-fetch'\nimport type { ServerInitResult } from './render-server'\nimport { filterInternalHeaders } from './server-ipc/utils'\nimport { blockCrossSite } from './router-utils/block-cross-site'\n\nconst debug = setupDebug('next:router-server:main')\nconst isNextFont = (pathname: string | null) =>\n pathname && /\\/media\\/[^/]+\\.(woff|woff2|eot|ttf|otf)$/.test(pathname)\n\nexport type RenderServer = Pick<\n typeof import('./render-server'),\n | 'initialize'\n | 'clearModuleContext'\n | 'propagateServerField'\n | 'getServerField'\n>\n\nexport interface LazyRenderServerInstance {\n instance?: RenderServer\n}\n\nconst requestHandlers: Record<string, WorkerRequestHandler> = {}\n\nexport async function initialize(opts: {\n dir: string\n port: number\n dev: boolean\n onDevServerCleanup: ((listener: () => Promise<void>) => void) | undefined\n server?: import('http').Server\n minimalMode?: boolean\n hostname?: string\n keepAliveTimeout?: number\n customServer?: boolean\n experimentalHttpsServer?: boolean\n startServerSpan?: Span\n quiet?: boolean\n}): Promise<ServerInitResult> {\n if (!process.env.NODE_ENV) {\n // @ts-ignore not readonly\n process.env.NODE_ENV = opts.dev ? 'development' : 'production'\n }\n\n const config = await loadConfig(\n opts.dev ? PHASE_DEVELOPMENT_SERVER : PHASE_PRODUCTION_SERVER,\n opts.dir,\n { silent: false }\n )\n\n let compress: ReturnType<typeof setupCompression> | undefined\n\n if (config?.compress !== false) {\n compress = setupCompression()\n }\n\n const fsChecker = await setupFsCheck({\n dev: opts.dev,\n dir: opts.dir,\n config,\n minimalMode: opts.minimalMode,\n })\n\n const renderServer: LazyRenderServerInstance = {}\n\n let developmentBundler: DevBundler | undefined\n\n let devBundlerService: DevBundlerService | undefined\n\n let originalFetch = globalThis.fetch\n\n if (opts.dev) {\n const { Telemetry } =\n require('../../telemetry/storage') as typeof import('../../telemetry/storage')\n\n const telemetry = new Telemetry({\n distDir: path.join(opts.dir, config.distDir),\n })\n const { pagesDir, appDir } = findPagesDir(opts.dir)\n\n const { setupDevBundler } =\n require('./router-utils/setup-dev-bundler') as typeof import('./router-utils/setup-dev-bundler')\n\n const resetFetch = () => {\n globalThis.fetch = originalFetch\n ;(globalThis as Record<symbol, unknown>)[NEXT_PATCH_SYMBOL] = false\n }\n\n const setupDevBundlerSpan = opts.startServerSpan\n ? opts.startServerSpan.traceChild('setup-dev-bundler')\n : trace('setup-dev-bundler')\n developmentBundler = await setupDevBundlerSpan.traceAsyncFn(() =>\n setupDevBundler({\n // Passed here but the initialization of this object happens below, doing the initialization before the setupDev call breaks.\n renderServer,\n appDir,\n pagesDir,\n telemetry,\n fsChecker,\n dir: opts.dir,\n nextConfig: config,\n isCustomServer: opts.customServer,\n turbo: !!process.env.TURBOPACK,\n port: opts.port,\n onDevServerCleanup: opts.onDevServerCleanup,\n resetFetch,\n })\n )\n\n devBundlerService = new DevBundlerService(\n developmentBundler,\n // The request handler is assigned below, this allows us to create a lazy\n // reference to it.\n (req, res) => {\n return requestHandlers[opts.dir](req, res)\n }\n )\n }\n\n renderServer.instance =\n require('./render-server') as typeof import('./render-server')\n\n const allowedOrigins = [\n 'localhost',\n ...(config.experimental.allowedDevOrigins || []),\n ]\n if (opts.hostname) {\n allowedOrigins.push(opts.hostname)\n }\n\n const requestHandlerImpl: WorkerRequestHandler = async (req, res) => {\n // internal headers should not be honored by the request handler\n if (!process.env.NEXT_PRIVATE_TEST_HEADERS) {\n filterInternalHeaders(req.headers)\n }\n\n if (\n !opts.minimalMode &&\n config.i18n &&\n config.i18n.localeDetection !== false\n ) {\n const urlParts = (req.url || '').split('?', 1)\n let urlNoQuery = urlParts[0] || ''\n\n if (config.basePath) {\n urlNoQuery = removePathPrefix(urlNoQuery, config.basePath)\n }\n\n const pathnameInfo = getNextPathnameInfo(urlNoQuery, {\n nextConfig: config,\n })\n\n const domainLocale = detectDomainLocale(\n config.i18n.domains,\n getHostname({ hostname: urlNoQuery }, req.headers)\n )\n\n const defaultLocale =\n domainLocale?.defaultLocale || config.i18n.defaultLocale\n\n const { getLocaleRedirect } =\n require('../../shared/lib/i18n/get-locale-redirect') as typeof import('../../shared/lib/i18n/get-locale-redirect')\n\n const parsedUrl = parseUrlUtil((req.url || '')?.replace(/^\\/+/, '/'))\n\n const redirect = getLocaleRedirect({\n defaultLocale,\n domainLocale,\n headers: req.headers,\n nextConfig: config,\n pathLocale: pathnameInfo.locale,\n urlParsed: {\n ...parsedUrl,\n pathname: pathnameInfo.locale\n ? `/${pathnameInfo.locale}${urlNoQuery}`\n : urlNoQuery,\n },\n })\n\n if (redirect) {\n res.setHeader('Location', redirect)\n res.statusCode = RedirectStatusCode.TemporaryRedirect\n res.end(redirect)\n return\n }\n }\n\n if (compress) {\n // @ts-expect-error not express req/res\n compress(req, res, () => {})\n }\n req.on('error', (_err) => {\n // TODO: log socket errors?\n })\n res.on('error', (_err) => {\n // TODO: log socket errors?\n })\n\n const invokedOutputs = new Set<string>()\n\n async function invokeRender(\n parsedUrl: NextUrlWithParsedQuery,\n invokePath: string,\n handleIndex: number,\n additionalRequestMeta?: RequestMeta\n ) {\n // invokeRender expects /api routes to not be locale prefixed\n // so normalize here before continuing\n if (\n config.i18n &&\n removePathPrefix(invokePath, config.basePath).startsWith(\n `/${getRequestMeta(req, 'locale')}/api`\n )\n ) {\n invokePath = fsChecker.handleLocale(\n removePathPrefix(invokePath, config.basePath)\n ).pathname\n }\n\n if (\n req.headers['x-nextjs-data'] &&\n fsChecker.getMiddlewareMatchers()?.length &&\n removePathPrefix(invokePath, config.basePath) === '/404'\n ) {\n res.setHeader('x-nextjs-matched-path', parsedUrl.pathname || '')\n res.statusCode = 404\n res.setHeader('content-type', 'application/json')\n res.end('{}')\n return null\n }\n\n if (!handlers) {\n throw new Error('Failed to initialize render server')\n }\n\n addRequestMeta(req, 'invokePath', invokePath)\n addRequestMeta(req, 'invokeQuery', parsedUrl.query)\n addRequestMeta(req, 'middlewareInvoke', false)\n\n for (const key in additionalRequestMeta || {}) {\n addRequestMeta(\n req,\n key as keyof RequestMeta,\n additionalRequestMeta![key as keyof RequestMeta]\n )\n }\n\n debug('invokeRender', req.url, req.headers)\n\n try {\n const initResult =\n await renderServer?.instance?.initialize(renderServerOpts)\n try {\n await initResult?.requestHandler(req, res)\n } catch (err) {\n if (err instanceof NoFallbackError) {\n // eslint-disable-next-line\n await handleRequest(handleIndex + 1)\n return\n }\n throw err\n }\n return\n } catch (e) {\n // If the client aborts before we can receive a response object (when\n // the headers are flushed), then we can early exit without further\n // processing.\n if (isAbortError(e)) {\n return\n }\n throw e\n }\n }\n\n const handleRequest = async (handleIndex: number) => {\n if (handleIndex > 5) {\n throw new Error(`Attempted to handle request too many times ${req.url}`)\n }\n\n // handle hot-reloader first\n if (developmentBundler) {\n if (blockCrossSite(req, res, allowedOrigins, `${opts.port}`)) {\n return\n }\n const origUrl = req.url || '/'\n\n if (config.basePath && pathHasPrefix(origUrl, config.basePath)) {\n req.url = removePathPrefix(origUrl, config.basePath)\n }\n const parsedUrl = url.parse(req.url || '/')\n\n const hotReloaderResult = await developmentBundler.hotReloader.run(\n req,\n res,\n parsedUrl\n )\n\n if (hotReloaderResult.finished) {\n return hotReloaderResult\n }\n req.url = origUrl\n }\n\n const {\n finished,\n parsedUrl,\n statusCode,\n resHeaders,\n bodyStream,\n matchedOutput,\n } = await resolveRoutes({\n req,\n res,\n isUpgradeReq: false,\n signal: signalFromNodeResponse(res),\n invokedOutputs,\n })\n\n if (res.closed || res.finished) {\n return\n }\n\n if (developmentBundler && matchedOutput?.type === 'devVirtualFsItem') {\n const origUrl = req.url || '/'\n\n if (config.basePath && pathHasPrefix(origUrl, config.basePath)) {\n req.url = removePathPrefix(origUrl, config.basePath)\n }\n\n if (resHeaders) {\n for (const key of Object.keys(resHeaders)) {\n res.setHeader(key, resHeaders[key])\n }\n }\n const result = await developmentBundler.requestHandler(req, res)\n\n if (result.finished) {\n return\n }\n // TODO: throw invariant if we resolved to this but it wasn't handled?\n req.url = origUrl\n }\n\n debug('requestHandler!', req.url, {\n matchedOutput,\n statusCode,\n resHeaders,\n bodyStream: !!bodyStream,\n parsedUrl: {\n pathname: parsedUrl.pathname,\n query: parsedUrl.query,\n },\n finished,\n })\n\n // apply any response headers from routing\n for (const key of Object.keys(resHeaders || {})) {\n res.setHeader(key, resHeaders[key])\n }\n\n // handle redirect\n if (!bodyStream && statusCode && statusCode > 300 && statusCode < 400) {\n const destination = url.format(parsedUrl)\n res.statusCode = statusCode\n res.setHeader('location', destination)\n\n if (statusCode === RedirectStatusCode.PermanentRedirect) {\n res.setHeader('Refresh', `0;url=${destination}`)\n }\n return res.end(destination)\n }\n\n // handle middleware body response\n if (bodyStream) {\n res.statusCode = statusCode || 200\n return await pipeToNodeResponse(bodyStream, res)\n }\n\n if (finished && parsedUrl.protocol) {\n return await proxyRequest(\n req,\n res,\n parsedUrl,\n undefined,\n getRequestMeta(req, 'clonableBody')?.cloneBodyStream(),\n config.experimental.proxyTimeout\n )\n }\n\n if (matchedOutput?.fsPath && matchedOutput.itemPath) {\n if (\n opts.dev &&\n (fsChecker.appFiles.has(matchedOutput.itemPath) ||\n fsChecker.pageFiles.has(matchedOutput.itemPath))\n ) {\n res.statusCode = 500\n const message = `A conflicting public file and page file was found for path ${matchedOutput.itemPath} https://nextjs.org/docs/messages/conflicting-public-file-page`\n await invokeRender(parsedUrl, '/_error', handleIndex, {\n invokeStatus: 500,\n invokeError: new Error(message),\n })\n Log.error(message)\n return\n }\n\n if (\n !res.getHeader('cache-control') &&\n matchedOutput.type === 'nextStaticFolder'\n ) {\n if (opts.dev && !isNextFont(parsedUrl.pathname)) {\n res.setHeader('Cache-Control', 'no-store, must-revalidate')\n } else {\n res.setHeader(\n 'Cache-Control',\n 'public, max-age=31536000, immutable'\n )\n }\n }\n if (!(req.method === 'GET' || req.method === 'HEAD')) {\n res.setHeader('Allow', ['GET', 'HEAD'])\n res.statusCode = 405\n return await invokeRender(\n url.parse('/405', true),\n '/405',\n handleIndex,\n {\n invokeStatus: 405,\n }\n )\n }\n\n try {\n return await serveStatic(req, res, matchedOutput.itemPath, {\n root: matchedOutput.itemsRoot,\n // Ensures that etags are not generated for static files when disabled.\n etag: config.generateEtags,\n })\n } catch (err: any) {\n /**\n * Hardcoded every possible error status code that could be thrown by \"serveStatic\" method\n * This is done by searching \"this.error\" inside \"send\" module's source code:\n * https://github.com/pillarjs/send/blob/master/index.js\n * https://github.com/pillarjs/send/blob/develop/index.js\n */\n const POSSIBLE_ERROR_CODE_FROM_SERVE_STATIC = new Set([\n // send module will throw 500 when header is already sent or fs.stat error happens\n // https://github.com/pillarjs/send/blob/53f0ab476145670a9bdd3dc722ab2fdc8d358fc6/index.js#L392\n // Note: we will use Next.js built-in 500 page to handle 500 errors\n // 500,\n\n // send module will throw 404 when file is missing\n // https://github.com/pillarjs/send/blob/53f0ab476145670a9bdd3dc722ab2fdc8d358fc6/index.js#L421\n // Note: we will use Next.js built-in 404 page to handle 404 errors\n // 404,\n\n // send module will throw 403 when redirecting to a directory without enabling directory listing\n // https://github.com/pillarjs/send/blob/53f0ab476145670a9bdd3dc722ab2fdc8d358fc6/index.js#L484\n // Note: Next.js throws a different error (without status code) for directory listing\n // 403,\n\n // send module will throw 400 when fails to normalize the path\n // https://github.com/pillarjs/send/blob/53f0ab476145670a9bdd3dc722ab2fdc8d358fc6/index.js#L520\n 400,\n\n // send module will throw 412 with conditional GET request\n // https://github.com/pillarjs/send/blob/53f0ab476145670a9bdd3dc722ab2fdc8d358fc6/index.js#L632\n 412,\n\n // send module will throw 416 when range is not satisfiable\n // https://github.com/pillarjs/send/blob/53f0ab476145670a9bdd3dc722ab2fdc8d358fc6/index.js#L669\n 416,\n ])\n\n let validErrorStatus = POSSIBLE_ERROR_CODE_FROM_SERVE_STATIC.has(\n err.statusCode\n )\n\n // normalize non-allowed status codes\n if (!validErrorStatus) {\n ;(err as any).statusCode = 400\n }\n\n if (typeof err.statusCode === 'number') {\n const invokePath = `/${err.statusCode}`\n const invokeStatus = err.statusCode\n res.statusCode = err.statusCode\n return await invokeRender(\n url.parse(invokePath, true),\n invokePath,\n handleIndex,\n {\n invokeStatus,\n }\n )\n }\n throw err\n }\n }\n\n if (matchedOutput) {\n invokedOutputs.add(matchedOutput.itemPath)\n\n return await invokeRender(\n parsedUrl,\n parsedUrl.pathname || '/',\n handleIndex,\n {\n invokeOutput: matchedOutput.itemPath,\n }\n )\n }\n\n // 404 case\n res.setHeader(\n 'Cache-Control',\n 'private, no-cache, no-store, max-age=0, must-revalidate'\n )\n\n // Short-circuit favicon.ico serving so that the 404 page doesn't get built as favicon is requested by the browser when loading any route.\n if (opts.dev && !matchedOutput && parsedUrl.pathname === '/favicon.ico') {\n res.statusCode = 404\n res.end('')\n return null\n }\n\n const appNotFound = opts.dev\n ? developmentBundler?.serverFields.hasAppNotFound\n : await fsChecker.getItem(UNDERSCORE_NOT_FOUND_ROUTE)\n\n res.statusCode = 404\n\n if (appNotFound) {\n return await invokeRender(\n parsedUrl,\n UNDERSCORE_NOT_FOUND_ROUTE,\n handleIndex,\n {\n invokeStatus: 404,\n }\n )\n }\n\n await invokeRender(parsedUrl, '/404', handleIndex, {\n invokeStatus: 404,\n })\n }\n\n try {\n await handleRequest(0)\n } catch (err) {\n try {\n let invokePath = '/500'\n let invokeStatus = '500'\n\n if (err instanceof DecodeError) {\n invokePath = '/400'\n invokeStatus = '400'\n } else {\n console.error(err)\n }\n res.statusCode = Number(invokeStatus)\n return await invokeRender(url.parse(invokePath, true), invokePath, 0, {\n invokeStatus: res.statusCode,\n })\n } catch (err2) {\n console.error(err2)\n }\n res.statusCode = 500\n res.end('Internal Server Error')\n }\n }\n\n let requestHandler: WorkerRequestHandler = requestHandlerImpl\n if (config.experimental.testProxy) {\n // Intercept fetch and other testmode apis.\n const { wrapRequestHandlerWorker, interceptTestApis } =\n require('next/dist/experimental/testmode/server') as typeof import('next/src/experimental/testmode/server')\n requestHandler = wrapRequestHandlerWorker(requestHandler)\n interceptTestApis()\n // We treat the intercepted fetch as \"original\" fetch that should be reset to during HMR.\n originalFetch = globalThis.fetch\n }\n requestHandlers[opts.dir] = requestHandler\n\n const renderServerOpts: Parameters<RenderServer['initialize']>[0] = {\n port: opts.port,\n dir: opts.dir,\n hostname: opts.hostname,\n minimalMode: opts.minimalMode,\n dev: !!opts.dev,\n server: opts.server,\n serverFields: {\n ...(developmentBundler?.serverFields || {}),\n setIsrStatus: devBundlerService?.setIsrStatus.bind(devBundlerService),\n } satisfies ServerFields,\n experimentalTestProxy: !!config.experimental.testProxy,\n experimentalHttpsServer: !!opts.experimentalHttpsServer,\n bundlerService: devBundlerService,\n startServerSpan: opts.startServerSpan,\n quiet: opts.quiet,\n onDevServerCleanup: opts.onDevServerCleanup,\n }\n renderServerOpts.serverFields.routerServerHandler = requestHandlerImpl\n\n // pre-initialize workers\n const handlers = await renderServer.instance.initialize(renderServerOpts)\n\n const logError = async (\n type: 'uncaughtException' | 'unhandledRejection',\n err: Error | undefined\n ) => {\n if (isPostpone(err)) {\n // React postpones that are unhandled might end up logged here but they're\n // not really errors. They're just part of rendering.\n return\n }\n if (type === 'unhandledRejection') {\n Log.error('unhandledRejection: ', err)\n } else if (type === 'uncaughtException') {\n Log.error('uncaughtException: ', err)\n }\n }\n\n process.on('uncaughtException', logError.bind(null, 'uncaughtException'))\n process.on('unhandledRejection', logError.bind(null, 'unhandledRejection'))\n\n const resolveRoutes = getResolveRoutes(\n fsChecker,\n config,\n opts,\n renderServer.instance,\n renderServerOpts,\n developmentBundler?.ensureMiddleware\n )\n\n const upgradeHandler: WorkerUpgradeHandler = async (req, socket, head) => {\n try {\n req.on('error', (_err) => {\n // TODO: log socket errors?\n // console.error(_err);\n })\n socket.on('error', (_err) => {\n // TODO: log socket errors?\n // console.error(_err);\n })\n\n if (opts.dev && developmentBundler && req.url) {\n if (blockCrossSite(req, socket, allowedOrigins, `${opts.port}`)) {\n return\n }\n const { basePath, assetPrefix } = config\n\n let hmrPrefix = basePath\n\n // assetPrefix overrides basePath for HMR path\n if (assetPrefix) {\n hmrPrefix = normalizedAssetPrefix(assetPrefix)\n\n if (URL.canParse(hmrPrefix)) {\n // remove trailing slash from pathname\n // return empty string if pathname is '/'\n // to avoid conflicts with '/_next' below\n hmrPrefix = new URL(hmrPrefix).pathname.replace(/\\/$/, '')\n }\n }\n\n const isHMRRequest = req.url.startsWith(\n ensureLeadingSlash(`${hmrPrefix}/_next/webpack-hmr`)\n )\n\n // only handle HMR requests if the basePath in the request\n // matches the basePath for the handler responding to the request\n if (isHMRRequest) {\n return developmentBundler.hotReloader.onHMR(\n req,\n socket,\n head,\n (client) => {\n client.send(\n JSON.stringify({\n action: HMR_ACTIONS_SENT_TO_BROWSER.ISR_MANIFEST,\n data: devBundlerService?.appIsrManifest || {},\n } satisfies AppIsrManifestAction)\n )\n }\n )\n }\n }\n\n const res = new MockedResponse({\n resWriter: () => {\n throw new Error(\n 'Invariant: did not expect response writer to be written to for upgrade request'\n )\n },\n })\n const { matchedOutput, parsedUrl } = await resolveRoutes({\n req,\n res,\n isUpgradeReq: true,\n signal: signalFromNodeResponse(socket),\n })\n\n // TODO: allow upgrade requests to pages/app paths?\n // this was not previously supported\n if (matchedOutput) {\n return socket.end()\n }\n\n if (parsedUrl.protocol) {\n return await proxyRequest(req, socket, parsedUrl, head)\n }\n\n // If there's no matched output, we don't handle the request as user's\n // custom WS server may be listening on the same path.\n } catch (err) {\n console.error('Error handling upgrade request', err)\n socket.end()\n }\n }\n\n return {\n requestHandler,\n upgradeHandler,\n server: handlers.server,\n closeUpgraded() {\n developmentBundler?.hotReloader?.close()\n },\n }\n}\n"],"names":["url","path","loadConfig","serveStatic","setupDebug","Log","DecodeError","findPagesDir","setupFsCheck","proxyRequest","isAbortError","pipeToNodeResponse","getResolveRoutes","addRequestMeta","getRequestMeta","pathHasPrefix","removePathPrefix","setupCompression","NoFallbackError","signalFromNodeResponse","isPostpone","parseUrl","parseUrlUtil","PHASE_PRODUCTION_SERVER","PHASE_DEVELOPMENT_SERVER","UNDERSCORE_NOT_FOUND_ROUTE","RedirectStatusCode","DevBundlerService","trace","ensureLeadingSlash","getNextPathnameInfo","getHostname","detectDomainLocale","MockedResponse","HMR_ACTIONS_SENT_TO_BROWSER","normalizedAssetPrefix","NEXT_PATCH_SYMBOL","filterInternalHeaders","blockCrossSite","debug","isNextFont","pathname","test","requestHandlers","initialize","opts","process","env","NODE_ENV","dev","config","dir","silent","compress","fsChecker","minimalMode","renderServer","developmentBundler","devBundlerService","originalFetch","globalThis","fetch","Telemetry","require","telemetry","distDir","join","pagesDir","appDir","setupDevBundler","resetFetch","setupDevBundlerSpan","startServerSpan","traceChild","traceAsyncFn","nextConfig","isCustomServer","customServer","turbo","TURBOPACK","port","onDevServerCleanup","req","res","instance","allowedOrigins","experimental","allowedDevOrigins","hostname","push","requestHandlerImpl","NEXT_PRIVATE_TEST_HEADERS","headers","i18n","localeDetection","urlParts","split","urlNoQuery","basePath","pathnameInfo","domainLocale","domains","defaultLocale","getLocaleRedirect","parsedUrl","replace","redirect","pathLocale","locale","urlParsed","setHeader","statusCode","TemporaryRedirect","end","on","_err","invokedOutputs","Set","invokeRender","invokePath","handleIndex","additionalRequestMeta","startsWith","handleLocale","getMiddlewareMatchers","length","handlers","Error","query","key","initResult","renderServerOpts","requestHandler","err","handleRequest","e","origUrl","parse","hotReloaderResult","hotReloader","run","finished","resHeaders","bodyStream","matchedOutput","resolveRoutes","isUpgradeReq","signal","closed","type","Object","keys","result","destination","format","PermanentRedirect","protocol","undefined","cloneBodyStream","proxyTimeout","fsPath","itemPath","appFiles","has","pageFiles","message","invokeStatus","invokeError","error","getHeader","method","root","itemsRoot","etag","generateEtags","POSSIBLE_ERROR_CODE_FROM_SERVE_STATIC","validErrorStatus","add","invokeOutput","appNotFound","serverFields","hasAppNotFound","getItem","console","Number","err2","testProxy","wrapRequestHandlerWorker","interceptTestApis","server","setIsrStatus","bind","experimentalTestProxy","experimentalHttpsServer","bundlerService","quiet","routerServerHandler","logError","ensureMiddleware","upgradeHandler","socket","head","assetPrefix","hmrPrefix","URL","canParse","isHMRRequest","onHMR","client","send","JSON","stringify","action","ISR_MANIFEST","data","appIsrManifest","resWriter","closeUpgraded","close"],"mappings":"AAAA,oDAAoD;AAKpD,6EAA6E;AAC7E,OAAO,sBAAqB;AAC5B,OAAO,kBAAiB;AAExB,OAAOA,SAAS,MAAK;AACrB,OAAOC,UAAU,OAAM;AACvB,OAAOC,gBAAgB,YAAW;AAClC,SAASC,WAAW,QAAQ,kBAAiB;AAC7C,OAAOC,gBAAgB,2BAA0B;AACjD,YAAYC,SAAS,yBAAwB;AAC7C,SAASC,WAAW,QAAQ,yBAAwB;AACpD,SAASC,YAAY,QAAQ,2BAA0B;AACvD,SAASC,YAAY,QAAQ,4BAA2B;AACxD,SAASC,YAAY,QAAQ,+BAA8B;AAC3D,SAASC,YAAY,EAAEC,kBAAkB,QAAQ,mBAAkB;AACnE,SAASC,gBAAgB,QAAQ,gCAA+B;AAChE,SAASC,cAAc,EAAEC,cAAc,QAAQ,kBAAiB;AAChE,SAASC,aAAa,QAAQ,gDAA+C;AAC7E,SAASC,gBAAgB,QAAQ,mDAAkD;AACnF,OAAOC,sBAAsB,iCAAgC;AAC7D,SAASC,eAAe,QAAQ,iBAAgB;AAChD,SAASC,sBAAsB,QAAQ,8CAA6C;AACpF,SAASC,UAAU,QAAQ,6BAA4B;AACvD,SAASC,YAAYC,YAAY,QAAQ,0CAAyC;AAElF,SACEC,uBAAuB,EACvBC,wBAAwB,EACxBC,0BAA0B,QACrB,6BAA4B;AACnC,SAASC,kBAAkB,QAAQ,+CAA8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A,MAAMqG,eAAe5H,IAAIlF,GAAG,CAAC0H,UAAU,CACrC7F,mBAAmB,GAAG8K,UAAU,kBAAkB,CAAC;gBAGrD,0DAA0D;gBAC1D,iEAAiE;gBACjE,IAAIG,cAAc;oBAChB,OAAOrJ,mBAAmBkF,WAAW,CAACoE,KAAK,CACzC7H,KACAsH,QACAC,MACA,CAACO;wBACCA,OAAOC,IAAI,CACTC,KAAKC,SAAS,CAAC;4BACbC,QAAQlL,4BAA4BmL,YAAY;4BAChDC,MAAM5J,CAAAA,qCAAAA,kBAAmB6J,cAAc,KAAI,CAAC;wBAC9C;oBAEJ;gBAEJ;YACF;YAEA,MAAMpI,MAAM,IAAIlD,eAAe;gBAC7BuL,WAAW;oBACT,MAAM,qBAEL,CAFK,IAAIzF,MACR,mFADI,qBAAA;+BAAA;oCAAA;sCAAA;oBAEN;gBACF;YACF;YACA,MAAM,EAAEiB,aAAa,EAAExC,SAAS,EAAE,GAAG,MAAMyC,cAAc;gBACvD/D;gBACAC;gBACA+D,cAAc;gBACdC,QAAQhI,uBAAuBqL;YACjC;YAEA,mDAAmD;YACnD,oCAAoC;YACpC,IAAIxD,eAAe;gBACjB,OAAOwD,OAAOvF,GAAG;YACnB;YAEA,IAAIT,UAAUoD,QAAQ,EAAE;gBACtB,OAAO,MAAMnJ,aAAayE,KAAKsH,QAAQhG,WAAWiG;YACpD;QAEA,sEAAsE;QACtE,sDAAsD;QACxD,EAAE,OAAOpE,KAAK;YACZkD,QAAQf,KAAK,CAAC,kCAAkCnC;YAChDmE,OAAOvF,GAAG;QACZ;IACF;IAEA,OAAO;QACLmB;QACAmE;QACAV,QAAQ/D,SAAS+D,MAAM;QACvB4B;gBACEhK;YAAAA,uCAAAA,kCAAAA,mBAAoBkF,WAAW,qBAA/BlF,gCAAiCiK,KAAK;QACxC;IACF;AACF"}
|
1
|
+
{"version":3,"sources":["../../../src/server/lib/router-server.ts"],"sourcesContent":["// this must come first as it includes require hooks\nimport type { WorkerRequestHandler, WorkerUpgradeHandler } from './types'\nimport type { DevBundler, ServerFields } from './router-utils/setup-dev-bundler'\nimport type { NextUrlWithParsedQuery, RequestMeta } from '../request-meta'\n\n// This is required before other imports to ensure the require hook is setup.\nimport '../node-environment'\nimport '../require-hook'\n\nimport url from 'url'\nimport path from 'path'\nimport loadConfig from '../config'\nimport { serveStatic } from '../serve-static'\nimport setupDebug from 'next/dist/compiled/debug'\nimport * as Log from '../../build/output/log'\nimport { DecodeError } from '../../shared/lib/utils'\nimport { findPagesDir } from '../../lib/find-pages-dir'\nimport { setupFsCheck } from './router-utils/filesystem'\nimport { proxyRequest } from './router-utils/proxy-request'\nimport { isAbortError, pipeToNodeResponse } from '../pipe-readable'\nimport { getResolveRoutes } from './router-utils/resolve-routes'\nimport { addRequestMeta, getRequestMeta } from '../request-meta'\nimport { pathHasPrefix } from '../../shared/lib/router/utils/path-has-prefix'\nimport { removePathPrefix } from '../../shared/lib/router/utils/remove-path-prefix'\nimport setupCompression from 'next/dist/compiled/compression'\nimport { NoFallbackError } from '../base-server'\nimport { signalFromNodeResponse } from '../web/spec-extension/adapters/next-request'\nimport { isPostpone } from './router-utils/is-postpone'\nimport { parseUrl as parseUrlUtil } from '../../shared/lib/router/utils/parse-url'\n\nimport {\n PHASE_PRODUCTION_SERVER,\n PHASE_DEVELOPMENT_SERVER,\n UNDERSCORE_NOT_FOUND_ROUTE,\n} from '../../shared/lib/constants'\nimport { RedirectStatusCode } from '../../client/components/redirect-status-code'\nimport { DevBundlerService } from './dev-bundler-service'\nimport { type Span, trace } from '../../trace'\nimport { ensureLeadingSlash } from '../../shared/lib/page-path/ensure-leading-slash'\nimport { getNextPathnameInfo } from '../../shared/lib/router/utils/get-next-pathname-info'\nimport { getHostname } from '../../shared/lib/get-hostname'\nimport { detectDomainLocale } from '../../shared/lib/i18n/detect-domain-locale'\nimport { MockedResponse } from './mock-request'\nimport {\n HMR_ACTIONS_SENT_TO_BROWSER,\n type AppIsrManifestAction,\n} from '../dev/hot-reloader-types'\nimport { normalizedAssetPrefix } from '../../shared/lib/normalized-asset-prefix'\nimport { NEXT_PATCH_SYMBOL } from './patch-fetch'\nimport type { ServerInitResult } from './render-server'\nimport { filterInternalHeaders } from './server-ipc/utils'\nimport { blockCrossSite } from './router-utils/block-cross-site'\n\nconst debug = setupDebug('next:router-server:main')\nconst isNextFont = (pathname: string | null) =>\n pathname && /\\/media\\/[^/]+\\.(woff|woff2|eot|ttf|otf)$/.test(pathname)\n\nexport type RenderServer = Pick<\n typeof import('./render-server'),\n | 'initialize'\n | 'clearModuleContext'\n | 'propagateServerField'\n | 'getServerField'\n>\n\nexport interface LazyRenderServerInstance {\n instance?: RenderServer\n}\n\nconst requestHandlers: Record<string, WorkerRequestHandler> = {}\n\nexport async function initialize(opts: {\n dir: string\n port: number\n dev: boolean\n onDevServerCleanup: ((listener: () => Promise<void>) => void) | undefined\n server?: import('http').Server\n minimalMode?: boolean\n hostname?: string\n keepAliveTimeout?: number\n customServer?: boolean\n experimentalHttpsServer?: boolean\n startServerSpan?: Span\n quiet?: boolean\n}): Promise<ServerInitResult> {\n if (!process.env.NODE_ENV) {\n // @ts-ignore not readonly\n process.env.NODE_ENV = opts.dev ? 'development' : 'production'\n }\n\n const config = await loadConfig(\n opts.dev ? PHASE_DEVELOPMENT_SERVER : PHASE_PRODUCTION_SERVER,\n opts.dir,\n { silent: false }\n )\n\n let compress: ReturnType<typeof setupCompression> | undefined\n\n if (config?.compress !== false) {\n compress = setupCompression()\n }\n\n const fsChecker = await setupFsCheck({\n dev: opts.dev,\n dir: opts.dir,\n config,\n minimalMode: opts.minimalMode,\n })\n\n const renderServer: LazyRenderServerInstance = {}\n\n let developmentBundler: DevBundler | undefined\n\n let devBundlerService: DevBundlerService | undefined\n\n let originalFetch = globalThis.fetch\n\n if (opts.dev) {\n const { Telemetry } =\n require('../../telemetry/storage') as typeof import('../../telemetry/storage')\n\n const telemetry = new Telemetry({\n distDir: path.join(opts.dir, config.distDir),\n })\n const { pagesDir, appDir } = findPagesDir(opts.dir)\n\n const { setupDevBundler } =\n require('./router-utils/setup-dev-bundler') as typeof import('./router-utils/setup-dev-bundler')\n\n const resetFetch = () => {\n globalThis.fetch = originalFetch\n ;(globalThis as Record<symbol, unknown>)[NEXT_PATCH_SYMBOL] = false\n }\n\n const setupDevBundlerSpan = opts.startServerSpan\n ? opts.startServerSpan.traceChild('setup-dev-bundler')\n : trace('setup-dev-bundler')\n developmentBundler = await setupDevBundlerSpan.traceAsyncFn(() =>\n setupDevBundler({\n // Passed here but the initialization of this object happens below, doing the initialization before the setupDev call breaks.\n renderServer,\n appDir,\n pagesDir,\n telemetry,\n fsChecker,\n dir: opts.dir,\n nextConfig: config,\n isCustomServer: opts.customServer,\n turbo: !!process.env.TURBOPACK,\n port: opts.port,\n onDevServerCleanup: opts.onDevServerCleanup,\n resetFetch,\n })\n )\n\n devBundlerService = new DevBundlerService(\n developmentBundler,\n // The request handler is assigned below, this allows us to create a lazy\n // reference to it.\n (req, res) => {\n return requestHandlers[opts.dir](req, res)\n }\n )\n }\n\n renderServer.instance =\n require('./render-server') as typeof import('./render-server')\n\n const allowedOrigins = ['localhost', ...(config.allowedDevOrigins || [])]\n if (opts.hostname) {\n allowedOrigins.push(opts.hostname)\n }\n\n const requestHandlerImpl: WorkerRequestHandler = async (req, res) => {\n // internal headers should not be honored by the request handler\n if (!process.env.NEXT_PRIVATE_TEST_HEADERS) {\n filterInternalHeaders(req.headers)\n }\n\n if (\n !opts.minimalMode &&\n config.i18n &&\n config.i18n.localeDetection !== false\n ) {\n const urlParts = (req.url || '').split('?', 1)\n let urlNoQuery = urlParts[0] || ''\n\n if (config.basePath) {\n urlNoQuery = removePathPrefix(urlNoQuery, config.basePath)\n }\n\n const pathnameInfo = getNextPathnameInfo(urlNoQuery, {\n nextConfig: config,\n })\n\n const domainLocale = detectDomainLocale(\n config.i18n.domains,\n getHostname({ hostname: urlNoQuery }, req.headers)\n )\n\n const defaultLocale =\n domainLocale?.defaultLocale || config.i18n.defaultLocale\n\n const { getLocaleRedirect } =\n require('../../shared/lib/i18n/get-locale-redirect') as typeof import('../../shared/lib/i18n/get-locale-redirect')\n\n const parsedUrl = parseUrlUtil((req.url || '')?.replace(/^\\/+/, '/'))\n\n const redirect = getLocaleRedirect({\n defaultLocale,\n domainLocale,\n headers: req.headers,\n nextConfig: config,\n pathLocale: pathnameInfo.locale,\n urlParsed: {\n ...parsedUrl,\n pathname: pathnameInfo.locale\n ? `/${pathnameInfo.locale}${urlNoQuery}`\n : urlNoQuery,\n },\n })\n\n if (redirect) {\n res.setHeader('Location', redirect)\n res.statusCode = RedirectStatusCode.TemporaryRedirect\n res.end(redirect)\n return\n }\n }\n\n if (compress) {\n // @ts-expect-error not express req/res\n compress(req, res, () => {})\n }\n req.on('error', (_err) => {\n // TODO: log socket errors?\n })\n res.on('error', (_err) => {\n // TODO: log socket errors?\n })\n\n const invokedOutputs = new Set<string>()\n\n async function invokeRender(\n parsedUrl: NextUrlWithParsedQuery,\n invokePath: string,\n handleIndex: number,\n additionalRequestMeta?: RequestMeta\n ) {\n // invokeRender expects /api routes to not be locale prefixed\n // so normalize here before continuing\n if (\n config.i18n &&\n removePathPrefix(invokePath, config.basePath).startsWith(\n `/${getRequestMeta(req, 'locale')}/api`\n )\n ) {\n invokePath = fsChecker.handleLocale(\n removePathPrefix(invokePath, config.basePath)\n ).pathname\n }\n\n if (\n req.headers['x-nextjs-data'] &&\n fsChecker.getMiddlewareMatchers()?.length &&\n removePathPrefix(invokePath, config.basePath) === '/404'\n ) {\n res.setHeader('x-nextjs-matched-path', parsedUrl.pathname || '')\n res.statusCode = 404\n res.setHeader('content-type', 'application/json')\n res.end('{}')\n return null\n }\n\n if (!handlers) {\n throw new Error('Failed to initialize render server')\n }\n\n addRequestMeta(req, 'invokePath', invokePath)\n addRequestMeta(req, 'invokeQuery', parsedUrl.query)\n addRequestMeta(req, 'middlewareInvoke', false)\n\n for (const key in additionalRequestMeta || {}) {\n addRequestMeta(\n req,\n key as keyof RequestMeta,\n additionalRequestMeta![key as keyof RequestMeta]\n )\n }\n\n debug('invokeRender', req.url, req.headers)\n\n try {\n const initResult =\n await renderServer?.instance?.initialize(renderServerOpts)\n try {\n await initResult?.requestHandler(req, res)\n } catch (err) {\n if (err instanceof NoFallbackError) {\n // eslint-disable-next-line\n await handleRequest(handleIndex + 1)\n return\n }\n throw err\n }\n return\n } catch (e) {\n // If the client aborts before we can receive a response object (when\n // the headers are flushed), then we can early exit without further\n // processing.\n if (isAbortError(e)) {\n return\n }\n throw e\n }\n }\n\n const handleRequest = async (handleIndex: number) => {\n if (handleIndex > 5) {\n throw new Error(`Attempted to handle request too many times ${req.url}`)\n }\n\n // handle hot-reloader first\n if (developmentBundler) {\n if (blockCrossSite(req, res, allowedOrigins, `${opts.port}`)) {\n return\n }\n const origUrl = req.url || '/'\n\n if (config.basePath && pathHasPrefix(origUrl, config.basePath)) {\n req.url = removePathPrefix(origUrl, config.basePath)\n }\n const parsedUrl = url.parse(req.url || '/')\n\n const hotReloaderResult = await developmentBundler.hotReloader.run(\n req,\n res,\n parsedUrl\n )\n\n if (hotReloaderResult.finished) {\n return hotReloaderResult\n }\n req.url = origUrl\n }\n\n const {\n finished,\n parsedUrl,\n statusCode,\n resHeaders,\n bodyStream,\n matchedOutput,\n } = await resolveRoutes({\n req,\n res,\n isUpgradeReq: false,\n signal: signalFromNodeResponse(res),\n invokedOutputs,\n })\n\n if (res.closed || res.finished) {\n return\n }\n\n if (developmentBundler && matchedOutput?.type === 'devVirtualFsItem') {\n const origUrl = req.url || '/'\n\n if (config.basePath && pathHasPrefix(origUrl, config.basePath)) {\n req.url = removePathPrefix(origUrl, config.basePath)\n }\n\n if (resHeaders) {\n for (const key of Object.keys(resHeaders)) {\n res.setHeader(key, resHeaders[key])\n }\n }\n const result = await developmentBundler.requestHandler(req, res)\n\n if (result.finished) {\n return\n }\n // TODO: throw invariant if we resolved to this but it wasn't handled?\n req.url = origUrl\n }\n\n debug('requestHandler!', req.url, {\n matchedOutput,\n statusCode,\n resHeaders,\n bodyStream: !!bodyStream,\n parsedUrl: {\n pathname: parsedUrl.pathname,\n query: parsedUrl.query,\n },\n finished,\n })\n\n // apply any response headers from routing\n for (const key of Object.keys(resHeaders || {})) {\n res.setHeader(key, resHeaders[key])\n }\n\n // handle redirect\n if (!bodyStream && statusCode && statusCode > 300 && statusCode < 400) {\n const destination = url.format(parsedUrl)\n res.statusCode = statusCode\n res.setHeader('location', destination)\n\n if (statusCode === RedirectStatusCode.PermanentRedirect) {\n res.setHeader('Refresh', `0;url=${destination}`)\n }\n return res.end(destination)\n }\n\n // handle middleware body response\n if (bodyStream) {\n res.statusCode = statusCode || 200\n return await pipeToNodeResponse(bodyStream, res)\n }\n\n if (finished && parsedUrl.protocol) {\n return await proxyRequest(\n req,\n res,\n parsedUrl,\n undefined,\n getRequestMeta(req, 'clonableBody')?.cloneBodyStream(),\n config.experimental.proxyTimeout\n )\n }\n\n if (matchedOutput?.fsPath && matchedOutput.itemPath) {\n if (\n opts.dev &&\n (fsChecker.appFiles.has(matchedOutput.itemPath) ||\n fsChecker.pageFiles.has(matchedOutput.itemPath))\n ) {\n res.statusCode = 500\n const message = `A conflicting public file and page file was found for path ${matchedOutput.itemPath} https://nextjs.org/docs/messages/conflicting-public-file-page`\n await invokeRender(parsedUrl, '/_error', handleIndex, {\n invokeStatus: 500,\n invokeError: new Error(message),\n })\n Log.error(message)\n return\n }\n\n if (\n !res.getHeader('cache-control') &&\n matchedOutput.type === 'nextStaticFolder'\n ) {\n if (opts.dev && !isNextFont(parsedUrl.pathname)) {\n res.setHeader('Cache-Control', 'no-store, must-revalidate')\n } else {\n res.setHeader(\n 'Cache-Control',\n 'public, max-age=31536000, immutable'\n )\n }\n }\n if (!(req.method === 'GET' || req.method === 'HEAD')) {\n res.setHeader('Allow', ['GET', 'HEAD'])\n res.statusCode = 405\n return await invokeRender(\n url.parse('/405', true),\n '/405',\n handleIndex,\n {\n invokeStatus: 405,\n }\n )\n }\n\n try {\n return await serveStatic(req, res, matchedOutput.itemPath, {\n root: matchedOutput.itemsRoot,\n // Ensures that etags are not generated for static files when disabled.\n etag: config.generateEtags,\n })\n } catch (err: any) {\n /**\n * Hardcoded every possible error status code that could be thrown by \"serveStatic\" method\n * This is done by searching \"this.error\" inside \"send\" module's source code:\n * https://github.com/pillarjs/send/blob/master/index.js\n * https://github.com/pillarjs/send/blob/develop/index.js\n */\n const POSSIBLE_ERROR_CODE_FROM_SERVE_STATIC = new Set([\n // send module will throw 500 when header is already sent or fs.stat error happens\n // https://github.com/pillarjs/send/blob/53f0ab476145670a9bdd3dc722ab2fdc8d358fc6/index.js#L392\n // Note: we will use Next.js built-in 500 page to handle 500 errors\n // 500,\n\n // send module will throw 404 when file is missing\n // https://github.com/pillarjs/send/blob/53f0ab476145670a9bdd3dc722ab2fdc8d358fc6/index.js#L421\n // Note: we will use Next.js built-in 404 page to handle 404 errors\n // 404,\n\n // send module will throw 403 when redirecting to a directory without enabling directory listing\n // https://github.com/pillarjs/send/blob/53f0ab476145670a9bdd3dc722ab2fdc8d358fc6/index.js#L484\n // Note: Next.js throws a different error (without status code) for directory listing\n // 403,\n\n // send module will throw 400 when fails to normalize the path\n // https://github.com/pillarjs/send/blob/53f0ab476145670a9bdd3dc722ab2fdc8d358fc6/index.js#L520\n 400,\n\n // send module will throw 412 with conditional GET request\n // https://github.com/pillarjs/send/blob/53f0ab476145670a9bdd3dc722ab2fdc8d358fc6/index.js#L632\n 412,\n\n // send module will throw 416 when range is not satisfiable\n // https://github.com/pillarjs/send/blob/53f0ab476145670a9bdd3dc722ab2fdc8d358fc6/index.js#L669\n 416,\n ])\n\n let validErrorStatus = POSSIBLE_ERROR_CODE_FROM_SERVE_STATIC.has(\n err.statusCode\n )\n\n // normalize non-allowed status codes\n if (!validErrorStatus) {\n ;(err as any).statusCode = 400\n }\n\n if (typeof err.statusCode === 'number') {\n const invokePath = `/${err.statusCode}`\n const invokeStatus = err.statusCode\n res.statusCode = err.statusCode\n return await invokeRender(\n url.parse(invokePath, true),\n invokePath,\n handleIndex,\n {\n invokeStatus,\n }\n )\n }\n throw err\n }\n }\n\n if (matchedOutput) {\n invokedOutputs.add(matchedOutput.itemPath)\n\n return await invokeRender(\n parsedUrl,\n parsedUrl.pathname || '/',\n handleIndex,\n {\n invokeOutput: matchedOutput.itemPath,\n }\n )\n }\n\n // 404 case\n res.setHeader(\n 'Cache-Control',\n 'private, no-cache, no-store, max-age=0, must-revalidate'\n )\n\n // Short-circuit favicon.ico serving so that the 404 page doesn't get built as favicon is requested by the browser when loading any route.\n if (opts.dev && !matchedOutput && parsedUrl.pathname === '/favicon.ico') {\n res.statusCode = 404\n res.end('')\n return null\n }\n\n const appNotFound = opts.dev\n ? developmentBundler?.serverFields.hasAppNotFound\n : await fsChecker.getItem(UNDERSCORE_NOT_FOUND_ROUTE)\n\n res.statusCode = 404\n\n if (appNotFound) {\n return await invokeRender(\n parsedUrl,\n UNDERSCORE_NOT_FOUND_ROUTE,\n handleIndex,\n {\n invokeStatus: 404,\n }\n )\n }\n\n await invokeRender(parsedUrl, '/404', handleIndex, {\n invokeStatus: 404,\n })\n }\n\n try {\n await handleRequest(0)\n } catch (err) {\n try {\n let invokePath = '/500'\n let invokeStatus = '500'\n\n if (err instanceof DecodeError) {\n invokePath = '/400'\n invokeStatus = '400'\n } else {\n console.error(err)\n }\n res.statusCode = Number(invokeStatus)\n return await invokeRender(url.parse(invokePath, true), invokePath, 0, {\n invokeStatus: res.statusCode,\n })\n } catch (err2) {\n console.error(err2)\n }\n res.statusCode = 500\n res.end('Internal Server Error')\n }\n }\n\n let requestHandler: WorkerRequestHandler = requestHandlerImpl\n if (config.experimental.testProxy) {\n // Intercept fetch and other testmode apis.\n const { wrapRequestHandlerWorker, interceptTestApis } =\n require('next/dist/experimental/testmode/server') as typeof import('next/src/experimental/testmode/server')\n requestHandler = wrapRequestHandlerWorker(requestHandler)\n interceptTestApis()\n // We treat the intercepted fetch as \"original\" fetch that should be reset to during HMR.\n originalFetch = globalThis.fetch\n }\n requestHandlers[opts.dir] = requestHandler\n\n const renderServerOpts: Parameters<RenderServer['initialize']>[0] = {\n port: opts.port,\n dir: opts.dir,\n hostname: opts.hostname,\n minimalMode: opts.minimalMode,\n dev: !!opts.dev,\n server: opts.server,\n serverFields: {\n ...(developmentBundler?.serverFields || {}),\n setIsrStatus: devBundlerService?.setIsrStatus.bind(devBundlerService),\n } satisfies ServerFields,\n experimentalTestProxy: !!config.experimental.testProxy,\n experimentalHttpsServer: !!opts.experimentalHttpsServer,\n bundlerService: devBundlerService,\n startServerSpan: opts.startServerSpan,\n quiet: opts.quiet,\n onDevServerCleanup: opts.onDevServerCleanup,\n }\n renderServerOpts.serverFields.routerServerHandler = requestHandlerImpl\n\n // pre-initialize workers\n const handlers = await renderServer.instance.initialize(renderServerOpts)\n\n const logError = async (\n type: 'uncaughtException' | 'unhandledRejection',\n err: Error | undefined\n ) => {\n if (isPostpone(err)) {\n // React postpones that are unhandled might end up logged here but they're\n // not really errors. They're just part of rendering.\n return\n }\n if (type === 'unhandledRejection') {\n Log.error('unhandledRejection: ', err)\n } else if (type === 'uncaughtException') {\n Log.error('uncaughtException: ', err)\n }\n }\n\n process.on('uncaughtException', logError.bind(null, 'uncaughtException'))\n process.on('unhandledRejection', logError.bind(null, 'unhandledRejection'))\n\n const resolveRoutes = getResolveRoutes(\n fsChecker,\n config,\n opts,\n renderServer.instance,\n renderServerOpts,\n developmentBundler?.ensureMiddleware\n )\n\n const upgradeHandler: WorkerUpgradeHandler = async (req, socket, head) => {\n try {\n req.on('error', (_err) => {\n // TODO: log socket errors?\n // console.error(_err);\n })\n socket.on('error', (_err) => {\n // TODO: log socket errors?\n // console.error(_err);\n })\n\n if (opts.dev && developmentBundler && req.url) {\n if (blockCrossSite(req, socket, allowedOrigins, `${opts.port}`)) {\n return\n }\n const { basePath, assetPrefix } = config\n\n let hmrPrefix = basePath\n\n // assetPrefix overrides basePath for HMR path\n if (assetPrefix) {\n hmrPrefix = normalizedAssetPrefix(assetPrefix)\n\n if (URL.canParse(hmrPrefix)) {\n // remove trailing slash from pathname\n // return empty string if pathname is '/'\n // to avoid conflicts with '/_next' below\n hmrPrefix = new URL(hmrPrefix).pathname.replace(/\\/$/, '')\n }\n }\n\n const isHMRRequest = req.url.startsWith(\n ensureLeadingSlash(`${hmrPrefix}/_next/webpack-hmr`)\n )\n\n // only handle HMR requests if the basePath in the request\n // matches the basePath for the handler responding to the request\n if (isHMRRequest) {\n return developmentBundler.hotReloader.onHMR(\n req,\n socket,\n head,\n (client) => {\n client.send(\n JSON.stringify({\n action: HMR_ACTIONS_SENT_TO_BROWSER.ISR_MANIFEST,\n data: devBundlerService?.appIsrManifest || {},\n } satisfies AppIsrManifestAction)\n )\n }\n )\n }\n }\n\n const res = new MockedResponse({\n resWriter: () => {\n throw new Error(\n 'Invariant: did not expect response writer to be written to for upgrade request'\n )\n },\n })\n const { matchedOutput, parsedUrl } = await resolveRoutes({\n req,\n res,\n isUpgradeReq: true,\n signal: signalFromNodeResponse(socket),\n })\n\n // TODO: allow upgrade requests to pages/app paths?\n // this was not previously supported\n if (matchedOutput) {\n return socket.end()\n }\n\n if (parsedUrl.protocol) {\n return await proxyRequest(req, socket, parsedUrl, head)\n }\n\n // If there's no matched output, we don't handle the request as user's\n // custom WS server may be listening on the same path.\n } catch (err) {\n console.error('Error handling upgrade request', err)\n socket.end()\n }\n }\n\n return {\n requestHandler,\n upgradeHandler,\n server: handlers.server,\n closeUpgraded() {\n developmentBundler?.hotReloader?.close()\n },\n }\n}\n"],"names":["url","path","loadConfig","serveStatic","setupDebug","Log","DecodeError","findPagesDir","setupFsCheck","proxyRequest","isAbortError","pipeToNodeResponse","getResolveRoutes","addRequestMeta","getRequestMeta","pathHasPrefix","removePathPrefix","setupCompression","NoFallbackError","signalFromNodeResponse","isPostpone","parseUrl","parseUrlUtil","PHASE_PRODUCTION_SERVER","PHASE_DEVELOPMENT_SERVER","UNDERSCORE_NOT_FOUND_ROUTE","RedirectStatusCode","DevBundlerService","trace","ensureLeadingSlash","getNextPathnameInfo","getHostname","detectDomainLocale","MockedResponse","HMR_ACTIONS_SENT_TO_BROWSER","normalizedAssetPrefix","NEXT_PATCH_SYMBOL","filterInternalHeaders","blockCrossSite","debug","isNextFont","pathname","test","requestHandlers","initialize","opts","process","env","NODE_ENV","dev","config","dir","silent","compress","fsChecker","minimalMode","renderServer","developmentBundler","devBundlerService","originalFetch","globalThis","fetch","Telemetry","require","telemetry","distDir","join","pagesDir","appDir","setupDevBundler","resetFetch","setupDevBundlerSpan","startServerSpan","traceChild","traceAsyncFn","nextConfig","isCustomServer","customServer","turbo","TURBOPACK","port","onDevServerCleanup","req","res","instance","allowedOrigins","allowedDevOrigins","hostname","push","requestHandlerImpl","NEXT_PRIVATE_TEST_HEADERS","headers","i18n","localeDetection","urlParts","split","urlNoQuery","basePath","pathnameInfo","domainLocale","domains","defaultLocale","getLocaleRedirect","parsedUrl","replace","redirect","pathLocale","locale","urlParsed","setHeader","statusCode","TemporaryRedirect","end","on","_err","invokedOutputs","Set","invokeRender","invokePath","handleIndex","additionalRequestMeta","startsWith","handleLocale","getMiddlewareMatchers","length","handlers","Error","query","key","initResult","renderServerOpts","requestHandler","err","handleRequest","e","origUrl","parse","hotReloaderResult","hotReloader","run","finished","resHeaders","bodyStream","matchedOutput","resolveRoutes","isUpgradeReq","signal","closed","type","Object","keys","result","destination","format","PermanentRedirect","protocol","undefined","cloneBodyStream","experimental","proxyTimeout","fsPath","itemPath","appFiles","has","pageFiles","message","invokeStatus","invokeError","error","getHeader","method","root","itemsRoot","etag","generateEtags","POSSIBLE_ERROR_CODE_FROM_SERVE_STATIC","validErrorStatus","add","invokeOutput","appNotFound","serverFields","hasAppNotFound","getItem","console","Number","err2","testProxy","wrapRequestHandlerWorker","interceptTestApis","server","setIsrStatus","bind","experimentalTestProxy","experimentalHttpsServer","bundlerService","quiet","routerServerHandler","logError","ensureMiddleware","upgradeHandler","socket","head","assetPrefix","hmrPrefix","URL","canParse","isHMRRequest","onHMR","client","send","JSON","stringify","action","ISR_MANIFEST","data","appIsrManifest","resWriter","closeUpgraded","close"],"mappings":"AAAA,oDAAoD;AAKpD,6EAA6E;AAC7E,OAAO,sBAAqB;AAC5B,OAAO,kBAAiB;AAExB,OAAOA,SAAS,MAAK;AACrB,OAAOC,UAAU,OAAM;AACvB,OAAOC,gBAAgB,YAAW;AAClC,SAASC,WAAW,QAAQ,kBAAiB;AAC7C,OAAOC,gBAAgB,2BAA0B;AACjD,YAAYC,SAAS,yBAAwB;AAC7C,SAASC,WAAW,QAAQ,yBAAwB;AACpD,SAASC,YAAY,QAAQ,2BAA0B;AACvD,SAASC,YAAY,QAAQ,4BAA2B;AACxD,SAASC,YAAY,QAAQ,+BAA8B;AAC3D,SAASC,YAAY,EAAEC,kBAAkB,QAAQ,mBAAkB;AACnE,SAASC,gBAAgB,QAAQ,gCAA+B;AAChE,SAASC,cAAc,EAAEC,cAAc,QAAQ,kBAAiB;AAChE,SAASC,aAAa,QAAQ,gDAA+C;AAC7E,SAASC,gBAAgB,QAAQ,mDAAkD;AACnF,OAAOC,sBAAsB,iCAAgC;AAC7D,SAASC,eAAe,QAAQ,iBAAgB;AAChD,SAASC,sBAAsB,QAAQ,8CAA6C;AACpF,SAASC,UAAU,QAAQ,6BAA4B;AACvD,SAASC,YAAYC,YAAY,QAAQ,0CAAyC;AAElF,SACEC,uBAAuB,EACvBC,wBAAwB,EACxBC,0BAA0B,QACrB,6BAA4B;AACnC,SAASC,kBAAkB,QAAQ,+CAA8C;AACjF,SAASC,iBAAiB,QAAQ,wBAAuB;AACzD,SAAoBC,KAAK,QAAQ,cAAa;AAC9C,SAASC,kBAAkB,QAAQ,kDAAiD;AACpF,SAASC,mBAAmB,QAAQ,uDAAsD;AAC1F,SAASC,WAAW,QAAQ,gCAA+B;AAC3D,SAASC,kBAAkB,QAAQ,6CAA4C;AAC/E,SAASC,cAAc,QAAQ,iBAAgB;AAC/C,SACEC,2BAA2B,QAEtB,4BAA2B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A4BmL,YAAY;4BAChDC,MAAM5J,CAAAA,qCAAAA,kBAAmB6J,cAAc,KAAI,CAAC;wBAC9C;oBAEJ;gBAEJ;YACF;YAEA,MAAMpI,MAAM,IAAIlD,eAAe;gBAC7BuL,WAAW;oBACT,MAAM,qBAEL,CAFK,IAAI1F,MACR,mFADI,qBAAA;+BAAA;oCAAA;sCAAA;oBAEN;gBACF;YACF;YACA,MAAM,EAAEiB,aAAa,EAAExC,SAAS,EAAE,GAAG,MAAMyC,cAAc;gBACvD9D;gBACAC;gBACA8D,cAAc;gBACdC,QAAQ/H,uBAAuBqL;YACjC;YAEA,mDAAmD;YACnD,oCAAoC;YACpC,IAAIzD,eAAe;gBACjB,OAAOyD,OAAOxF,GAAG;YACnB;YAEA,IAAIT,UAAUoD,QAAQ,EAAE;gBACtB,OAAO,MAAMlJ,aAAayE,KAAKsH,QAAQjG,WAAWkG;YACpD;QAEA,sEAAsE;QACtE,sDAAsD;QACxD,EAAE,OAAOrE,KAAK;YACZmD,QAAQf,KAAK,CAAC,kCAAkCpC;YAChDoE,OAAOxF,GAAG;QACZ;IACF;IAEA,OAAO;QACLmB;QACAoE;QACAV,QAAQhE,SAASgE,MAAM;QACvB4B;gBACEhK;YAAAA,uCAAAA,kCAAAA,mBAAoBiF,WAAW,qBAA/BjF,gCAAiCiK,KAAK;QACxC;IACF;AACF"}
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import { parseUrl } from '../../../lib/url';
|
2
2
|
import net from 'net';
|
3
|
+
import { warnOnce } from '../../../build/output/log';
|
4
|
+
import { isCsrfOriginAllowed } from '../../app-render/csrf-protection';
|
3
5
|
export const blockCrossSite = (req, res, allowedOrigins, activePort)=>{
|
4
6
|
var _req_url;
|
5
7
|
// only process _next URLs
|
@@ -13,6 +15,7 @@ export const blockCrossSite = (req, res, allowedOrigins, activePort)=>{
|
|
13
15
|
res.statusCode = 403;
|
14
16
|
}
|
15
17
|
res.end('Unauthorized');
|
18
|
+
warnOnce(`Blocked cross-origin request to /_next/*. Cross-site requests are blocked in "no-cors" mode.`);
|
16
19
|
return true;
|
17
20
|
}
|
18
21
|
// ensure websocket requests from allowed origin
|
@@ -25,11 +28,12 @@ export const blockCrossSite = (req, res, allowedOrigins, activePort)=>{
|
|
25
28
|
const isIpRequest = net.isIPv4(originLowerCase) || net.isIPv6(originLowerCase);
|
26
29
|
if (// allow requests if direct IP and matching port and
|
27
30
|
// allow if any of the allowed origins match
|
28
|
-
!(isIpRequest && isMatchingPort) && !
|
31
|
+
!(isIpRequest && isMatchingPort) && !isCsrfOriginAllowed(originLowerCase, allowedOrigins)) {
|
29
32
|
if ('statusCode' in res) {
|
30
33
|
res.statusCode = 403;
|
31
34
|
}
|
32
35
|
res.end('Unauthorized');
|
36
|
+
warnOnce(`Blocked cross-origin request from ${originLowerCase}. To allow this, configure "allowedDevOrigins" in next.config\nRead more: https://nextjs.org/docs/app/api-reference/config/next-config-js/allowedDevOrigins`);
|
33
37
|
return true;
|
34
38
|
}
|
35
39
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/server/lib/router-utils/block-cross-site.ts"],"sourcesContent":["import type { Duplex } from 'stream'\nimport type { IncomingMessage, ServerResponse } from 'webpack-dev-server'\nimport { parseUrl } from '../../../lib/url'\nimport net from 'net'\n\nexport const blockCrossSite = (\n req: IncomingMessage,\n res: ServerResponse | Duplex,\n allowedOrigins: string[],\n activePort: string\n): boolean => {\n // only process _next URLs\n if (!req.url?.includes('/_next')) {\n return false\n }\n // block non-cors request from cross-site e.g. script tag on\n // different host\n if (\n req.headers['sec-fetch-mode'] === 'no-cors' &&\n req.headers['sec-fetch-site'] === 'cross-site'\n ) {\n if ('statusCode' in res) {\n res.statusCode = 403\n }\n res.end('Unauthorized')\n return true\n }\n\n // ensure websocket requests from allowed origin\n const rawOrigin = req.headers['origin']\n\n if (rawOrigin) {\n const parsedOrigin = parseUrl(rawOrigin)\n\n if (parsedOrigin) {\n const originLowerCase = parsedOrigin.hostname.toLowerCase()\n const isMatchingPort = parsedOrigin.port === activePort\n const isIpRequest =\n net.isIPv4(originLowerCase) || net.isIPv6(originLowerCase)\n\n if (\n // allow requests if direct IP and matching port and\n // allow if any of the allowed origins match\n !(isIpRequest && isMatchingPort) &&\n !
|
1
|
+
{"version":3,"sources":["../../../../src/server/lib/router-utils/block-cross-site.ts"],"sourcesContent":["import type { Duplex } from 'stream'\nimport type { IncomingMessage, ServerResponse } from 'webpack-dev-server'\nimport { parseUrl } from '../../../lib/url'\nimport net from 'net'\nimport { warnOnce } from '../../../build/output/log'\nimport { isCsrfOriginAllowed } from '../../app-render/csrf-protection'\n\nexport const blockCrossSite = (\n req: IncomingMessage,\n res: ServerResponse | Duplex,\n allowedOrigins: string[],\n activePort: string\n): boolean => {\n // only process _next URLs\n if (!req.url?.includes('/_next')) {\n return false\n }\n // block non-cors request from cross-site e.g. script tag on\n // different host\n if (\n req.headers['sec-fetch-mode'] === 'no-cors' &&\n req.headers['sec-fetch-site'] === 'cross-site'\n ) {\n if ('statusCode' in res) {\n res.statusCode = 403\n }\n res.end('Unauthorized')\n warnOnce(\n `Blocked cross-origin request to /_next/*. Cross-site requests are blocked in \"no-cors\" mode.`\n )\n return true\n }\n\n // ensure websocket requests from allowed origin\n const rawOrigin = req.headers['origin']\n\n if (rawOrigin) {\n const parsedOrigin = parseUrl(rawOrigin)\n\n if (parsedOrigin) {\n const originLowerCase = parsedOrigin.hostname.toLowerCase()\n const isMatchingPort = parsedOrigin.port === activePort\n const isIpRequest =\n net.isIPv4(originLowerCase) || net.isIPv6(originLowerCase)\n\n if (\n // allow requests if direct IP and matching port and\n // allow if any of the allowed origins match\n !(isIpRequest && isMatchingPort) &&\n !isCsrfOriginAllowed(originLowerCase, allowedOrigins)\n ) {\n if ('statusCode' in res) {\n res.statusCode = 403\n }\n res.end('Unauthorized')\n warnOnce(\n `Blocked cross-origin request from ${originLowerCase}. To allow this, configure \"allowedDevOrigins\" in next.config\\nRead more: https://nextjs.org/docs/app/api-reference/config/next-config-js/allowedDevOrigins`\n )\n return true\n }\n }\n }\n\n return false\n}\n"],"names":["parseUrl","net","warnOnce","isCsrfOriginAllowed","blockCrossSite","req","res","allowedOrigins","activePort","url","includes","headers","statusCode","end","rawOrigin","parsedOrigin","originLowerCase","hostname","toLowerCase","isMatchingPort","port","isIpRequest","isIPv4","isIPv6"],"mappings":"AAEA,SAASA,QAAQ,QAAQ,mBAAkB;AAC3C,OAAOC,SAAS,MAAK;AACrB,SAASC,QAAQ,QAAQ,4BAA2B;AACpD,SAASC,mBAAmB,QAAQ,mCAAkC;AAEtE,OAAO,MAAMC,iBAAiB,CAC5BC,KACAC,KACAC,gBACAC;QAGKH;IADL,0BAA0B;IAC1B,IAAI,GAACA,WAAAA,IAAII,GAAG,qBAAPJ,SAASK,QAAQ,CAAC,YAAW;QAChC,OAAO;IACT;IACA,4DAA4D;IAC5D,iBAAiB;IACjB,IACEL,IAAIM,OAAO,CAAC,iBAAiB,KAAK,aAClCN,IAAIM,OAAO,CAAC,iBAAiB,KAAK,cAClC;QACA,IAAI,gBAAgBL,KAAK;YACvBA,IAAIM,UAAU,GAAG;QACnB;QACAN,IAAIO,GAAG,CAAC;QACRX,SACE,CAAC,4FAA4F,CAAC;QAEhG,OAAO;IACT;IAEA,gDAAgD;IAChD,MAAMY,YAAYT,IAAIM,OAAO,CAAC,SAAS;IAEvC,IAAIG,WAAW;QACb,MAAMC,eAAef,SAASc;QAE9B,IAAIC,cAAc;YAChB,MAAMC,kBAAkBD,aAAaE,QAAQ,CAACC,WAAW;YACzD,MAAMC,iBAAiBJ,aAAaK,IAAI,KAAKZ;YAC7C,MAAMa,cACJpB,IAAIqB,MAAM,CAACN,oBAAoBf,IAAIsB,MAAM,CAACP;YAE5C,IACE,oDAAoD;YACpD,4CAA4C;YAC5C,CAAEK,CAAAA,eAAeF,cAAa,KAC9B,CAAChB,oBAAoBa,iBAAiBT,iBACtC;gBACA,IAAI,gBAAgBD,KAAK;oBACvBA,IAAIM,UAAU,GAAG;gBACnB;gBACAN,IAAIO,GAAG,CAAC;gBACRX,SACE,CAAC,kCAAkC,EAAEc,gBAAgB,2JAA2J,CAAC;gBAEnN,OAAO;YACT;QACF;IACF;IAEA,OAAO;AACT,EAAC"}
|
@@ -43,7 +43,7 @@ export async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup,
|
|
43
43
|
export async function startServer(serverOptions) {
|
44
44
|
const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
|
45
45
|
let { port } = serverOptions;
|
46
|
-
process.title = `next-server (v${"15.3.0-canary.
|
46
|
+
process.title = `next-server (v${"15.3.0-canary.4"})`;
|
47
47
|
let handlersReady = ()=>{};
|
48
48
|
let handlersError = ()=>{};
|
49
49
|
let handlersPromise = new Promise((resolve, reject)=>{
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export function isStableBuild() {
|
2
2
|
var _process_env___NEXT_VERSION;
|
3
|
-
return !((_process_env___NEXT_VERSION = "15.3.0-canary.
|
3
|
+
return !((_process_env___NEXT_VERSION = "15.3.0-canary.4") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
|
4
4
|
}
|
5
5
|
export class CanaryOnlyError extends Error {
|
6
6
|
constructor(arg){
|
@@ -105,6 +105,7 @@ const zTurboRuleConfigItemOrShortcut = _zod.z.union([
|
|
105
105
|
zTurboRuleConfigItem
|
106
106
|
]);
|
107
107
|
const configSchema = _zod.z.lazy(()=>_zod.z.strictObject({
|
108
|
+
allowedDevOrigins: _zod.z.array(_zod.z.string()).optional(),
|
108
109
|
amp: _zod.z.object({
|
109
110
|
canonicalBase: _zod.z.string().optional()
|
110
111
|
}).optional(),
|
@@ -217,7 +218,7 @@ const configSchema = _zod.z.lazy(()=>_zod.z.strictObject({
|
|
217
218
|
}).optional(),
|
218
219
|
excludeDefaultMomentLocales: _zod.z.boolean().optional(),
|
219
220
|
experimental: _zod.z.strictObject({
|
220
|
-
|
221
|
+
generateOnlyEnv: _zod.z.boolean().optional(),
|
221
222
|
nodeMiddleware: _zod.z.boolean().optional(),
|
222
223
|
after: _zod.z.boolean().optional(),
|
223
224
|
appDocumentPreloading: _zod.z.boolean().optional(),
|