next 16.0.0-canary.0 → 16.0.0-canary.1

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.
Files changed (81) hide show
  1. package/dist/bin/next +1 -1
  2. package/dist/build/index.js +3 -3
  3. package/dist/build/swc/generated-native.d.ts +1 -0
  4. package/dist/build/swc/index.js +2 -3
  5. package/dist/build/swc/index.js.map +1 -1
  6. package/dist/build/swc/types.d.ts +1 -0
  7. package/dist/build/webpack-config.js +2 -2
  8. package/dist/client/app-bootstrap.js +1 -1
  9. package/dist/client/index.js +1 -1
  10. package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js +1 -1
  11. package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js.map +1 -1
  12. package/dist/compiled/next-server/pages-api.runtime.dev.js +1 -1
  13. package/dist/compiled/next-server/pages-api.runtime.dev.js.map +1 -1
  14. package/dist/compiled/next-server/pages-api.runtime.prod.js +1 -1
  15. package/dist/compiled/next-server/pages-api.runtime.prod.js.map +1 -1
  16. package/dist/compiled/next-server/pages-turbo.runtime.prod.js +1 -1
  17. package/dist/compiled/next-server/pages-turbo.runtime.prod.js.map +1 -1
  18. package/dist/compiled/next-server/pages.runtime.dev.js +1 -1
  19. package/dist/compiled/next-server/pages.runtime.dev.js.map +1 -1
  20. package/dist/compiled/next-server/pages.runtime.prod.js +1 -1
  21. package/dist/compiled/next-server/pages.runtime.prod.js.map +1 -1
  22. package/dist/compiled/next-server/server.runtime.prod.js +8 -8
  23. package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
  24. package/dist/esm/build/index.js +3 -3
  25. package/dist/esm/build/swc/generated-native.d.ts +1 -0
  26. package/dist/esm/build/swc/index.js +2 -3
  27. package/dist/esm/build/swc/index.js.map +1 -1
  28. package/dist/esm/build/swc/types.js.map +1 -1
  29. package/dist/esm/build/webpack-config.js +2 -2
  30. package/dist/esm/client/app-bootstrap.js +1 -1
  31. package/dist/esm/client/index.js +1 -1
  32. package/dist/esm/export/worker.js +2 -0
  33. package/dist/esm/export/worker.js.map +1 -1
  34. package/dist/esm/server/config-schema.js +2 -1
  35. package/dist/esm/server/config-schema.js.map +1 -1
  36. package/dist/esm/server/config-shared.js +2 -1
  37. package/dist/esm/server/config-shared.js.map +1 -1
  38. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  39. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  40. package/dist/esm/server/dev/on-demand-entry-handler.js +2 -1
  41. package/dist/esm/server/dev/on-demand-entry-handler.js.map +1 -1
  42. package/dist/esm/server/dev/turbopack-utils.js +4 -2
  43. package/dist/esm/server/dev/turbopack-utils.js.map +1 -1
  44. package/dist/esm/server/lib/app-info-log.js +1 -1
  45. package/dist/esm/server/lib/start-server.js +1 -1
  46. package/dist/esm/server/next-server.js +2 -0
  47. package/dist/esm/server/next-server.js.map +1 -1
  48. package/dist/esm/server/node-environment-extensions/console-dim.external.js +61 -47
  49. package/dist/esm/server/node-environment-extensions/console-dim.external.js.map +1 -1
  50. package/dist/esm/server/node-environment-extensions/global-behaviors.js +23 -0
  51. package/dist/esm/server/node-environment-extensions/global-behaviors.js.map +1 -0
  52. package/dist/esm/shared/lib/errors/canary-only-config-error.js +1 -1
  53. package/dist/export/worker.js +2 -0
  54. package/dist/export/worker.js.map +1 -1
  55. package/dist/server/config-schema.d.ts +1 -0
  56. package/dist/server/config-schema.js +2 -1
  57. package/dist/server/config-schema.js.map +1 -1
  58. package/dist/server/config-shared.d.ts +8 -0
  59. package/dist/server/config-shared.js +2 -1
  60. package/dist/server/config-shared.js.map +1 -1
  61. package/dist/server/dev/hot-reloader-turbopack.js +1 -1
  62. package/dist/server/dev/hot-reloader-webpack.js +1 -1
  63. package/dist/server/dev/on-demand-entry-handler.js +2 -1
  64. package/dist/server/dev/on-demand-entry-handler.js.map +1 -1
  65. package/dist/server/dev/turbopack-utils.js +4 -2
  66. package/dist/server/dev/turbopack-utils.js.map +1 -1
  67. package/dist/server/lib/app-info-log.js +1 -1
  68. package/dist/server/lib/start-server.js +1 -1
  69. package/dist/server/next-server.js +2 -0
  70. package/dist/server/next-server.js.map +1 -1
  71. package/dist/server/node-environment-extensions/console-dim.external.d.ts +4 -0
  72. package/dist/server/node-environment-extensions/console-dim.external.js +76 -50
  73. package/dist/server/node-environment-extensions/console-dim.external.js.map +1 -1
  74. package/dist/server/node-environment-extensions/global-behaviors.d.ts +7 -0
  75. package/dist/server/node-environment-extensions/global-behaviors.js +33 -0
  76. package/dist/server/node-environment-extensions/global-behaviors.js.map +1 -0
  77. package/dist/shared/lib/errors/canary-only-config-error.js +1 -1
  78. package/dist/telemetry/anonymous-meta.js +1 -1
  79. package/dist/telemetry/events/session-stopped.js +2 -2
  80. package/dist/telemetry/events/version.js +2 -2
  81. 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'\nimport { isStableBuild } from '../shared/lib/errors/canary-only-config-error'\nimport type { FallbackRouteParam } from '../build/static-paths/types'\n\nexport type NextConfigComplete = Required<Omit<NextConfig, 'configFile'>> & {\n images: Required<ImageConfigComplete>\n typescript: TypeScriptConfig\n configFile: string | undefined\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 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\nexport type JSONValue =\n | string\n | number\n | boolean\n | JSONValue[]\n | { [k: string]: JSONValue }\n\n// At the moment, Turbopack options must be JSON-serializable, so restrict values.\nexport type TurbopackLoaderOptions = Record<string, JSONValue>\n\nexport type TurbopackLoaderItem =\n | string\n | {\n loader: string\n options?: TurbopackLoaderOptions\n }\n\nexport type TurbopackLoaderBuiltinCondition =\n | 'browser'\n | 'foreign'\n | 'development'\n | 'production'\n | 'node'\n | 'edge-light'\n\nexport type TurbopackRuleCondition =\n | { all: TurbopackRuleCondition[] }\n | { any: TurbopackRuleCondition[] }\n | { not: TurbopackRuleCondition }\n | TurbopackLoaderBuiltinCondition\n | {\n path?: string | RegExp\n content?: RegExp\n }\n\nexport type TurbopackRuleConfigItem = {\n loaders: TurbopackLoaderItem[]\n as?: string\n condition?: TurbopackRuleCondition\n}\n\n/**\n * This can be an object representing a single configuration, or a list of\n * loaders and/or rule configuration objects.\n *\n * - A list of loader path strings or objects is the \"shorthand\" syntax.\n * - A list of rule configuration objects can be useful when each configuration\n * object has different `condition` fields, but still match the same top-level\n * path glob.\n */\nexport type TurbopackRuleConfigCollection =\n | TurbopackRuleConfigItem\n | (TurbopackLoaderItem | TurbopackRuleConfigItem)[]\n\nexport interface TurbopackOptions {\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/config/next-config-js/turbopack#resolving-aliases)\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/config/next-config-js/turbopack#resolving-custom-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/config/next-config-js/turbopack#configuring-webpack-loaders)\n */\n rules?: Record<string, TurbopackRuleConfigCollection>\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 * Enables generation of debug IDs in JavaScript bundles and source maps.\n * These debug IDs help with debugging and error tracking by providing stable identifiers.\n *\n * @see https://github.com/tc39/ecma426/blob/main/proposals/debug-id.md TC39 Debug ID Proposal\n */\n debugIds?: 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 React Compiler that Next.js currently supports.\n *\n * These options may be changed in breaking ways at any time without notice\n * while support for React Compiler is experimental.\n *\n * @see https://react.dev/reference/react-compiler/configuration\n */\nexport interface ReactCompilerOptions {\n /**\n * Controls the strategy for determining which functions the React Compiler\n * will optimize.\n *\n * The default is `'infer'`, which uses intelligent heuristics to identify\n * React components and hooks.\n *\n * When using `infer`, Next.js applies its own heuristics before calling\n * `react-compiler`. This improves compilation performance by avoiding extra\n * invocations of Babel and reducing redundant parsing of code.\n *\n * @see https://react.dev/reference/react-compiler/compilationMode\n */\n compilationMode?: 'infer' | 'annotation' | 'all'\n /**\n * Controls how the React Compiler handles errors during compilation.\n *\n * The default is `'none'`, which skips components which cannot be compiled.\n *\n * @see https://react.dev/reference/react-compiler/panicThreshold\n */\n panicThreshold?: 'none' | 'critical_errors' | 'all_errors'\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 adapterPath?: string\n useSkewCookie?: 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 | 'client-only'\n\n /**\n * Enables RDC for Dynamic Navigations. This is only supported for App Router\n * when Partial Prerendering is also enabled. This is enabled by default when\n * Partial Prerendering is enabled.\n */\n rdcForNavigations?: boolean\n clientParamParsing?: boolean\n\n /**\n * The origins that are allowed to write the rewritten headers when\n * performing a non-relative rewrite. When undefined, no non-relative\n * rewrites will get the rewrite headers.\n */\n clientParamParsingOrigins?: string[]\n dynamicOnHover?: boolean\n preloadEntriesOnStart?: 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 imgOptSkipMetadata?: 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 disableOptimizedLoading?: boolean\n\n /** @deprecated A no-op as of Next 16, size metrics were removed from the build output. */\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 /**\n * A target memory limit for turbo, in bytes.\n */\n turbopackMemoryLimit?: number\n\n /**\n * Enable minification. Defaults to true in build mode and false in dev mode.\n */\n turbopackMinify?: boolean\n\n /**\n * Enable support for `with {type: \"module\"}` for ESM imports.\n */\n turbopackImportTypeBytes?: boolean\n\n /**\n * Enable scope hoisting. Defaults to true in build mode. Always disabled in development mode.\n */\n turbopackScopeHoisting?: boolean\n\n /**\n * Enable filesystem cache for the turbopack dev server.\n */\n turbopackFileSystemCacheForDev?: boolean\n\n /**\n * Enable filesystem cache for the turbopack build.\n */\n turbopackFileSystemCacheForBuild?: boolean\n\n /**\n * Enable source maps. Defaults to true.\n */\n turbopackSourceMaps?: boolean\n\n /**\n * Enable tree shaking for the turbopack dev server and build.\n */\n turbopackTreeShaking?: boolean\n\n /**\n * Enable removing unused exports for turbopack dev server and build.\n */\n turbopackRemoveUnusedExports?: boolean\n\n /**\n * Use the system-provided CA roots instead of bundled CA roots for external HTTPS requests\n * made by Turbopack. Currently this is only used for fetching data from Google Fonts.\n *\n * This may be useful in cases where you or an employer are MITMing traffic.\n *\n * This option is experimental because:\n * - This may cause small performance problems, as it uses [`rustls-native-certs`](\n * https://github.com/rustls/rustls-native-certs).\n * - In the future, this may become the default, and this option may be eliminated, once\n * <https://github.com/seanmonstar/reqwest/issues/2159> is resolved.\n *\n * Users who need to configure this behavior system-wide can override the project\n * configuration using the `NEXT_TURBOPACK_EXPERIMENTAL_USE_SYSTEM_TLS_CERTS=1` environment\n * variable.\n *\n * This option is ignored on Windows on ARM, where the native TLS implementation is always\n * used.\n *\n * If you need to set a proxy, Turbopack [respects the common `HTTP_PROXY` and `HTTPS_PROXY`\n * environment variable convention](https://docs.rs/reqwest/latest/reqwest/#proxies). HTTP\n * proxies are supported, SOCKS proxies are not currently supported.\n */\n turbopackUseSystemTlsCerts?: boolean\n\n /**\n * Set this to `false` to disable the automatic configuration of the babel loader when a Babel\n * configuration file is present. This option is enabled by default.\n *\n * If this is set to `false`, but `reactCompiler` is `true`, the built-in Babel will\n * still be configured, but any Babel configuration files on disk will be ignored. If you wish to\n * use React Compiler with a different manually-configured `babel-loader`, you should disable both\n * this and `reactCompiler`.\n */\n turbopackUseBuiltinBabel?: boolean\n\n /**\n * Set this to `false` to disable the automatic configuration of the sass loader. The sass loader\n * configuration is enabled by default.\n */\n turbopackUseBuiltinSass?: 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 turbopackModuleIds?: 'named' | 'deterministic'\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 * Enable type checking for Link and Router.push, etc.\n * @deprecated Use `typedRoutes` instead — this feature is now stable.\n * @see https://nextjs.org/docs/app/api-reference/config/typescript#statically-typed-links\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 * @deprecated This configuration option has been merged into `experimental.cacheComponents`.\n * The Partial Prerendering feature is still available via `experimental.cacheComponents`.\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 /**\n * Enables the Back/Forward Cache for the router.\n */\n routerBFCache?: boolean\n\n /**\n * Uninstalls all \"unhandledRejection\" and \"uncaughtException\" listeners from\n * the global process so that we can override the behavior, which in some\n * runtimes is to exit the process.\n *\n * This is experimental until we've considered the impact in various\n * deployment environments.\n */\n removeUncaughtErrorAndRejectionListeners?: boolean\n\n /**\n * During an RSC request, validates that the request headers match the\n * cache-busting search parameter sent by the client.\n */\n validateRSCRequestHeaders?: 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 while generating static pages.\n * Helps with errors during the prerender phase in `next build`.\n */\n enablePrerenderSourceMaps?: 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 * @internal Used by the Next.js internals only.\n */\n isExperimentalCompile?: boolean\n\n useWasmBinary?: boolean\n\n /**\n * Use lightningcss instead of postcss-loader\n */\n useLightningcss?: boolean\n\n /**\n * Enables view transitions by using the {@link https://react.dev/reference/react/ViewTransition 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 /**\n * When enabled, in dev mode, Next.js will send React's debug info through the\n * WebSocket connection, instead of including it in the main RSC payload.\n */\n reactDebugChannel?: boolean\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. This also enables the experimental Partial\n * Prerendering feature of Next.js, and it enables `react@experimental` being\n * used for the `app` directory.\n */\n cacheComponents?: boolean\n\n /**\n * @deprecated Use `experimental.cacheComponents` instead.\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 /**\n * Enables using the global-not-found.js file in the app directory\n *\n */\n globalNotFound?: boolean\n\n /**\n * Enable debug information to be forwarded from browser to dev server stdout/stderr\n */\n browserDebugInfoInTerminal?:\n | boolean\n | {\n /**\n * Option to limit stringification at a specific nesting depth when logging circular objects.\n * @default 5\n */\n depthLimit?: number\n\n /**\n * Maximum number of properties/elements to stringify when logging objects/arrays with circular references.\n * @default 100\n */\n edgeLimit?: number\n /**\n * Whether to include source location information in debug output when available\n */\n showSourceLocation?: boolean\n }\n\n /**\n * Enable accessing root params via the `next/root-params` module.\n */\n rootParams?: boolean\n\n /**\n * Use an isolated directory for development builds to prevent conflicts\n * with production builds. Development builds will use `{distDir}/dev`\n * instead of `{distDir}`.\n */\n isolatedDevBuild?: boolean\n\n /**\n * Body size limit for request bodies with middleware configured.\n * Defaults to 10MB. Can be specified as a number (bytes) or string (e.g. '5mb').\n */\n middlewareClientMaxBodySize?: SizeLimit\n\n /**\n * Enable the Model Context Protocol (MCP) server for AI-assisted development.\n * When enabled, Next.js will expose an MCP server at `/_next/mcp` that provides\n * code intelligence and project context to AI assistants.\n *\n * @default false\n */\n mcpServer?: boolean\n\n /**\n * Acquires a lockfile at `<distDir>/lock` when starting `next dev` or `next\n * build`. Failing to acquire the lock causes the process to exit with an\n * error message.\n *\n * This is because if multiple processes write to the same `distDir` at the\n * same time, it can mangle the state of the directory. Disabling this option\n * is not recommended.\n *\n * @default true\n */\n lockDistDir?: boolean\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 FallbackRouteParam[]\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, the page is prerendered as a fallback shell, while allowing\n * any dynamic accesses to result in an empty shell. This is the case when\n * the app has `experimental.ppr` and `experimental.cacheComponents` enabled, and\n * there are also routes prerendered with a more complete set of params.\n * Prerendering those routes would catch any invalid dynamic accesses.\n *\n * @internal\n */\n _allowEmptyStaticShell?: 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 {\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 * @see [Next.js TypeScript documentation](https://nextjs.org/docs/app/api-reference/config/typescript)\n */\n typescript?: TypeScriptConfig\n\n /**\n * Enable type checking for Link and Router.push, etc.\n * This feature requires TypeScript in your project.\n *\n * @see [Typed Links documentation](https://nextjs.org/docs/app/api-reference/config/typescript#statically-typed-links)\n */\n typedRoutes?: boolean\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[]> | 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?: () =>\n | Promise<\n | Rewrite[]\n | {\n beforeFiles?: Rewrite[]\n afterFiles?: Rewrite[]\n fallback?: Rewrite[]\n }\n >\n | Rewrite[]\n | {\n beforeFiles?: Rewrite[]\n afterFiles?: Rewrite[]\n fallback?: Rewrite[]\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[]> | 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 * 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 /**\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 {@link https://nextjs.org/docs/app/api-reference/config/next-config-js/reactCompiler React Compiler in Next.js}.\n * Configuration accepts partial config object of the Compiler.\n * If provided, the Compiler will be enabled.\n */\n reactCompiler?: boolean | ReactCompilerOptions\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 * 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 * Replaces server-only (Node.js and Edge) variables in your code during compile time.\n * Each key will be replaced with the respective values.\n */\n defineServer?: Record<string, string>\n\n /**\n * A hook function that executes after production build compilation finishes,\n * but before running post-compilation tasks such as type checking and\n * static page generation.\n */\n runAfterProductionCompile?: (metadata: {\n /**\n * The root directory of the project\n */\n projectDir: string\n /**\n * The build output directory (defaults to `.next`)\n */\n distDir: string\n }) => Promise<void>\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 /**\n * Options for Turbopack. Temporarily also available as `experimental.turbo` for compatibility.\n */\n turbopack?: TurbopackOptions\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 /**\n * @internal\n */\n configFile?: string | undefined\n\n /**\n * @internal\n */\n configOrigin?: string | undefined\n\n /**\n * @internal\n */\n _originalRedirects?: any\n\n /**\n * @internal\n */\n _originalRewrites?: any\n}\n\nexport const defaultConfig = Object.freeze({\n env: {},\n webpack: null,\n typescript: {\n ignoreBuildErrors: false,\n tsconfigPath: undefined,\n },\n typedRoutes: false,\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 basePath: '',\n sassOptions: {},\n trailingSlash: false,\n i18n: null,\n productionBrowserSourceMaps: false,\n excludeDefaultMomentLocales: true,\n reactProductionProfiling: false,\n reactStrictMode: null,\n reactMaxHeadersLength: 6000,\n httpAgentOptions: {\n keepAlive: true,\n },\n logging: {},\n compiler: {},\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: undefined,\n experimental: {\n adapterPath: process.env.NEXT_ADAPTER_PATH || undefined,\n useSkewCookie: 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: 30, // 30 seconds\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: 60 * 60 * 24 * 365, // 1 year\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 // Will default to cacheComponents value.\n enablePrerenderSourceMaps: undefined,\n serverSourceMaps: false,\n linkNoTouchStart: false,\n caseSensitiveRoutes: false,\n clientSegmentCache: true,\n rdcForNavigations: false,\n clientParamParsing: false,\n clientParamParsingOrigins: undefined,\n dynamicOnHover: false,\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 imgOptSkipMetadata: 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 urlImports: undefined,\n typedEnv: false,\n clientTraceMetadata: undefined,\n parallelServerCompiles: false,\n parallelServerBuildTraces: false,\n ppr: false,\n authInterrupts: false,\n webpackBuildWorker: undefined,\n webpackMemoryOptimizations: false,\n optimizeServerReact: true,\n viewTransition: false,\n routerBFCache: false,\n removeUncaughtErrorAndRejectionListeners: false,\n validateRSCRequestHeaders: !!(\n process.env.__NEXT_TEST_MODE || !isStableBuild()\n ),\n staleTimes: {\n dynamic: 0,\n static: 300,\n },\n allowDevelopmentBuild: undefined,\n reactDebugChannel: false,\n staticGenerationRetryCount: undefined,\n serverComponentsHmrCache: true,\n staticGenerationMaxConcurrency: 8,\n staticGenerationMinPagesPerWorker: 25,\n cacheComponents: false,\n inlineCss: false,\n useCache: undefined,\n slowModuleDetection: undefined,\n globalNotFound: false,\n browserDebugInfoInTerminal: false,\n lockDistDir: true,\n isolatedDevBuild: true,\n middlewareClientMaxBodySize: 10_485_760, // 10MB\n },\n htmlLimitedBots: undefined,\n bundlePagesRouterDependencies: false,\n} satisfies NextConfig)\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","isStableBuild","defaultConfig","Object","freeze","env","webpack","typescript","ignoreBuildErrors","tsconfigPath","undefined","typedRoutes","distDir","cleanDistDir","assetPrefix","cacheHandler","process","NEXT_CACHE_HANDLER_PATH","cacheMaxMemorySize","configOrigin","useFileSystemPublicRoutes","generateBuildId","generateEtags","pageExtensions","poweredByHeader","compress","images","devIndicators","position","onDemandEntries","maxInactiveAge","pagesBufferLength","basePath","sassOptions","trailingSlash","i18n","productionBrowserSourceMaps","excludeDefaultMomentLocales","reactProductionProfiling","reactStrictMode","reactMaxHeadersLength","httpAgentOptions","keepAlive","logging","compiler","expireTime","NEXT_PRIVATE_CDN_CONSUMED_SWR_CACHE_CONTROL","staticPageGenerationTimeout","output","NEXT_PRIVATE_STANDALONE","modularizeImports","outputFileTracingRoot","NEXT_PRIVATE_OUTPUT_TRACE_ROOT","allowedDevOrigins","experimental","adapterPath","NEXT_ADAPTER_PATH","useSkewCookie","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","enablePrerenderSourceMaps","serverSourceMaps","linkNoTouchStart","caseSensitiveRoutes","clientSegmentCache","rdcForNavigations","clientParamParsing","clientParamParsingOrigins","dynamicOnHover","preloadEntriesOnStart","clientRouterFilter","clientRouterFilterRedirects","fetchCacheKeyPrefix","middlewarePrefetch","optimisticClientCache","manualClientBasePath","cpus","Math","Number","CIRCLE_NODE_TOTAL","length","memoryBasedWorkersCount","imgOptConcurrency","imgOptTimeoutInSeconds","imgOptMaxInputPixels","imgOptSequentialRead","imgOptSkipMetadata","isrFlushToDisk","workerThreads","proxyTimeout","optimizeCss","nextScriptWorkers","scrollRestoration","externalDir","disableOptimizedLoading","gzipSize","craCompat","esmExternals","fullySpecified","swcTraceProfiling","forceSwcTransforms","swcPlugins","largePageDataBytes","disablePostcssPresetEnv","urlImports","typedEnv","clientTraceMetadata","parallelServerCompiles","parallelServerBuildTraces","ppr","authInterrupts","webpackBuildWorker","webpackMemoryOptimizations","optimizeServerReact","viewTransition","routerBFCache","removeUncaughtErrorAndRejectionListeners","validateRSCRequestHeaders","__NEXT_TEST_MODE","staleTimes","dynamic","allowDevelopmentBuild","reactDebugChannel","staticGenerationRetryCount","serverComponentsHmrCache","staticGenerationMaxConcurrency","staticGenerationMinPagesPerWorker","cacheComponents","inlineCss","useCache","slowModuleDetection","globalNotFound","browserDebugInfoInTerminal","lockDistDir","isolatedDevBuild","middlewareClientMaxBodySize","htmlLimitedBots","bundlePagesRouterDependencies","normalizeConfig","phase","config"],"mappings":"AAAA,OAAOA,QAAQ,KAAI;AAGnB,SAASC,kBAAkB,QAAQ,6BAA4B;AAW/D,SAASC,cAAc,QAAQ,mBAAkB;AACjD,SAASC,aAAa,QAAQ,gDAA+C;AAyxC7E,OAAO,MAAMC,gBAAgBC,OAAOC,MAAM,CAAC;IACzCC,KAAK,CAAC;IACNC,SAAS;IACTC,YAAY;QACVC,mBAAmB;QACnBC,cAAcC;IAChB;IACAC,aAAa;IACbC,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,QAAQ3B;IACR4B,eAAe;QACbC,UAAU;IACZ;IACAC,iBAAiB;QACfC,gBAAgB,KAAK;QACrBC,mBAAmB;IACrB;IACAC,UAAU;IACVC,aAAa,CAAC;IACdC,eAAe;IACfC,MAAM;IACNC,6BAA6B;IAC7BC,6BAA6B;IAC7BC,0BAA0B;IAC1BC,iBAAiB;IACjBC,uBAAuB;IACvBC,kBAAkB;QAChBC,WAAW;IACb;IACAC,SAAS,CAAC;IACVC,UAAU,CAAC;IACXC,YAAY7B,QAAQX,GAAG,CAACyC,2CAA2C,GAC/DpC,YACA;IACJqC,6BAA6B;IAC7BC,QAAQ,CAAC,CAAChC,QAAQX,GAAG,CAAC4C,uBAAuB,GAAG,eAAevC;IAC/DwC,mBAAmBxC;IACnByC,uBAAuBnC,QAAQX,GAAG,CAAC+C,8BAA8B,IAAI;IACrEC,mBAAmB3C;IACnB4C,cAAc;QACZC,aAAavC,QAAQX,GAAG,CAACmD,iBAAiB,IAAI9C;QAC9C+C,eAAe;QACfC,WAAW;YACTC,S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-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'\nimport { isStableBuild } from '../shared/lib/errors/canary-only-config-error'\nimport type { FallbackRouteParam } from '../build/static-paths/types'\n\nexport type NextConfigComplete = Required<Omit<NextConfig, 'configFile'>> & {\n images: Required<ImageConfigComplete>\n typescript: TypeScriptConfig\n configFile: string | undefined\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 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\nexport type JSONValue =\n | string\n | number\n | boolean\n | JSONValue[]\n | { [k: string]: JSONValue }\n\n// At the moment, Turbopack options must be JSON-serializable, so restrict values.\nexport type TurbopackLoaderOptions = Record<string, JSONValue>\n\nexport type TurbopackLoaderItem =\n | string\n | {\n loader: string\n options?: TurbopackLoaderOptions\n }\n\nexport type TurbopackLoaderBuiltinCondition =\n | 'browser'\n | 'foreign'\n | 'development'\n | 'production'\n | 'node'\n | 'edge-light'\n\nexport type TurbopackRuleCondition =\n | { all: TurbopackRuleCondition[] }\n | { any: TurbopackRuleCondition[] }\n | { not: TurbopackRuleCondition }\n | TurbopackLoaderBuiltinCondition\n | {\n path?: string | RegExp\n content?: RegExp\n }\n\nexport type TurbopackRuleConfigItem = {\n loaders: TurbopackLoaderItem[]\n as?: string\n condition?: TurbopackRuleCondition\n}\n\n/**\n * This can be an object representing a single configuration, or a list of\n * loaders and/or rule configuration objects.\n *\n * - A list of loader path strings or objects is the \"shorthand\" syntax.\n * - A list of rule configuration objects can be useful when each configuration\n * object has different `condition` fields, but still match the same top-level\n * path glob.\n */\nexport type TurbopackRuleConfigCollection =\n | TurbopackRuleConfigItem\n | (TurbopackLoaderItem | TurbopackRuleConfigItem)[]\n\nexport interface TurbopackOptions {\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/config/next-config-js/turbopack#resolving-aliases)\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/config/next-config-js/turbopack#resolving-custom-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/config/next-config-js/turbopack#configuring-webpack-loaders)\n */\n rules?: Record<string, TurbopackRuleConfigCollection>\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 * Enables generation of debug IDs in JavaScript bundles and source maps.\n * These debug IDs help with debugging and error tracking by providing stable identifiers.\n *\n * @see https://github.com/tc39/ecma426/blob/main/proposals/debug-id.md TC39 Debug ID Proposal\n */\n debugIds?: 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 React Compiler that Next.js currently supports.\n *\n * These options may be changed in breaking ways at any time without notice\n * while support for React Compiler is experimental.\n *\n * @see https://react.dev/reference/react-compiler/configuration\n */\nexport interface ReactCompilerOptions {\n /**\n * Controls the strategy for determining which functions the React Compiler\n * will optimize.\n *\n * The default is `'infer'`, which uses intelligent heuristics to identify\n * React components and hooks.\n *\n * When using `infer`, Next.js applies its own heuristics before calling\n * `react-compiler`. This improves compilation performance by avoiding extra\n * invocations of Babel and reducing redundant parsing of code.\n *\n * @see https://react.dev/reference/react-compiler/compilationMode\n */\n compilationMode?: 'infer' | 'annotation' | 'all'\n /**\n * Controls how the React Compiler handles errors during compilation.\n *\n * The default is `'none'`, which skips components which cannot be compiled.\n *\n * @see https://react.dev/reference/react-compiler/panicThreshold\n */\n panicThreshold?: 'none' | 'critical_errors' | 'all_errors'\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 adapterPath?: string\n useSkewCookie?: 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 | 'client-only'\n\n /**\n * Enables RDC for Dynamic Navigations. This is only supported for App Router\n * when Partial Prerendering is also enabled. This is enabled by default when\n * Partial Prerendering is enabled.\n */\n rdcForNavigations?: boolean\n clientParamParsing?: boolean\n\n /**\n * The origins that are allowed to write the rewritten headers when\n * performing a non-relative rewrite. When undefined, no non-relative\n * rewrites will get the rewrite headers.\n */\n clientParamParsingOrigins?: string[]\n dynamicOnHover?: boolean\n preloadEntriesOnStart?: 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 imgOptSkipMetadata?: 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 disableOptimizedLoading?: boolean\n\n /** @deprecated A no-op as of Next 16, size metrics were removed from the build output. */\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 /**\n * A target memory limit for turbo, in bytes.\n */\n turbopackMemoryLimit?: number\n\n /**\n * Enable minification. Defaults to true in build mode and false in dev mode.\n */\n turbopackMinify?: boolean\n\n /**\n * Enable support for `with {type: \"module\"}` for ESM imports.\n */\n turbopackImportTypeBytes?: boolean\n\n /**\n * Enable scope hoisting. Defaults to true in build mode. Always disabled in development mode.\n */\n turbopackScopeHoisting?: boolean\n\n /**\n * Enable filesystem cache for the turbopack dev server.\n */\n turbopackFileSystemCacheForDev?: boolean\n\n /**\n * Enable filesystem cache for the turbopack build.\n */\n turbopackFileSystemCacheForBuild?: boolean\n\n /**\n * Enable source maps. Defaults to true.\n */\n turbopackSourceMaps?: boolean\n\n /**\n * Enable tree shaking for the turbopack dev server and build.\n */\n turbopackTreeShaking?: boolean\n\n /**\n * Enable removing unused exports for turbopack dev server and build.\n */\n turbopackRemoveUnusedExports?: boolean\n\n /**\n * Use the system-provided CA roots instead of bundled CA roots for external HTTPS requests\n * made by Turbopack. Currently this is only used for fetching data from Google Fonts.\n *\n * This may be useful in cases where you or an employer are MITMing traffic.\n *\n * This option is experimental because:\n * - This may cause small performance problems, as it uses [`rustls-native-certs`](\n * https://github.com/rustls/rustls-native-certs).\n * - In the future, this may become the default, and this option may be eliminated, once\n * <https://github.com/seanmonstar/reqwest/issues/2159> is resolved.\n *\n * Users who need to configure this behavior system-wide can override the project\n * configuration using the `NEXT_TURBOPACK_EXPERIMENTAL_USE_SYSTEM_TLS_CERTS=1` environment\n * variable.\n *\n * This option is ignored on Windows on ARM, where the native TLS implementation is always\n * used.\n *\n * If you need to set a proxy, Turbopack [respects the common `HTTP_PROXY` and `HTTPS_PROXY`\n * environment variable convention](https://docs.rs/reqwest/latest/reqwest/#proxies). HTTP\n * proxies are supported, SOCKS proxies are not currently supported.\n */\n turbopackUseSystemTlsCerts?: boolean\n\n /**\n * Set this to `false` to disable the automatic configuration of the babel loader when a Babel\n * configuration file is present. This option is enabled by default.\n *\n * If this is set to `false`, but `reactCompiler` is `true`, the built-in Babel will\n * still be configured, but any Babel configuration files on disk will be ignored. If you wish to\n * use React Compiler with a different manually-configured `babel-loader`, you should disable both\n * this and `reactCompiler`.\n */\n turbopackUseBuiltinBabel?: boolean\n\n /**\n * Set this to `false` to disable the automatic configuration of the sass loader. The sass loader\n * configuration is enabled by default.\n */\n turbopackUseBuiltinSass?: 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 turbopackModuleIds?: 'named' | 'deterministic'\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 * Enable type checking for Link and Router.push, etc.\n * @deprecated Use `typedRoutes` instead — this feature is now stable.\n * @see https://nextjs.org/docs/app/api-reference/config/typescript#statically-typed-links\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 * @deprecated This configuration option has been merged into `experimental.cacheComponents`.\n * The Partial Prerendering feature is still available via `experimental.cacheComponents`.\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 /**\n * Enables the Back/Forward Cache for the router.\n */\n routerBFCache?: boolean\n\n /**\n * Uninstalls all \"unhandledRejection\" and \"uncaughtException\" listeners from\n * the global process so that we can override the behavior, which in some\n * runtimes is to exit the process.\n *\n * This is experimental until we've considered the impact in various\n * deployment environments.\n */\n removeUncaughtErrorAndRejectionListeners?: boolean\n\n /**\n * During an RSC request, validates that the request headers match the\n * cache-busting search parameter sent by the client.\n */\n validateRSCRequestHeaders?: 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 while generating static pages.\n * Helps with errors during the prerender phase in `next build`.\n */\n enablePrerenderSourceMaps?: 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 * @internal Used by the Next.js internals only.\n */\n isExperimentalCompile?: boolean\n\n useWasmBinary?: boolean\n\n /**\n * Use lightningcss instead of postcss-loader\n */\n useLightningcss?: boolean\n\n /**\n * Enables view transitions by using the {@link https://react.dev/reference/react/ViewTransition 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 /**\n * When enabled, in dev mode, Next.js will send React's debug info through the\n * WebSocket connection, instead of including it in the main RSC payload.\n */\n reactDebugChannel?: boolean\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. This also enables the experimental Partial\n * Prerendering feature of Next.js, and it enables `react@experimental` being\n * used for the `app` directory.\n */\n cacheComponents?: boolean\n\n /**\n * @deprecated Use `experimental.cacheComponents` instead.\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 /**\n * Enables using the global-not-found.js file in the app directory\n *\n */\n globalNotFound?: boolean\n\n /**\n * Enable debug information to be forwarded from browser to dev server stdout/stderr\n */\n browserDebugInfoInTerminal?:\n | boolean\n | {\n /**\n * Option to limit stringification at a specific nesting depth when logging circular objects.\n * @default 5\n */\n depthLimit?: number\n\n /**\n * Maximum number of properties/elements to stringify when logging objects/arrays with circular references.\n * @default 100\n */\n edgeLimit?: number\n /**\n * Whether to include source location information in debug output when available\n */\n showSourceLocation?: boolean\n }\n\n /**\n * Enable accessing root params via the `next/root-params` module.\n */\n rootParams?: boolean\n\n /**\n * Use an isolated directory for development builds to prevent conflicts\n * with production builds. Development builds will use `{distDir}/dev`\n * instead of `{distDir}`.\n */\n isolatedDevBuild?: boolean\n\n /**\n * Body size limit for request bodies with middleware configured.\n * Defaults to 10MB. Can be specified as a number (bytes) or string (e.g. '5mb').\n */\n middlewareClientMaxBodySize?: SizeLimit\n\n /**\n * Enable the Model Context Protocol (MCP) server for AI-assisted development.\n * When enabled, Next.js will expose an MCP server at `/_next/mcp` that provides\n * code intelligence and project context to AI assistants.\n *\n * @default false\n */\n mcpServer?: boolean\n\n /**\n * Acquires a lockfile at `<distDir>/lock` when starting `next dev` or `next\n * build`. Failing to acquire the lock causes the process to exit with an\n * error message.\n *\n * This is because if multiple processes write to the same `distDir` at the\n * same time, it can mangle the state of the directory. Disabling this option\n * is not recommended.\n *\n * @default true\n */\n lockDistDir?: boolean\n\n /**\n * Hide logs that occur after a render has already aborted.\n * This can help reduce noise in the console when dealing with aborted renders.\n *\n * @default false\n */\n hideLogsAfterAbort?: boolean\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 FallbackRouteParam[]\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, the page is prerendered as a fallback shell, while allowing\n * any dynamic accesses to result in an empty shell. This is the case when\n * the app has `experimental.ppr` and `experimental.cacheComponents` enabled, and\n * there are also routes prerendered with a more complete set of params.\n * Prerendering those routes would catch any invalid dynamic accesses.\n *\n * @internal\n */\n _allowEmptyStaticShell?: 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 {\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 * @see [Next.js TypeScript documentation](https://nextjs.org/docs/app/api-reference/config/typescript)\n */\n typescript?: TypeScriptConfig\n\n /**\n * Enable type checking for Link and Router.push, etc.\n * This feature requires TypeScript in your project.\n *\n * @see [Typed Links documentation](https://nextjs.org/docs/app/api-reference/config/typescript#statically-typed-links)\n */\n typedRoutes?: boolean\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[]> | 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?: () =>\n | Promise<\n | Rewrite[]\n | {\n beforeFiles?: Rewrite[]\n afterFiles?: Rewrite[]\n fallback?: Rewrite[]\n }\n >\n | Rewrite[]\n | {\n beforeFiles?: Rewrite[]\n afterFiles?: Rewrite[]\n fallback?: Rewrite[]\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[]> | 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 * 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 /**\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 {@link https://nextjs.org/docs/app/api-reference/config/next-config-js/reactCompiler React Compiler in Next.js}.\n * Configuration accepts partial config object of the Compiler.\n * If provided, the Compiler will be enabled.\n */\n reactCompiler?: boolean | ReactCompilerOptions\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 * 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 * Replaces server-only (Node.js and Edge) variables in your code during compile time.\n * Each key will be replaced with the respective values.\n */\n defineServer?: Record<string, string>\n\n /**\n * A hook function that executes after production build compilation finishes,\n * but before running post-compilation tasks such as type checking and\n * static page generation.\n */\n runAfterProductionCompile?: (metadata: {\n /**\n * The root directory of the project\n */\n projectDir: string\n /**\n * The build output directory (defaults to `.next`)\n */\n distDir: string\n }) => Promise<void>\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 /**\n * Options for Turbopack. Temporarily also available as `experimental.turbo` for compatibility.\n */\n turbopack?: TurbopackOptions\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 /**\n * @internal\n */\n configFile?: string | undefined\n\n /**\n * @internal\n */\n configOrigin?: string | undefined\n\n /**\n * @internal\n */\n _originalRedirects?: any\n\n /**\n * @internal\n */\n _originalRewrites?: any\n}\n\nexport const defaultConfig = Object.freeze({\n env: {},\n webpack: null,\n typescript: {\n ignoreBuildErrors: false,\n tsconfigPath: undefined,\n },\n typedRoutes: false,\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 basePath: '',\n sassOptions: {},\n trailingSlash: false,\n i18n: null,\n productionBrowserSourceMaps: false,\n excludeDefaultMomentLocales: true,\n reactProductionProfiling: false,\n reactStrictMode: null,\n reactMaxHeadersLength: 6000,\n httpAgentOptions: {\n keepAlive: true,\n },\n logging: {},\n compiler: {},\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: undefined,\n experimental: {\n adapterPath: process.env.NEXT_ADAPTER_PATH || undefined,\n useSkewCookie: 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: 30, // 30 seconds\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: 60 * 60 * 24 * 365, // 1 year\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 // Will default to cacheComponents value.\n enablePrerenderSourceMaps: undefined,\n serverSourceMaps: false,\n linkNoTouchStart: false,\n caseSensitiveRoutes: false,\n clientSegmentCache: true,\n rdcForNavigations: false,\n clientParamParsing: false,\n clientParamParsingOrigins: undefined,\n dynamicOnHover: false,\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 imgOptSkipMetadata: 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 urlImports: undefined,\n typedEnv: false,\n clientTraceMetadata: undefined,\n parallelServerCompiles: false,\n parallelServerBuildTraces: false,\n ppr: false,\n authInterrupts: false,\n webpackBuildWorker: undefined,\n webpackMemoryOptimizations: false,\n optimizeServerReact: true,\n viewTransition: false,\n routerBFCache: false,\n removeUncaughtErrorAndRejectionListeners: false,\n validateRSCRequestHeaders: !!(\n process.env.__NEXT_TEST_MODE || !isStableBuild()\n ),\n staleTimes: {\n dynamic: 0,\n static: 300,\n },\n allowDevelopmentBuild: undefined,\n reactDebugChannel: false,\n staticGenerationRetryCount: undefined,\n serverComponentsHmrCache: true,\n staticGenerationMaxConcurrency: 8,\n staticGenerationMinPagesPerWorker: 25,\n cacheComponents: false,\n inlineCss: false,\n useCache: undefined,\n slowModuleDetection: undefined,\n globalNotFound: false,\n browserDebugInfoInTerminal: false,\n lockDistDir: true,\n isolatedDevBuild: true,\n middlewareClientMaxBodySize: 10_485_760, // 10MB\n hideLogsAfterAbort: false,\n },\n htmlLimitedBots: undefined,\n bundlePagesRouterDependencies: false,\n} satisfies NextConfig)\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","isStableBuild","defaultConfig","Object","freeze","env","webpack","typescript","ignoreBuildErrors","tsconfigPath","undefined","typedRoutes","distDir","cleanDistDir","assetPrefix","cacheHandler","process","NEXT_CACHE_HANDLER_PATH","cacheMaxMemorySize","configOrigin","useFileSystemPublicRoutes","generateBuildId","generateEtags","pageExtensions","poweredByHeader","compress","images","devIndicators","position","onDemandEntries","maxInactiveAge","pagesBufferLength","basePath","sassOptions","trailingSlash","i18n","productionBrowserSourceMaps","excludeDefaultMomentLocales","reactProductionProfiling","reactStrictMode","reactMaxHeadersLength","httpAgentOptions","keepAlive","logging","compiler","expireTime","NEXT_PRIVATE_CDN_CONSUMED_SWR_CACHE_CONTROL","staticPageGenerationTimeout","output","NEXT_PRIVATE_STANDALONE","modularizeImports","outputFileTracingRoot","NEXT_PRIVATE_OUTPUT_TRACE_ROOT","allowedDevOrigins","experimental","adapterPath","NEXT_ADAPTER_PATH","useSkewCookie","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","enablePrerenderSourceMaps","serverSourceMaps","linkNoTouchStart","caseSensitiveRoutes","clientSegmentCache","rdcForNavigations","clientParamParsing","clientParamParsingOrigins","dynamicOnHover","preloadEntriesOnStart","clientRouterFilter","clientRouterFilterRedirects","fetchCacheKeyPrefix","middlewarePrefetch","optimisticClientCache","manualClientBasePath","cpus","Math","Number","CIRCLE_NODE_TOTAL","length","memoryBasedWorkersCount","imgOptConcurrency","imgOptTimeoutInSeconds","imgOptMaxInputPixels","imgOptSequentialRead","imgOptSkipMetadata","isrFlushToDisk","workerThreads","proxyTimeout","optimizeCss","nextScriptWorkers","scrollRestoration","externalDir","disableOptimizedLoading","gzipSize","craCompat","esmExternals","fullySpecified","swcTraceProfiling","forceSwcTransforms","swcPlugins","largePageDataBytes","disablePostcssPresetEnv","urlImports","typedEnv","clientTraceMetadata","parallelServerCompiles","parallelServerBuildTraces","ppr","authInterrupts","webpackBuildWorker","webpackMemoryOptimizations","optimizeServerReact","viewTransition","routerBFCache","removeUncaughtErrorAndRejectionListeners","validateRSCRequestHeaders","__NEXT_TEST_MODE","staleTimes","dynamic","allowDevelopmentBuild","reactDebugChannel","staticGenerationRetryCount","serverComponentsHmrCache","staticGenerationMaxConcurrency","staticGenerationMinPagesPerWorker","cacheComponents","inlineCss","useCache","slowModuleDetection","globalNotFound","browserDebugInfoInTerminal","lockDistDir","isolatedDevBuild","middlewareClientMaxBodySize","hideLogsAfterAbort","htmlLimitedBots","bundlePagesRouterDependencies","normalizeConfig","phase","config"],"mappings":"AAAA,OAAOA,QAAQ,KAAI;AAGnB,SAASC,kBAAkB,QAAQ,6BAA4B;AAW/D,SAASC,cAAc,QAAQ,mBAAkB;AACjD,SAASC,aAAa,QAAQ,gDAA+C;AAiyC7E,OAAO,MAAMC,gBAAgBC,OAAOC,MAAM,CAAC;IACzCC,KAAK,CAAC;IACNC,SAAS;IACTC,YAAY;QACVC,mBAAmB;QACnBC,cAAcC;IAChB;IACAC,aAAa;IACbC,SAAS;IACTC,cAAc;IACdC,aAAa;IACbC,cAAcC,QAAQX,GAAG,CAACY,uBAAuB;I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ACZmH,UAAU;QACVC,qBAAqBpH;QACrBqH,wBAAwB;QACxBC,2BAA2B;QAC3BC,KAAK;QACLC,gBAAgB;QAChBC,oBAAoBzH;QACpB0H,4BAA4B;QAC5BC,qBAAqB;QACrBC,gBAAgB;QAChBC,eAAe;QACfC,0CAA0C;QAC1CC,2BAA2B,CAAC,CAC1BzH,CAAAA,QAAQX,GAAG,CAACqI,gBAAgB,IAAI,CAACzI,eAAc;QAEjD0I,YAAY;YACVC,SAAS;YACTnE,QAAQ;QACV;QACAoE,uBAAuBnI;QACvBoI,mBAAmB;QACnBC,4BAA4BrI;QAC5BsI,0BAA0B;QAC1BC,gCAAgC;QAChCC,mCAAmC;QACnCC,iBAAiB;QACjBC,WAAW;QACXC,UAAU3I;QACV4I,qBAAqB5I;QACrB6I,gBAAgB;QAChBC,4BAA4B;QAC5BC,aAAa;QACbC,kBAAkB;QAClBC,6BAA6B;QAC7BC,oBAAoB;IACtB;IACAC,iBAAiBnJ;IACjBoJ,+BAA+B;AACjC,GAAuB;AAEvB,OAAO,eAAeC,gBAAgBC,KAAa,EAAEC,MAAW;IAC9D,IAAI,OAAOA,WAAW,YAAY;QAChCA,SAASA,OAAOD,OAAO;YAAE9J;QAAc;IACzC;IACA,gFAAgF;IAChF,OAAO,MAAM+J;AACf","ignoreList":[0]}
@@ -95,7 +95,7 @@ export async function createHotReloaderTurbopack(opts, serverFields, distDir, re
95
95
  }
96
96
  const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
97
97
  const hotReloaderSpan = trace('hot-reloader', undefined, {
98
- version: "16.0.0-canary.0"
98
+ version: "16.0.0-canary.1"
99
99
  });
100
100
  // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
101
101
  // of the current `next dev` invocation.
@@ -160,7 +160,7 @@ export default class HotReloaderWebpack {
160
160
  this.previewProps = previewProps;
161
161
  this.rewrites = rewrites;
162
162
  this.hotReloaderSpan = trace('hot-reloader', undefined, {
163
- version: "16.0.0-canary.0"
163
+ version: "16.0.0-canary.1"
164
164
  });
165
165
  // Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
166
166
  // of the current `next dev` invocation.
@@ -550,7 +550,8 @@ export function onDemandEntryHandler({ hotReloader, maxInactiveAge, multiCompile
550
550
  const hasNewEntry = addedValues.some((entry)=>entry.newEntry);
551
551
  if (hasNewEntry) {
552
552
  const routePage = isApp ? route.page : normalizeAppPath(route.page);
553
- reportTrigger(routePage, url);
553
+ // If proxy file, remove the leading slash from "/proxy" to "proxy".
554
+ reportTrigger(isMiddlewareFile(routePage) ? routePage.slice(1) : routePage, url);
554
555
  }
555
556
  if (entriesThatShouldBeInvalidated.length > 0) {
556
557
  const invalidatePromise = Promise.all(entriesThatShouldBeInvalidated.map(([compilerKey, { entryKey }])=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/server/dev/on-demand-entry-handler.ts"],"sourcesContent":["import type ws from 'next/dist/compiled/ws'\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport type { NextConfigComplete } from '../config-shared'\nimport type {\n DynamicParamTypesShort,\n FlightRouterState,\n FlightSegmentPath,\n} from '../../shared/lib/app-router-types'\nimport type { CompilerNameValues } from '../../shared/lib/constants'\nimport type { RouteDefinition } from '../route-definitions/route-definition'\nimport type HotReloaderWebpack from './hot-reloader-webpack'\n\nimport createDebug from 'next/dist/compiled/debug'\nimport { EventEmitter } from 'events'\nimport { findPageFile } from '../lib/find-page-file'\nimport { runDependingOnPageType } from '../../build/entries'\nimport { getStaticInfoIncludingLayouts } from '../../build/get-static-info-including-layouts'\nimport { join, posix } from 'path'\nimport { normalizePathSep } from '../../shared/lib/page-path/normalize-path-sep'\nimport { normalizePagePath } from '../../shared/lib/page-path/normalize-page-path'\nimport { ensureLeadingSlash } from '../../shared/lib/page-path/ensure-leading-slash'\nimport { removePagePathTail } from '../../shared/lib/page-path/remove-page-path-tail'\nimport { reportTrigger } from '../../build/output'\nimport getRouteFromEntrypoint from '../get-route-from-entrypoint'\nimport {\n isInstrumentationHookFile,\n isInstrumentationHookFilename,\n isMiddlewareFile,\n isMiddlewareFilename,\n} from '../../build/utils'\nimport { PageNotFoundError, stringifyError } from '../../shared/lib/utils'\nimport {\n COMPILER_INDEXES,\n COMPILER_NAMES,\n RSC_MODULE_TYPES,\n UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n} from '../../shared/lib/constants'\nimport { PAGE_SEGMENT_KEY } from '../../shared/lib/segment'\nimport {\n HMR_MESSAGE_SENT_TO_BROWSER,\n HMR_MESSAGE_SENT_TO_SERVER,\n} from './hot-reloader-types'\nimport { isAppPageRouteDefinition } from '../route-definitions/app-page-route-definition'\nimport { scheduleOnNextTick } from '../../lib/scheduler'\nimport { Batcher } from '../../lib/batcher'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { PAGE_TYPES } from '../../lib/page-types'\nimport { getNextFlightSegmentPath } from '../../client/flight-data-helpers'\nimport { handleErrorStateResponse } from '../mcp/tools/get-errors'\nimport { handlePageMetadataResponse } from '../mcp/tools/get-page-metadata'\n\nconst debug = createDebug('next:on-demand-entry-handler')\n\n/**\n * Returns object keys with type inferred from the object key\n */\nconst keys = Object.keys as <T>(o: T) => Extract<keyof T, string>[]\n\nconst COMPILER_KEYS = keys(COMPILER_INDEXES)\n\nfunction treePathToEntrypoint(\n segmentPath: FlightSegmentPath,\n parentPath?: string\n): string {\n const [parallelRouteKey, segment] = segmentPath\n\n // TODO-APP: modify this path to cover parallelRouteKey convention\n const path =\n (parentPath ? parentPath + '/' : '') +\n (parallelRouteKey !== 'children' && !segment.startsWith('@')\n ? `@${parallelRouteKey}/`\n : '') +\n (segment === '' ? 'page' : segment)\n\n // Last segment\n if (segmentPath.length === 2) {\n return path\n }\n\n const childSegmentPath = getNextFlightSegmentPath(segmentPath)\n return treePathToEntrypoint(childSegmentPath, path)\n}\n\nfunction convertDynamicParamTypeToSyntax(\n dynamicParamTypeShort: DynamicParamTypesShort,\n param: string\n) {\n switch (dynamicParamTypeShort) {\n case 'c':\n case 'ci':\n return `[...${param}]`\n case 'oc':\n return `[[...${param}]]`\n case 'd':\n case 'di':\n return `[${param}]`\n default:\n throw new Error('Unknown dynamic param type')\n }\n}\n\n/**\n * format: {compiler type}@{page type}@{page path}\n * e.g. client@pages@/index\n * e.g. server@app@app/page\n *\n * This guarantees the uniqueness for each page, to avoid conflicts between app/ and pages/\n */\n\nexport function getEntryKey(\n compilerType: CompilerNameValues,\n pageBundleType: PAGE_TYPES,\n page: string\n) {\n // TODO: handle the /children slot better\n // this is a quick hack to handle when children is provided as children/page instead of /page\n const pageKey = page.replace(/(@[^/]+)\\/children/g, '$1')\n return `${compilerType}@${pageBundleType}@${pageKey}`\n}\n\nfunction getPageBundleType(pageBundlePath: string): PAGE_TYPES {\n // Handle special case for /_error\n if (pageBundlePath === '/_error') return PAGE_TYPES.PAGES\n if (isMiddlewareFilename(pageBundlePath)) return PAGE_TYPES.ROOT\n return pageBundlePath.startsWith('pages/')\n ? PAGE_TYPES.PAGES\n : pageBundlePath.startsWith('app/')\n ? PAGE_TYPES.APP\n : PAGE_TYPES.ROOT\n}\n\nfunction getEntrypointsFromTree(\n tree: FlightRouterState,\n isFirst: boolean,\n parentPath: string[] = []\n) {\n const [segment, parallelRoutes] = tree\n\n const currentSegment = Array.isArray(segment)\n ? convertDynamicParamTypeToSyntax(segment[2], segment[0])\n : segment\n\n const isPageSegment = currentSegment.startsWith(PAGE_SEGMENT_KEY)\n\n const currentPath = [...parentPath, isPageSegment ? '' : currentSegment]\n\n if (!isFirst && isPageSegment) {\n // TODO get rid of '' at the start of tree\n return [treePathToEntrypoint(currentPath.slice(1))]\n }\n\n return Object.keys(parallelRoutes).reduce(\n (paths: string[], key: string): string[] => {\n const childTree = parallelRoutes[key]\n const childPages = getEntrypointsFromTree(childTree, false, [\n ...currentPath,\n key,\n ])\n return [...paths, ...childPages]\n },\n []\n )\n}\n\nexport const ADDED = Symbol('added')\nexport const BUILDING = Symbol('building')\nexport const BUILT = Symbol('built')\n\ninterface EntryType {\n /**\n * Tells if a page is scheduled to be disposed.\n */\n dispose?: boolean\n /**\n * Timestamp with the last time the page was active.\n */\n lastActiveTime?: number\n /**\n * Page build status.\n */\n status?: typeof ADDED | typeof BUILDING | typeof BUILT\n\n /**\n * Path to the page file relative to the dist folder with no extension.\n * For example: `pages/about/index`\n */\n bundlePath: string\n\n /**\n * Webpack request to create a dependency for.\n */\n request: string\n}\n\n// Shadowing check in ESLint does not account for enum\n// eslint-disable-next-line no-shadow\nexport const enum EntryTypes {\n ENTRY,\n CHILD_ENTRY,\n}\ninterface Entry extends EntryType {\n type: EntryTypes.ENTRY\n /**\n * The absolute page to the page file. Used for detecting if the file was removed. For example:\n * `/Users/Rick/project/pages/about/index.js`\n */\n absolutePagePath: string\n /**\n * All parallel pages that match the same entry, for example:\n * ['/parallel/@bar/nested/@a/page', '/parallel/@bar/nested/@b/page', '/parallel/@foo/nested/@a/page', '/parallel/@foo/nested/@b/page']\n */\n appPaths: ReadonlyArray<string> | null\n}\n\ninterface ChildEntry extends EntryType {\n type: EntryTypes.CHILD_ENTRY\n /**\n * Which parent entries use this childEntry.\n */\n parentEntries: Set<string>\n /**\n * The absolute page to the entry file. Used for detecting if the file was removed. For example:\n * `/Users/Rick/project/app/about/layout.js`\n */\n absoluteEntryFilePath?: string\n}\n\nconst entriesMap: Map<\n string,\n {\n /**\n * The key composed of the compiler name and the page. For example:\n * `edge-server/about`\n */\n [entryName: string]: Entry | ChildEntry\n }\n> = new Map()\n\n// remove /server from end of output for server compiler\nconst normalizeOutputPath = (dir: string) => dir.replace(/[/\\\\]server$/, '')\n\nexport const getEntries = (\n dir: string\n): NonNullable<ReturnType<(typeof entriesMap)['get']>> => {\n dir = normalizeOutputPath(dir)\n const entries = entriesMap.get(dir) || {}\n entriesMap.set(dir, entries)\n return entries\n}\n\nconst invalidators: Map<string, Invalidator> = new Map()\n\nexport const getInvalidator = (dir: string) => {\n dir = normalizeOutputPath(dir)\n return invalidators.get(dir)\n}\n\nconst doneCallbacks: EventEmitter = new EventEmitter()\nconst lastClientAccessPages = ['']\nconst lastServerAccessPagesForAppDir = ['']\n\ntype BuildingTracker = Set<CompilerNameValues>\ntype RebuildTracker = Set<CompilerNameValues>\n\n// Make sure only one invalidation happens at a time\n// Otherwise, webpack hash gets changed and it'll force the client to reload.\nclass Invalidator {\n private multiCompiler: webpack.MultiCompiler\n\n private building: BuildingTracker = new Set()\n private rebuildAgain: RebuildTracker = new Set()\n\n constructor(multiCompiler: webpack.MultiCompiler) {\n this.multiCompiler = multiCompiler\n }\n\n public shouldRebuildAll() {\n return this.rebuildAgain.size > 0\n }\n\n invalidate(compilerKeys: typeof COMPILER_KEYS = COMPILER_KEYS): void {\n for (const key of compilerKeys) {\n // If there's a current build is processing, we won't abort it by invalidating.\n // (If aborted, it'll cause a client side hard reload)\n // But let it to invalidate just after the completion.\n // So, it can re-build the queued pages at once.\n\n if (this.building.has(key)) {\n this.rebuildAgain.add(key)\n continue\n }\n\n this.building.add(key)\n this.multiCompiler.compilers[COMPILER_INDEXES[key]].watching?.invalidate()\n }\n }\n\n public startBuilding(compilerKey: keyof typeof COMPILER_INDEXES) {\n this.building.add(compilerKey)\n }\n\n public doneBuilding(compilerKeys: typeof COMPILER_KEYS = []) {\n const rebuild: typeof COMPILER_KEYS = []\n for (const key of compilerKeys) {\n this.building.delete(key)\n\n if (this.rebuildAgain.has(key)) {\n rebuild.push(key)\n this.rebuildAgain.delete(key)\n }\n }\n\n if (rebuild.length > 0) {\n this.invalidate(rebuild)\n }\n }\n\n public willRebuild(compilerKey: keyof typeof COMPILER_INDEXES) {\n return this.rebuildAgain.has(compilerKey)\n }\n}\n\nfunction disposeInactiveEntries(\n entries: NonNullable<ReturnType<(typeof entriesMap)['get']>>,\n maxInactiveAge: number\n) {\n Object.keys(entries).forEach((entryKey) => {\n const entryData = entries[entryKey]\n const { lastActiveTime, status, dispose, bundlePath } = entryData\n\n // TODO-APP: implement disposing of CHILD_ENTRY\n if (entryData.type === EntryTypes.CHILD_ENTRY) {\n return\n }\n\n // For the root middleware and the instrumentation hook files,\n // we don't dispose them periodically as it's needed for every request.\n if (\n isMiddlewareFilename(bundlePath) ||\n isInstrumentationHookFilename(bundlePath)\n ) {\n return\n }\n\n if (dispose)\n // Skip pages already scheduled for disposing\n return\n\n // This means this entry is currently building or just added\n // We don't need to dispose those entries.\n if (status !== BUILT) return\n\n // We should not build the last accessed page even we didn't get any pings\n // Sometimes, it's possible our XHR ping to wait before completing other requests.\n // In that case, we should not dispose the current viewing page\n if (\n lastClientAccessPages.includes(entryKey) ||\n lastServerAccessPagesForAppDir.includes(entryKey)\n )\n return\n\n if (lastActiveTime && Date.now() - lastActiveTime > maxInactiveAge) {\n entries[entryKey].dispose = true\n }\n })\n}\n\n// Normalize both app paths and page paths\nfunction tryToNormalizePagePath(page: string) {\n try {\n return normalizePagePath(page)\n } catch (err) {\n console.error(err)\n throw new PageNotFoundError(page)\n }\n}\n\ninterface PagePathData {\n filename: string\n bundlePath: string\n page: string\n}\n\n/**\n * Attempts to find a page file path from the given pages absolute directory,\n * a page and allowed extensions. If the page can't be found it will throw an\n * error. It defaults the `/_error` page to Next.js internal error page.\n *\n * @param rootDir Absolute path to the project root.\n * @param page The page normalized (it will be denormalized).\n * @param extensions Array of page extensions.\n * @param pagesDir Absolute path to the pages folder with trailing `/pages`.\n * @param appDir Absolute path to the app folder with trailing `/app`.\n */\nexport async function findPagePathData(\n rootDir: string,\n page: string,\n extensions: string[],\n pagesDir: string | undefined,\n appDir: string | undefined,\n isGlobalNotFoundEnabled: boolean\n): Promise<PagePathData> {\n const normalizedPagePath = tryToNormalizePagePath(page)\n let pagePath: string | null = null\n\n const isInstrumentation = isInstrumentationHookFile(normalizedPagePath)\n if (isMiddlewareFile(normalizedPagePath) || isInstrumentation) {\n pagePath = await findPageFile(\n rootDir,\n normalizedPagePath,\n extensions,\n false\n )\n\n if (!pagePath) {\n throw new PageNotFoundError(normalizedPagePath)\n }\n\n const pageUrl = ensureLeadingSlash(\n removePagePathTail(normalizePathSep(pagePath), {\n extensions,\n })\n )\n\n let bundlePath = normalizedPagePath\n let pageKey = posix.normalize(pageUrl)\n\n if (isInstrumentation || isMiddlewareFile(normalizedPagePath)) {\n bundlePath = bundlePath.replace('/src', '')\n pageKey = page.replace('/src', '')\n }\n\n return {\n filename: join(rootDir, pagePath),\n bundlePath: bundlePath.slice(1),\n page: pageKey,\n }\n }\n\n // Check appDir first falling back to pagesDir\n if (appDir) {\n if (page === UNDERSCORE_NOT_FOUND_ROUTE_ENTRY) {\n // Load `global-not-found` when global-not-found is enabled.\n // Prefer to load it when both `global-not-found` and root `not-found` present.\n if (isGlobalNotFoundEnabled) {\n const globalNotFoundPath = await findPageFile(\n appDir,\n 'global-not-found',\n extensions,\n true\n )\n if (globalNotFoundPath) {\n return {\n filename: join(appDir, globalNotFoundPath),\n bundlePath: `app${UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}`,\n page: UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n }\n }\n } else {\n // Then if global-not-found.js doesn't exist then load not-found.js\n const notFoundPath = await findPageFile(\n appDir,\n 'not-found',\n extensions,\n true\n )\n if (notFoundPath) {\n return {\n filename: join(appDir, notFoundPath),\n bundlePath: `app${UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}`,\n page: UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n }\n }\n }\n\n // If they're not presented, then fallback to global-not-found\n return {\n filename: require.resolve(\n 'next/dist/client/components/builtin/global-not-found'\n ),\n bundlePath: `app${UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}`,\n page: UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n }\n }\n pagePath = await findPageFile(appDir, normalizedPagePath, extensions, true)\n if (pagePath) {\n const pageUrl = ensureLeadingSlash(\n removePagePathTail(normalizePathSep(pagePath), {\n keepIndex: true,\n extensions,\n })\n )\n\n return {\n filename: join(appDir, pagePath),\n bundlePath: posix.join('app', pageUrl),\n page: posix.normalize(pageUrl),\n }\n }\n }\n\n if (!pagePath && pagesDir) {\n pagePath = await findPageFile(\n pagesDir,\n normalizedPagePath,\n extensions,\n false\n )\n }\n\n if (pagePath !== null && pagesDir) {\n const pageUrl = ensureLeadingSlash(\n removePagePathTail(normalizePathSep(pagePath), {\n extensions,\n })\n )\n\n return {\n filename: join(pagesDir, pagePath),\n bundlePath: posix.join('pages', normalizePagePath(pageUrl)),\n page: posix.normalize(pageUrl),\n }\n }\n\n if (page === '/_error') {\n return {\n filename: require.resolve('next/dist/pages/_error'),\n bundlePath: page,\n page: normalizePathSep(page),\n }\n } else {\n throw new PageNotFoundError(normalizedPagePath)\n }\n}\n\nexport function onDemandEntryHandler({\n hotReloader,\n maxInactiveAge,\n multiCompiler,\n nextConfig,\n pagesBufferLength,\n pagesDir,\n rootDir,\n appDir,\n}: {\n hotReloader: HotReloaderWebpack\n maxInactiveAge: number\n multiCompiler: webpack.MultiCompiler\n nextConfig: NextConfigComplete\n pagesBufferLength: number\n pagesDir?: string\n rootDir: string\n appDir?: string\n}) {\n const hasAppDir = !!appDir\n let curInvalidator: Invalidator = getInvalidator(\n multiCompiler.outputPath\n ) as any\n const curEntries = getEntries(multiCompiler.outputPath) as any\n\n if (!curInvalidator) {\n curInvalidator = new Invalidator(multiCompiler)\n invalidators.set(multiCompiler.outputPath, curInvalidator)\n }\n\n const startBuilding = (compilation: webpack.Compilation) => {\n const compilationName = compilation.name as any as CompilerNameValues\n curInvalidator.startBuilding(compilationName)\n }\n for (const compiler of multiCompiler.compilers) {\n compiler.hooks.make.tap('NextJsOnDemandEntries', startBuilding)\n }\n\n function getPagePathsFromEntrypoints(\n type: CompilerNameValues,\n entrypoints: Map<string, { name?: string | null }>\n ) {\n const pagePaths: string[] = []\n for (const entrypoint of entrypoints.values()) {\n const page = getRouteFromEntrypoint(entrypoint.name!, hasAppDir)\n\n if (page) {\n const pageBundleType = entrypoint.name?.startsWith('app/')\n ? PAGE_TYPES.APP\n : PAGE_TYPES.PAGES\n pagePaths.push(getEntryKey(type, pageBundleType, page))\n } else if (\n isMiddlewareFilename(entrypoint.name) ||\n isInstrumentationHookFilename(entrypoint.name)\n ) {\n pagePaths.push(\n getEntryKey(type, PAGE_TYPES.ROOT, `/${entrypoint.name}`)\n )\n }\n }\n return pagePaths\n }\n\n for (const compiler of multiCompiler.compilers) {\n compiler.hooks.done.tap('NextJsOnDemandEntries', () =>\n getInvalidator(compiler.outputPath)?.doneBuilding([\n compiler.name as keyof typeof COMPILER_INDEXES,\n ])\n )\n }\n\n multiCompiler.hooks.done.tap('NextJsOnDemandEntries', (multiStats) => {\n const [clientStats, serverStats, edgeServerStats] = multiStats.stats\n const entryNames = [\n ...getPagePathsFromEntrypoints(\n COMPILER_NAMES.client,\n clientStats.compilation.entrypoints\n ),\n ...getPagePathsFromEntrypoints(\n COMPILER_NAMES.server,\n serverStats.compilation.entrypoints\n ),\n ...(edgeServerStats\n ? getPagePathsFromEntrypoints(\n COMPILER_NAMES.edgeServer,\n edgeServerStats.compilation.entrypoints\n )\n : []),\n ]\n\n for (const name of entryNames) {\n const entry = curEntries[name]\n if (!entry) {\n continue\n }\n\n if (entry.status !== BUILDING) {\n continue\n }\n\n entry.status = BUILT\n doneCallbacks.emit(name)\n }\n\n getInvalidator(multiCompiler.outputPath)?.doneBuilding([...COMPILER_KEYS])\n })\n\n const pingIntervalTime = Math.max(1000, Math.min(5000, maxInactiveAge))\n\n setInterval(function () {\n disposeInactiveEntries(curEntries, maxInactiveAge)\n }, pingIntervalTime + 1000).unref()\n\n function handleAppDirPing(tree: FlightRouterState): void {\n const pages = getEntrypointsFromTree(tree, true)\n\n for (const page of pages) {\n for (const compilerType of [\n COMPILER_NAMES.client,\n COMPILER_NAMES.server,\n COMPILER_NAMES.edgeServer,\n ]) {\n const entryKey = getEntryKey(compilerType, PAGE_TYPES.APP, `/${page}`)\n const entryInfo = curEntries[entryKey]\n\n // If there's no entry, it may have been invalidated and needs to be re-built.\n if (!entryInfo) {\n // if (page !== lastEntry) client pings, but there's no entry for page\n continue\n }\n\n // We don't need to maintain active state of anything other than BUILT entries\n if (entryInfo.status !== BUILT) continue\n\n // If there's an entryInfo\n if (!lastServerAccessPagesForAppDir.includes(entryKey)) {\n lastServerAccessPagesForAppDir.unshift(entryKey)\n\n // Maintain the buffer max length\n // TODO: verify that the current pageKey is not at the end of the array as multiple entrypoints can exist\n if (lastServerAccessPagesForAppDir.length > pagesBufferLength) {\n lastServerAccessPagesForAppDir.pop()\n }\n }\n entryInfo.lastActiveTime = Date.now()\n entryInfo.dispose = false\n }\n }\n }\n\n function handlePing(pg: string): void {\n const page = normalizePathSep(pg)\n for (const compilerType of [\n COMPILER_NAMES.client,\n COMPILER_NAMES.server,\n COMPILER_NAMES.edgeServer,\n ]) {\n const entryKey = getEntryKey(compilerType, PAGE_TYPES.PAGES, page)\n const entryInfo = curEntries[entryKey]\n\n // If there's no entry, it may have been invalidated and needs to be re-built.\n if (!entryInfo) {\n // if (page !== lastEntry) client pings, but there's no entry for page\n if (compilerType === COMPILER_NAMES.client) {\n return\n }\n continue\n }\n\n // We don't need to maintain active state of anything other than BUILT entries\n if (entryInfo.status !== BUILT) continue\n\n // If there's an entryInfo\n if (!lastClientAccessPages.includes(entryKey)) {\n lastClientAccessPages.unshift(entryKey)\n\n // Maintain the buffer max length\n if (lastClientAccessPages.length > pagesBufferLength) {\n lastClientAccessPages.pop()\n }\n }\n entryInfo.lastActiveTime = Date.now()\n entryInfo.dispose = false\n }\n return\n }\n\n async function ensurePageImpl({\n page,\n appPaths,\n definition,\n isApp,\n url,\n }: {\n page: string\n appPaths: ReadonlyArray<string> | null\n definition: RouteDefinition | undefined\n isApp: boolean | undefined\n url?: string\n }): Promise<void> {\n const stalledTime = 60\n const stalledEnsureTimeout = setTimeout(() => {\n debug(\n `Ensuring ${page} has taken longer than ${stalledTime}s, if this continues to stall this may be a bug`\n )\n }, stalledTime * 1000)\n\n try {\n let route: Pick<RouteDefinition, 'filename' | 'bundlePath' | 'page'>\n if (definition) {\n route = definition\n } else {\n route = await findPagePathData(\n rootDir,\n page,\n nextConfig.pageExtensions,\n pagesDir,\n appDir,\n !!nextConfig.experimental.globalNotFound\n )\n }\n\n const isInsideAppDir = !!appDir && route.filename.startsWith(appDir)\n\n if (typeof isApp === 'boolean' && isApp !== isInsideAppDir) {\n Error.stackTraceLimit = 15\n throw new Error(\n `Ensure bailed, found path \"${\n route.page\n }\" does not match ensure type (${isApp ? 'app' : 'pages'})`\n )\n }\n\n const pageBundleType = getPageBundleType(route.bundlePath)\n const addEntry = (\n compilerType: CompilerNameValues\n ): {\n entryKey: string\n newEntry: boolean\n shouldInvalidate: boolean\n } => {\n const entryKey = getEntryKey(compilerType, pageBundleType, route.page)\n if (\n curEntries[entryKey] &&\n // there can be an overlap in the entryKey for the instrumentation hook file and a page named the same\n // this is a quick fix to support this scenario by overwriting the instrumentation hook entry, since we only use it one time\n // any changes to the instrumentation hook file will require a restart of the dev server anyway\n !isInstrumentationHookFilename(curEntries[entryKey].bundlePath)\n ) {\n curEntries[entryKey].dispose = false\n curEntries[entryKey].lastActiveTime = Date.now()\n if (curEntries[entryKey].status === BUILT) {\n return {\n entryKey,\n newEntry: false,\n shouldInvalidate: false,\n }\n }\n\n return {\n entryKey,\n newEntry: false,\n shouldInvalidate: true,\n }\n }\n\n curEntries[entryKey] = {\n type: EntryTypes.ENTRY,\n appPaths,\n absolutePagePath: route.filename,\n request: route.filename,\n bundlePath: route.bundlePath,\n dispose: false,\n lastActiveTime: Date.now(),\n status: ADDED,\n }\n return {\n entryKey: entryKey,\n newEntry: true,\n shouldInvalidate: true,\n }\n }\n\n const staticInfo = await getStaticInfoIncludingLayouts({\n page,\n pageFilePath: route.filename,\n isInsideAppDir,\n pageExtensions: nextConfig.pageExtensions,\n isDev: true,\n config: nextConfig,\n appDir,\n })\n\n const added = new Map<CompilerNameValues, ReturnType<typeof addEntry>>()\n const isServerComponent =\n isInsideAppDir && staticInfo.rsc !== RSC_MODULE_TYPES.client\n\n let pageRuntime = staticInfo.runtime\n\n runDependingOnPageType({\n page: route.page,\n pageRuntime,\n pageType: pageBundleType,\n onClient: () => {\n // Skip adding the client entry for app / Server Components.\n if (isServerComponent || isInsideAppDir) {\n return\n }\n added.set(COMPILER_NAMES.client, addEntry(COMPILER_NAMES.client))\n },\n onServer: () => {\n added.set(COMPILER_NAMES.server, addEntry(COMPILER_NAMES.server))\n const edgeServerEntry = getEntryKey(\n COMPILER_NAMES.edgeServer,\n pageBundleType,\n route.page\n )\n if (\n curEntries[edgeServerEntry] &&\n !isInstrumentationHookFile(route.page)\n ) {\n // Runtime switched from edge to server\n delete curEntries[edgeServerEntry]\n }\n },\n onEdgeServer: () => {\n added.set(\n COMPILER_NAMES.edgeServer,\n addEntry(COMPILER_NAMES.edgeServer)\n )\n const serverEntry = getEntryKey(\n COMPILER_NAMES.server,\n pageBundleType,\n route.page\n )\n if (\n curEntries[serverEntry] &&\n !isInstrumentationHookFile(route.page)\n ) {\n // Runtime switched from server to edge\n delete curEntries[serverEntry]\n }\n },\n })\n\n const addedValues = [...added.values()]\n const entriesThatShouldBeInvalidated = [...added.entries()].filter(\n ([, entry]) => entry.shouldInvalidate\n )\n const hasNewEntry = addedValues.some((entry) => entry.newEntry)\n\n if (hasNewEntry) {\n const routePage = isApp ? route.page : normalizeAppPath(route.page)\n reportTrigger(routePage, url)\n }\n\n if (entriesThatShouldBeInvalidated.length > 0) {\n const invalidatePromise = Promise.all(\n entriesThatShouldBeInvalidated.map(([compilerKey, { entryKey }]) => {\n return new Promise<void>((resolve, reject) => {\n doneCallbacks.once(entryKey, (err: Error) => {\n if (err) {\n return reject(err)\n }\n\n // If the invalidation also triggers a rebuild, we need to\n // wait for that additional build to prevent race conditions.\n const needsRebuild = curInvalidator.willRebuild(compilerKey)\n if (needsRebuild) {\n doneCallbacks.once(entryKey, (rebuildErr: Error) => {\n if (rebuildErr) {\n return reject(rebuildErr)\n }\n resolve()\n })\n } else {\n resolve()\n }\n })\n })\n })\n )\n\n curInvalidator.invalidate([...added.keys()])\n await invalidatePromise\n }\n } finally {\n clearTimeout(stalledEnsureTimeout)\n }\n }\n\n type EnsurePageOptions = {\n page: string\n appPaths?: ReadonlyArray<string> | null\n definition?: RouteDefinition\n isApp?: boolean\n url?: string\n }\n\n // Make sure that we won't have multiple invalidations ongoing concurrently.\n const batcher = Batcher.create<EnsurePageOptions, void, string>({\n // The cache key here is composed of the elements that affect the\n // compilation, namely, the page, whether it's client only, and whether\n // it's an app page. This ensures that we don't have multiple compilations\n // for the same page happening concurrently.\n //\n // We don't include the whole match because it contains match specific\n // parameters (like route params) that would just bust this cache. Any\n // details that would possibly bust the cache should be listed here.\n cacheKeyFn: (options) => JSON.stringify(options),\n // Schedule the invocation of the ensurePageImpl function on the next tick.\n schedulerFn: scheduleOnNextTick,\n })\n\n return {\n async ensurePage({\n page,\n appPaths = null,\n definition,\n isApp,\n url,\n }: EnsurePageOptions) {\n // If the route is actually an app page route, then we should have access\n // to the app route definition, and therefore, the appPaths from it.\n if (!appPaths && definition && isAppPageRouteDefinition(definition)) {\n appPaths = definition.appPaths\n }\n\n // Wrap the invocation of the ensurePageImpl function in the pending\n // wrapper, which will ensure that we don't have multiple compilations\n // for the same page happening concurrently.\n return batcher.batch({ page, appPaths, definition, isApp }, async () => {\n await ensurePageImpl({\n page,\n appPaths,\n definition,\n isApp,\n url,\n })\n })\n },\n onHMR(client: ws, getHmrServerError: () => Error | null) {\n let bufferedHmrServerError: Error | null = null\n\n client.addEventListener('close', () => {\n bufferedHmrServerError = null\n })\n client.addEventListener('message', ({ data }) => {\n try {\n const error = getHmrServerError()\n\n // New error occurred: buffered error is flushed and new error occurred\n if (!bufferedHmrServerError && error) {\n hotReloader.send({\n type: HMR_MESSAGE_SENT_TO_BROWSER.SERVER_ERROR,\n errorJSON: stringifyError(error),\n })\n bufferedHmrServerError = null\n }\n\n const parsedData = JSON.parse(\n typeof data !== 'string' ? data.toString() : data\n )\n\n if (parsedData.event === HMR_MESSAGE_SENT_TO_SERVER.PING) {\n if (parsedData.appDirRoute) {\n handleAppDirPing(parsedData.tree)\n } else {\n handlePing(parsedData.page)\n }\n } else if (\n parsedData.event ===\n HMR_MESSAGE_SENT_TO_SERVER.MCP_ERROR_STATE_RESPONSE\n ) {\n handleErrorStateResponse(\n parsedData.requestId,\n parsedData.errorState,\n parsedData.url\n )\n } else if (\n parsedData.event ===\n HMR_MESSAGE_SENT_TO_SERVER.MCP_PAGE_METADATA_RESPONSE\n ) {\n handlePageMetadataResponse(\n parsedData.requestId,\n parsedData.segmentTrieData,\n parsedData.url\n )\n }\n } catch {}\n })\n },\n }\n}\n"],"names":["createDebug","EventEmitter","findPageFile","runDependingOnPageType","getStaticInfoIncludingLayouts","join","posix","normalizePathSep","normalizePagePath","ensureLeadingSlash","removePagePathTail","reportTrigger","getRouteFromEntrypoint","isInstrumentationHookFile","isInstrumentationHookFilename","isMiddlewareFile","isMiddlewareFilename","PageNotFoundError","stringifyError","COMPILER_INDEXES","COMPILER_NAMES","RSC_MODULE_TYPES","UNDERSCORE_NOT_FOUND_ROUTE_ENTRY","PAGE_SEGMENT_KEY","HMR_MESSAGE_SENT_TO_BROWSER","HMR_MESSAGE_SENT_TO_SERVER","isAppPageRouteDefinition","scheduleOnNextTick","Batcher","normalizeAppPath","PAGE_TYPES","getNextFlightSegmentPath","handleErrorStateResponse","handlePageMetadataResponse","debug","keys","Object","COMPILER_KEYS","treePathToEntrypoint","segmentPath","parentPath","parallelRouteKey","segment","path","startsWith","length","childSegmentPath","convertDynamicParamTypeToSyntax","dynamicParamTypeShort","param","Error","getEntryKey","compilerType","pageBundleType","page","pageKey","replace","getPageBundleType","pageBundlePath","PAGES","ROOT","APP","getEntrypointsFromTree","tree","isFirst","parallelRoutes","currentSegment","Array","isArray","isPageSegment","currentPath","slice","reduce","paths","key","childTree","childPages","ADDED","Symbol","BUILDING","BUILT","EntryTypes","entriesMap","Map","normalizeOutputPath","dir","getEntries","entries","get","set","invalidators","getInvalidator","doneCallbacks","lastClientAccessPages","lastServerAccessPagesForAppDir","Invalidator","constructor","multiCompiler","building","Set","rebuildAgain","shouldRebuildAll","size","invalidate","compilerKeys","has","add","compilers","watching","startBuilding","compilerKey","doneBuilding","rebuild","delete","push","willRebuild","disposeInactiveEntries","maxInactiveAge","forEach","entryKey","entryData","lastActiveTime","status","dispose","bundlePath","type","includes","Date","now","tryToNormalizePagePath","err","console","error","findPagePathData","rootDir","extensions","pagesDir","appDir","isGlobalNotFoundEnabled","normalizedPagePath","pagePath","isInstrumentation","pageUrl","normalize","filename","globalNotFoundPath","notFoundPath","require","resolve","keepIndex","onDemandEntryHandler","hotReloader","nextConfig","pagesBufferLength","hasAppDir","curInvalidator","outputPath","curEntries","compilation","compilationName","name","compiler","hooks","make","tap","getPagePathsFromEntrypoints","entrypoints","pagePaths","entrypoint","values","done","multiStats","clientStats","serverStats","edgeServerStats","stats","entryNames","client","server","edgeServer","entry","emit","pingIntervalTime","Math","max","min","setInterval","unref","handleAppDirPing","pages","entryInfo","unshift","pop","handlePing","pg","ensurePageImpl","appPaths","definition","isApp","url","stalledTime","stalledEnsureTimeout","setTimeout","route","pageExtensions","experimental","globalNotFound","isInsideAppDir","stackTraceLimit","addEntry","newEntry","shouldInvalidate","absolutePagePath","request","staticInfo","pageFilePath","isDev","config","added","isServerComponent","rsc","pageRuntime","runtime","pageType","onClient","onServer","edgeServerEntry","onEdgeServer","serverEntry","addedValues","entriesThatShouldBeInvalidated","filter","hasNewEntry","some","routePage","invalidatePromise","Promise","all","map","reject","once","needsRebuild","rebuildErr","clearTimeout","batcher","create","cacheKeyFn","options","JSON","stringify","schedulerFn","ensurePage","batch","onHMR","getHmrServerError","bufferedHmrServerError","addEventListener","data","send","SERVER_ERROR","errorJSON","parsedData","parse","toString","event","PING","appDirRoute","MCP_ERROR_STATE_RESPONSE","requestId","errorState","MCP_PAGE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KAChB/O,2BAA2BkP,wBAAwB,EACnD;wBACA3O,yBACEqO,WAAWO,SAAS,EACpBP,WAAWQ,UAAU,EACrBR,WAAW9D,GAAG;oBAElB,OAAO,IACL8D,WAAWG,KAAK,KAChB/O,2BAA2BqP,0BAA0B,EACrD;wBACA7O,2BACEoO,WAAWO,SAAS,EACpBP,WAAWU,eAAe,EAC1BV,WAAW9D,GAAG;oBAElB;gBACF,EAAE,OAAM,CAAC;YACX;QACF;IACF;AACF","ignoreList":[0]}
1
+ {"version":3,"sources":["../../../src/server/dev/on-demand-entry-handler.ts"],"sourcesContent":["import type ws from 'next/dist/compiled/ws'\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport type { NextConfigComplete } from '../config-shared'\nimport type {\n DynamicParamTypesShort,\n FlightRouterState,\n FlightSegmentPath,\n} from '../../shared/lib/app-router-types'\nimport type { CompilerNameValues } from '../../shared/lib/constants'\nimport type { RouteDefinition } from '../route-definitions/route-definition'\nimport type HotReloaderWebpack from './hot-reloader-webpack'\n\nimport createDebug from 'next/dist/compiled/debug'\nimport { EventEmitter } from 'events'\nimport { findPageFile } from '../lib/find-page-file'\nimport { runDependingOnPageType } from '../../build/entries'\nimport { getStaticInfoIncludingLayouts } from '../../build/get-static-info-including-layouts'\nimport { join, posix } from 'path'\nimport { normalizePathSep } from '../../shared/lib/page-path/normalize-path-sep'\nimport { normalizePagePath } from '../../shared/lib/page-path/normalize-page-path'\nimport { ensureLeadingSlash } from '../../shared/lib/page-path/ensure-leading-slash'\nimport { removePagePathTail } from '../../shared/lib/page-path/remove-page-path-tail'\nimport { reportTrigger } from '../../build/output'\nimport getRouteFromEntrypoint from '../get-route-from-entrypoint'\nimport {\n isInstrumentationHookFile,\n isInstrumentationHookFilename,\n isMiddlewareFile,\n isMiddlewareFilename,\n} from '../../build/utils'\nimport { PageNotFoundError, stringifyError } from '../../shared/lib/utils'\nimport {\n COMPILER_INDEXES,\n COMPILER_NAMES,\n RSC_MODULE_TYPES,\n UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n} from '../../shared/lib/constants'\nimport { PAGE_SEGMENT_KEY } from '../../shared/lib/segment'\nimport {\n HMR_MESSAGE_SENT_TO_BROWSER,\n HMR_MESSAGE_SENT_TO_SERVER,\n} from './hot-reloader-types'\nimport { isAppPageRouteDefinition } from '../route-definitions/app-page-route-definition'\nimport { scheduleOnNextTick } from '../../lib/scheduler'\nimport { Batcher } from '../../lib/batcher'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { PAGE_TYPES } from '../../lib/page-types'\nimport { getNextFlightSegmentPath } from '../../client/flight-data-helpers'\nimport { handleErrorStateResponse } from '../mcp/tools/get-errors'\nimport { handlePageMetadataResponse } from '../mcp/tools/get-page-metadata'\n\nconst debug = createDebug('next:on-demand-entry-handler')\n\n/**\n * Returns object keys with type inferred from the object key\n */\nconst keys = Object.keys as <T>(o: T) => Extract<keyof T, string>[]\n\nconst COMPILER_KEYS = keys(COMPILER_INDEXES)\n\nfunction treePathToEntrypoint(\n segmentPath: FlightSegmentPath,\n parentPath?: string\n): string {\n const [parallelRouteKey, segment] = segmentPath\n\n // TODO-APP: modify this path to cover parallelRouteKey convention\n const path =\n (parentPath ? parentPath + '/' : '') +\n (parallelRouteKey !== 'children' && !segment.startsWith('@')\n ? `@${parallelRouteKey}/`\n : '') +\n (segment === '' ? 'page' : segment)\n\n // Last segment\n if (segmentPath.length === 2) {\n return path\n }\n\n const childSegmentPath = getNextFlightSegmentPath(segmentPath)\n return treePathToEntrypoint(childSegmentPath, path)\n}\n\nfunction convertDynamicParamTypeToSyntax(\n dynamicParamTypeShort: DynamicParamTypesShort,\n param: string\n) {\n switch (dynamicParamTypeShort) {\n case 'c':\n case 'ci':\n return `[...${param}]`\n case 'oc':\n return `[[...${param}]]`\n case 'd':\n case 'di':\n return `[${param}]`\n default:\n throw new Error('Unknown dynamic param type')\n }\n}\n\n/**\n * format: {compiler type}@{page type}@{page path}\n * e.g. client@pages@/index\n * e.g. server@app@app/page\n *\n * This guarantees the uniqueness for each page, to avoid conflicts between app/ and pages/\n */\n\nexport function getEntryKey(\n compilerType: CompilerNameValues,\n pageBundleType: PAGE_TYPES,\n page: string\n) {\n // TODO: handle the /children slot better\n // this is a quick hack to handle when children is provided as children/page instead of /page\n const pageKey = page.replace(/(@[^/]+)\\/children/g, '$1')\n return `${compilerType}@${pageBundleType}@${pageKey}`\n}\n\nfunction getPageBundleType(pageBundlePath: string): PAGE_TYPES {\n // Handle special case for /_error\n if (pageBundlePath === '/_error') return PAGE_TYPES.PAGES\n if (isMiddlewareFilename(pageBundlePath)) return PAGE_TYPES.ROOT\n return pageBundlePath.startsWith('pages/')\n ? PAGE_TYPES.PAGES\n : pageBundlePath.startsWith('app/')\n ? PAGE_TYPES.APP\n : PAGE_TYPES.ROOT\n}\n\nfunction getEntrypointsFromTree(\n tree: FlightRouterState,\n isFirst: boolean,\n parentPath: string[] = []\n) {\n const [segment, parallelRoutes] = tree\n\n const currentSegment = Array.isArray(segment)\n ? convertDynamicParamTypeToSyntax(segment[2], segment[0])\n : segment\n\n const isPageSegment = currentSegment.startsWith(PAGE_SEGMENT_KEY)\n\n const currentPath = [...parentPath, isPageSegment ? '' : currentSegment]\n\n if (!isFirst && isPageSegment) {\n // TODO get rid of '' at the start of tree\n return [treePathToEntrypoint(currentPath.slice(1))]\n }\n\n return Object.keys(parallelRoutes).reduce(\n (paths: string[], key: string): string[] => {\n const childTree = parallelRoutes[key]\n const childPages = getEntrypointsFromTree(childTree, false, [\n ...currentPath,\n key,\n ])\n return [...paths, ...childPages]\n },\n []\n )\n}\n\nexport const ADDED = Symbol('added')\nexport const BUILDING = Symbol('building')\nexport const BUILT = Symbol('built')\n\ninterface EntryType {\n /**\n * Tells if a page is scheduled to be disposed.\n */\n dispose?: boolean\n /**\n * Timestamp with the last time the page was active.\n */\n lastActiveTime?: number\n /**\n * Page build status.\n */\n status?: typeof ADDED | typeof BUILDING | typeof BUILT\n\n /**\n * Path to the page file relative to the dist folder with no extension.\n * For example: `pages/about/index`\n */\n bundlePath: string\n\n /**\n * Webpack request to create a dependency for.\n */\n request: string\n}\n\n// Shadowing check in ESLint does not account for enum\n// eslint-disable-next-line no-shadow\nexport const enum EntryTypes {\n ENTRY,\n CHILD_ENTRY,\n}\ninterface Entry extends EntryType {\n type: EntryTypes.ENTRY\n /**\n * The absolute page to the page file. Used for detecting if the file was removed. For example:\n * `/Users/Rick/project/pages/about/index.js`\n */\n absolutePagePath: string\n /**\n * All parallel pages that match the same entry, for example:\n * ['/parallel/@bar/nested/@a/page', '/parallel/@bar/nested/@b/page', '/parallel/@foo/nested/@a/page', '/parallel/@foo/nested/@b/page']\n */\n appPaths: ReadonlyArray<string> | null\n}\n\ninterface ChildEntry extends EntryType {\n type: EntryTypes.CHILD_ENTRY\n /**\n * Which parent entries use this childEntry.\n */\n parentEntries: Set<string>\n /**\n * The absolute page to the entry file. Used for detecting if the file was removed. For example:\n * `/Users/Rick/project/app/about/layout.js`\n */\n absoluteEntryFilePath?: string\n}\n\nconst entriesMap: Map<\n string,\n {\n /**\n * The key composed of the compiler name and the page. For example:\n * `edge-server/about`\n */\n [entryName: string]: Entry | ChildEntry\n }\n> = new Map()\n\n// remove /server from end of output for server compiler\nconst normalizeOutputPath = (dir: string) => dir.replace(/[/\\\\]server$/, '')\n\nexport const getEntries = (\n dir: string\n): NonNullable<ReturnType<(typeof entriesMap)['get']>> => {\n dir = normalizeOutputPath(dir)\n const entries = entriesMap.get(dir) || {}\n entriesMap.set(dir, entries)\n return entries\n}\n\nconst invalidators: Map<string, Invalidator> = new Map()\n\nexport const getInvalidator = (dir: string) => {\n dir = normalizeOutputPath(dir)\n return invalidators.get(dir)\n}\n\nconst doneCallbacks: EventEmitter = new EventEmitter()\nconst lastClientAccessPages = ['']\nconst lastServerAccessPagesForAppDir = ['']\n\ntype BuildingTracker = Set<CompilerNameValues>\ntype RebuildTracker = Set<CompilerNameValues>\n\n// Make sure only one invalidation happens at a time\n// Otherwise, webpack hash gets changed and it'll force the client to reload.\nclass Invalidator {\n private multiCompiler: webpack.MultiCompiler\n\n private building: BuildingTracker = new Set()\n private rebuildAgain: RebuildTracker = new Set()\n\n constructor(multiCompiler: webpack.MultiCompiler) {\n this.multiCompiler = multiCompiler\n }\n\n public shouldRebuildAll() {\n return this.rebuildAgain.size > 0\n }\n\n invalidate(compilerKeys: typeof COMPILER_KEYS = COMPILER_KEYS): void {\n for (const key of compilerKeys) {\n // If there's a current build is processing, we won't abort it by invalidating.\n // (If aborted, it'll cause a client side hard reload)\n // But let it to invalidate just after the completion.\n // So, it can re-build the queued pages at once.\n\n if (this.building.has(key)) {\n this.rebuildAgain.add(key)\n continue\n }\n\n this.building.add(key)\n this.multiCompiler.compilers[COMPILER_INDEXES[key]].watching?.invalidate()\n }\n }\n\n public startBuilding(compilerKey: keyof typeof COMPILER_INDEXES) {\n this.building.add(compilerKey)\n }\n\n public doneBuilding(compilerKeys: typeof COMPILER_KEYS = []) {\n const rebuild: typeof COMPILER_KEYS = []\n for (const key of compilerKeys) {\n this.building.delete(key)\n\n if (this.rebuildAgain.has(key)) {\n rebuild.push(key)\n this.rebuildAgain.delete(key)\n }\n }\n\n if (rebuild.length > 0) {\n this.invalidate(rebuild)\n }\n }\n\n public willRebuild(compilerKey: keyof typeof COMPILER_INDEXES) {\n return this.rebuildAgain.has(compilerKey)\n }\n}\n\nfunction disposeInactiveEntries(\n entries: NonNullable<ReturnType<(typeof entriesMap)['get']>>,\n maxInactiveAge: number\n) {\n Object.keys(entries).forEach((entryKey) => {\n const entryData = entries[entryKey]\n const { lastActiveTime, status, dispose, bundlePath } = entryData\n\n // TODO-APP: implement disposing of CHILD_ENTRY\n if (entryData.type === EntryTypes.CHILD_ENTRY) {\n return\n }\n\n // For the root middleware and the instrumentation hook files,\n // we don't dispose them periodically as it's needed for every request.\n if (\n isMiddlewareFilename(bundlePath) ||\n isInstrumentationHookFilename(bundlePath)\n ) {\n return\n }\n\n if (dispose)\n // Skip pages already scheduled for disposing\n return\n\n // This means this entry is currently building or just added\n // We don't need to dispose those entries.\n if (status !== BUILT) return\n\n // We should not build the last accessed page even we didn't get any pings\n // Sometimes, it's possible our XHR ping to wait before completing other requests.\n // In that case, we should not dispose the current viewing page\n if (\n lastClientAccessPages.includes(entryKey) ||\n lastServerAccessPagesForAppDir.includes(entryKey)\n )\n return\n\n if (lastActiveTime && Date.now() - lastActiveTime > maxInactiveAge) {\n entries[entryKey].dispose = true\n }\n })\n}\n\n// Normalize both app paths and page paths\nfunction tryToNormalizePagePath(page: string) {\n try {\n return normalizePagePath(page)\n } catch (err) {\n console.error(err)\n throw new PageNotFoundError(page)\n }\n}\n\ninterface PagePathData {\n filename: string\n bundlePath: string\n page: string\n}\n\n/**\n * Attempts to find a page file path from the given pages absolute directory,\n * a page and allowed extensions. If the page can't be found it will throw an\n * error. It defaults the `/_error` page to Next.js internal error page.\n *\n * @param rootDir Absolute path to the project root.\n * @param page The page normalized (it will be denormalized).\n * @param extensions Array of page extensions.\n * @param pagesDir Absolute path to the pages folder with trailing `/pages`.\n * @param appDir Absolute path to the app folder with trailing `/app`.\n */\nexport async function findPagePathData(\n rootDir: string,\n page: string,\n extensions: string[],\n pagesDir: string | undefined,\n appDir: string | undefined,\n isGlobalNotFoundEnabled: boolean\n): Promise<PagePathData> {\n const normalizedPagePath = tryToNormalizePagePath(page)\n let pagePath: string | null = null\n\n const isInstrumentation = isInstrumentationHookFile(normalizedPagePath)\n if (isMiddlewareFile(normalizedPagePath) || isInstrumentation) {\n pagePath = await findPageFile(\n rootDir,\n normalizedPagePath,\n extensions,\n false\n )\n\n if (!pagePath) {\n throw new PageNotFoundError(normalizedPagePath)\n }\n\n const pageUrl = ensureLeadingSlash(\n removePagePathTail(normalizePathSep(pagePath), {\n extensions,\n })\n )\n\n let bundlePath = normalizedPagePath\n let pageKey = posix.normalize(pageUrl)\n\n if (isInstrumentation || isMiddlewareFile(normalizedPagePath)) {\n bundlePath = bundlePath.replace('/src', '')\n pageKey = page.replace('/src', '')\n }\n\n return {\n filename: join(rootDir, pagePath),\n bundlePath: bundlePath.slice(1),\n page: pageKey,\n }\n }\n\n // Check appDir first falling back to pagesDir\n if (appDir) {\n if (page === UNDERSCORE_NOT_FOUND_ROUTE_ENTRY) {\n // Load `global-not-found` when global-not-found is enabled.\n // Prefer to load it when both `global-not-found` and root `not-found` present.\n if (isGlobalNotFoundEnabled) {\n const globalNotFoundPath = await findPageFile(\n appDir,\n 'global-not-found',\n extensions,\n true\n )\n if (globalNotFoundPath) {\n return {\n filename: join(appDir, globalNotFoundPath),\n bundlePath: `app${UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}`,\n page: UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n }\n }\n } else {\n // Then if global-not-found.js doesn't exist then load not-found.js\n const notFoundPath = await findPageFile(\n appDir,\n 'not-found',\n extensions,\n true\n )\n if (notFoundPath) {\n return {\n filename: join(appDir, notFoundPath),\n bundlePath: `app${UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}`,\n page: UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n }\n }\n }\n\n // If they're not presented, then fallback to global-not-found\n return {\n filename: require.resolve(\n 'next/dist/client/components/builtin/global-not-found'\n ),\n bundlePath: `app${UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}`,\n page: UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n }\n }\n pagePath = await findPageFile(appDir, normalizedPagePath, extensions, true)\n if (pagePath) {\n const pageUrl = ensureLeadingSlash(\n removePagePathTail(normalizePathSep(pagePath), {\n keepIndex: true,\n extensions,\n })\n )\n\n return {\n filename: join(appDir, pagePath),\n bundlePath: posix.join('app', pageUrl),\n page: posix.normalize(pageUrl),\n }\n }\n }\n\n if (!pagePath && pagesDir) {\n pagePath = await findPageFile(\n pagesDir,\n normalizedPagePath,\n extensions,\n false\n )\n }\n\n if (pagePath !== null && pagesDir) {\n const pageUrl = ensureLeadingSlash(\n removePagePathTail(normalizePathSep(pagePath), {\n extensions,\n })\n )\n\n return {\n filename: join(pagesDir, pagePath),\n bundlePath: posix.join('pages', normalizePagePath(pageUrl)),\n page: posix.normalize(pageUrl),\n }\n }\n\n if (page === '/_error') {\n return {\n filename: require.resolve('next/dist/pages/_error'),\n bundlePath: page,\n page: normalizePathSep(page),\n }\n } else {\n throw new PageNotFoundError(normalizedPagePath)\n }\n}\n\nexport function onDemandEntryHandler({\n hotReloader,\n maxInactiveAge,\n multiCompiler,\n nextConfig,\n pagesBufferLength,\n pagesDir,\n rootDir,\n appDir,\n}: {\n hotReloader: HotReloaderWebpack\n maxInactiveAge: number\n multiCompiler: webpack.MultiCompiler\n nextConfig: NextConfigComplete\n pagesBufferLength: number\n pagesDir?: string\n rootDir: string\n appDir?: string\n}) {\n const hasAppDir = !!appDir\n let curInvalidator: Invalidator = getInvalidator(\n multiCompiler.outputPath\n ) as any\n const curEntries = getEntries(multiCompiler.outputPath) as any\n\n if (!curInvalidator) {\n curInvalidator = new Invalidator(multiCompiler)\n invalidators.set(multiCompiler.outputPath, curInvalidator)\n }\n\n const startBuilding = (compilation: webpack.Compilation) => {\n const compilationName = compilation.name as any as CompilerNameValues\n curInvalidator.startBuilding(compilationName)\n }\n for (const compiler of multiCompiler.compilers) {\n compiler.hooks.make.tap('NextJsOnDemandEntries', startBuilding)\n }\n\n function getPagePathsFromEntrypoints(\n type: CompilerNameValues,\n entrypoints: Map<string, { name?: string | null }>\n ) {\n const pagePaths: string[] = []\n for (const entrypoint of entrypoints.values()) {\n const page = getRouteFromEntrypoint(entrypoint.name!, hasAppDir)\n\n if (page) {\n const pageBundleType = entrypoint.name?.startsWith('app/')\n ? PAGE_TYPES.APP\n : PAGE_TYPES.PAGES\n pagePaths.push(getEntryKey(type, pageBundleType, page))\n } else if (\n isMiddlewareFilename(entrypoint.name) ||\n isInstrumentationHookFilename(entrypoint.name)\n ) {\n pagePaths.push(\n getEntryKey(type, PAGE_TYPES.ROOT, `/${entrypoint.name}`)\n )\n }\n }\n return pagePaths\n }\n\n for (const compiler of multiCompiler.compilers) {\n compiler.hooks.done.tap('NextJsOnDemandEntries', () =>\n getInvalidator(compiler.outputPath)?.doneBuilding([\n compiler.name as keyof typeof COMPILER_INDEXES,\n ])\n )\n }\n\n multiCompiler.hooks.done.tap('NextJsOnDemandEntries', (multiStats) => {\n const [clientStats, serverStats, edgeServerStats] = multiStats.stats\n const entryNames = [\n ...getPagePathsFromEntrypoints(\n COMPILER_NAMES.client,\n clientStats.compilation.entrypoints\n ),\n ...getPagePathsFromEntrypoints(\n COMPILER_NAMES.server,\n serverStats.compilation.entrypoints\n ),\n ...(edgeServerStats\n ? getPagePathsFromEntrypoints(\n COMPILER_NAMES.edgeServer,\n edgeServerStats.compilation.entrypoints\n )\n : []),\n ]\n\n for (const name of entryNames) {\n const entry = curEntries[name]\n if (!entry) {\n continue\n }\n\n if (entry.status !== BUILDING) {\n continue\n }\n\n entry.status = BUILT\n doneCallbacks.emit(name)\n }\n\n getInvalidator(multiCompiler.outputPath)?.doneBuilding([...COMPILER_KEYS])\n })\n\n const pingIntervalTime = Math.max(1000, Math.min(5000, maxInactiveAge))\n\n setInterval(function () {\n disposeInactiveEntries(curEntries, maxInactiveAge)\n }, pingIntervalTime + 1000).unref()\n\n function handleAppDirPing(tree: FlightRouterState): void {\n const pages = getEntrypointsFromTree(tree, true)\n\n for (const page of pages) {\n for (const compilerType of [\n COMPILER_NAMES.client,\n COMPILER_NAMES.server,\n COMPILER_NAMES.edgeServer,\n ]) {\n const entryKey = getEntryKey(compilerType, PAGE_TYPES.APP, `/${page}`)\n const entryInfo = curEntries[entryKey]\n\n // If there's no entry, it may have been invalidated and needs to be re-built.\n if (!entryInfo) {\n // if (page !== lastEntry) client pings, but there's no entry for page\n continue\n }\n\n // We don't need to maintain active state of anything other than BUILT entries\n if (entryInfo.status !== BUILT) continue\n\n // If there's an entryInfo\n if (!lastServerAccessPagesForAppDir.includes(entryKey)) {\n lastServerAccessPagesForAppDir.unshift(entryKey)\n\n // Maintain the buffer max length\n // TODO: verify that the current pageKey is not at the end of the array as multiple entrypoints can exist\n if (lastServerAccessPagesForAppDir.length > pagesBufferLength) {\n lastServerAccessPagesForAppDir.pop()\n }\n }\n entryInfo.lastActiveTime = Date.now()\n entryInfo.dispose = false\n }\n }\n }\n\n function handlePing(pg: string): void {\n const page = normalizePathSep(pg)\n for (const compilerType of [\n COMPILER_NAMES.client,\n COMPILER_NAMES.server,\n COMPILER_NAMES.edgeServer,\n ]) {\n const entryKey = getEntryKey(compilerType, PAGE_TYPES.PAGES, page)\n const entryInfo = curEntries[entryKey]\n\n // If there's no entry, it may have been invalidated and needs to be re-built.\n if (!entryInfo) {\n // if (page !== lastEntry) client pings, but there's no entry for page\n if (compilerType === COMPILER_NAMES.client) {\n return\n }\n continue\n }\n\n // We don't need to maintain active state of anything other than BUILT entries\n if (entryInfo.status !== BUILT) continue\n\n // If there's an entryInfo\n if (!lastClientAccessPages.includes(entryKey)) {\n lastClientAccessPages.unshift(entryKey)\n\n // Maintain the buffer max length\n if (lastClientAccessPages.length > pagesBufferLength) {\n lastClientAccessPages.pop()\n }\n }\n entryInfo.lastActiveTime = Date.now()\n entryInfo.dispose = false\n }\n return\n }\n\n async function ensurePageImpl({\n page,\n appPaths,\n definition,\n isApp,\n url,\n }: {\n page: string\n appPaths: ReadonlyArray<string> | null\n definition: RouteDefinition | undefined\n isApp: boolean | undefined\n url?: string\n }): Promise<void> {\n const stalledTime = 60\n const stalledEnsureTimeout = setTimeout(() => {\n debug(\n `Ensuring ${page} has taken longer than ${stalledTime}s, if this continues to stall this may be a bug`\n )\n }, stalledTime * 1000)\n\n try {\n let route: Pick<RouteDefinition, 'filename' | 'bundlePath' | 'page'>\n if (definition) {\n route = definition\n } else {\n route = await findPagePathData(\n rootDir,\n page,\n nextConfig.pageExtensions,\n pagesDir,\n appDir,\n !!nextConfig.experimental.globalNotFound\n )\n }\n\n const isInsideAppDir = !!appDir && route.filename.startsWith(appDir)\n\n if (typeof isApp === 'boolean' && isApp !== isInsideAppDir) {\n Error.stackTraceLimit = 15\n throw new Error(\n `Ensure bailed, found path \"${\n route.page\n }\" does not match ensure type (${isApp ? 'app' : 'pages'})`\n )\n }\n\n const pageBundleType = getPageBundleType(route.bundlePath)\n const addEntry = (\n compilerType: CompilerNameValues\n ): {\n entryKey: string\n newEntry: boolean\n shouldInvalidate: boolean\n } => {\n const entryKey = getEntryKey(compilerType, pageBundleType, route.page)\n if (\n curEntries[entryKey] &&\n // there can be an overlap in the entryKey for the instrumentation hook file and a page named the same\n // this is a quick fix to support this scenario by overwriting the instrumentation hook entry, since we only use it one time\n // any changes to the instrumentation hook file will require a restart of the dev server anyway\n !isInstrumentationHookFilename(curEntries[entryKey].bundlePath)\n ) {\n curEntries[entryKey].dispose = false\n curEntries[entryKey].lastActiveTime = Date.now()\n if (curEntries[entryKey].status === BUILT) {\n return {\n entryKey,\n newEntry: false,\n shouldInvalidate: false,\n }\n }\n\n return {\n entryKey,\n newEntry: false,\n shouldInvalidate: true,\n }\n }\n\n curEntries[entryKey] = {\n type: EntryTypes.ENTRY,\n appPaths,\n absolutePagePath: route.filename,\n request: route.filename,\n bundlePath: route.bundlePath,\n dispose: false,\n lastActiveTime: Date.now(),\n status: ADDED,\n }\n return {\n entryKey: entryKey,\n newEntry: true,\n shouldInvalidate: true,\n }\n }\n\n const staticInfo = await getStaticInfoIncludingLayouts({\n page,\n pageFilePath: route.filename,\n isInsideAppDir,\n pageExtensions: nextConfig.pageExtensions,\n isDev: true,\n config: nextConfig,\n appDir,\n })\n\n const added = new Map<CompilerNameValues, ReturnType<typeof addEntry>>()\n const isServerComponent =\n isInsideAppDir && staticInfo.rsc !== RSC_MODULE_TYPES.client\n\n let pageRuntime = staticInfo.runtime\n\n runDependingOnPageType({\n page: route.page,\n pageRuntime,\n pageType: pageBundleType,\n onClient: () => {\n // Skip adding the client entry for app / Server Components.\n if (isServerComponent || isInsideAppDir) {\n return\n }\n added.set(COMPILER_NAMES.client, addEntry(COMPILER_NAMES.client))\n },\n onServer: () => {\n added.set(COMPILER_NAMES.server, addEntry(COMPILER_NAMES.server))\n const edgeServerEntry = getEntryKey(\n COMPILER_NAMES.edgeServer,\n pageBundleType,\n route.page\n )\n if (\n curEntries[edgeServerEntry] &&\n !isInstrumentationHookFile(route.page)\n ) {\n // Runtime switched from edge to server\n delete curEntries[edgeServerEntry]\n }\n },\n onEdgeServer: () => {\n added.set(\n COMPILER_NAMES.edgeServer,\n addEntry(COMPILER_NAMES.edgeServer)\n )\n const serverEntry = getEntryKey(\n COMPILER_NAMES.server,\n pageBundleType,\n route.page\n )\n if (\n curEntries[serverEntry] &&\n !isInstrumentationHookFile(route.page)\n ) {\n // Runtime switched from server to edge\n delete curEntries[serverEntry]\n }\n },\n })\n\n const addedValues = [...added.values()]\n const entriesThatShouldBeInvalidated = [...added.entries()].filter(\n ([, entry]) => entry.shouldInvalidate\n )\n const hasNewEntry = addedValues.some((entry) => entry.newEntry)\n\n if (hasNewEntry) {\n const routePage = isApp ? route.page : normalizeAppPath(route.page)\n // If proxy file, remove the leading slash from \"/proxy\" to \"proxy\".\n reportTrigger(\n isMiddlewareFile(routePage) ? routePage.slice(1) : routePage,\n url\n )\n }\n\n if (entriesThatShouldBeInvalidated.length > 0) {\n const invalidatePromise = Promise.all(\n entriesThatShouldBeInvalidated.map(([compilerKey, { entryKey }]) => {\n return new Promise<void>((resolve, reject) => {\n doneCallbacks.once(entryKey, (err: Error) => {\n if (err) {\n return reject(err)\n }\n\n // If the invalidation also triggers a rebuild, we need to\n // wait for that additional build to prevent race conditions.\n const needsRebuild = curInvalidator.willRebuild(compilerKey)\n if (needsRebuild) {\n doneCallbacks.once(entryKey, (rebuildErr: Error) => {\n if (rebuildErr) {\n return reject(rebuildErr)\n }\n resolve()\n })\n } else {\n resolve()\n }\n })\n })\n })\n )\n\n curInvalidator.invalidate([...added.keys()])\n await invalidatePromise\n }\n } finally {\n clearTimeout(stalledEnsureTimeout)\n }\n }\n\n type EnsurePageOptions = {\n page: string\n appPaths?: ReadonlyArray<string> | null\n definition?: RouteDefinition\n isApp?: boolean\n url?: string\n }\n\n // Make sure that we won't have multiple invalidations ongoing concurrently.\n const batcher = Batcher.create<EnsurePageOptions, void, string>({\n // The cache key here is composed of the elements that affect the\n // compilation, namely, the page, whether it's client only, and whether\n // it's an app page. This ensures that we don't have multiple compilations\n // for the same page happening concurrently.\n //\n // We don't include the whole match because it contains match specific\n // parameters (like route params) that would just bust this cache. Any\n // details that would possibly bust the cache should be listed here.\n cacheKeyFn: (options) => JSON.stringify(options),\n // Schedule the invocation of the ensurePageImpl function on the next tick.\n schedulerFn: scheduleOnNextTick,\n })\n\n return {\n async ensurePage({\n page,\n appPaths = null,\n definition,\n isApp,\n url,\n }: EnsurePageOptions) {\n // If the route is actually an app page route, then we should have access\n // to the app route definition, and therefore, the appPaths from it.\n if (!appPaths && definition && isAppPageRouteDefinition(definition)) {\n appPaths = definition.appPaths\n }\n\n // Wrap the invocation of the ensurePageImpl function in the pending\n // wrapper, which will ensure that we don't have multiple compilations\n // for the same page happening concurrently.\n return batcher.batch({ page, appPaths, definition, isApp }, async () => {\n await ensurePageImpl({\n page,\n appPaths,\n definition,\n isApp,\n url,\n })\n })\n },\n onHMR(client: ws, getHmrServerError: () => Error | null) {\n let bufferedHmrServerError: Error | null = null\n\n client.addEventListener('close', () => {\n bufferedHmrServerError = null\n })\n client.addEventListener('message', ({ data }) => {\n try {\n const error = getHmrServerError()\n\n // New error occurred: buffered error is flushed and new error occurred\n if (!bufferedHmrServerError && error) {\n hotReloader.send({\n type: HMR_MESSAGE_SENT_TO_BROWSER.SERVER_ERROR,\n errorJSON: stringifyError(error),\n })\n bufferedHmrServerError = null\n }\n\n const parsedData = JSON.parse(\n typeof data !== 'string' ? data.toString() : data\n )\n\n if (parsedData.event === HMR_MESSAGE_SENT_TO_SERVER.PING) {\n if (parsedData.appDirRoute) {\n handleAppDirPing(parsedData.tree)\n } else {\n handlePing(parsedData.page)\n }\n } else if (\n parsedData.event ===\n HMR_MESSAGE_SENT_TO_SERVER.MCP_ERROR_STATE_RESPONSE\n ) {\n handleErrorStateResponse(\n parsedData.requestId,\n parsedData.errorState,\n parsedData.url\n )\n } else if (\n parsedData.event ===\n HMR_MESSAGE_SENT_TO_SERVER.MCP_PAGE_METADATA_RESPONSE\n ) {\n handlePageMetadataResponse(\n parsedData.requestId,\n parsedData.segmentTrieData,\n parsedData.url\n )\n }\n } catch {}\n })\n },\n }\n}\n"],"names":["createDebug","EventEmitter","findPageFile","runDependingOnPageType","getStaticInfoIncludingLayouts","join","posix","normalizePathSep","normalizePagePath","ensureLeadingSlash","removePagePathTail","reportTrigger","getRouteFromEntrypoint","isInstrumentationHookFile","isInstrumentationHookFilename","isMiddlewareFile","isMiddlewareFilename","PageNotFoundError","stringifyError","COMPILER_INDEXES","COMPILER_NAMES","RSC_MODULE_TYPES","UNDERSCORE_NOT_FOUND_ROUTE_ENTRY","PAGE_SEGMENT_KEY","HMR_MESSAGE_SENT_TO_BROWSER","HMR_MESSAGE_SENT_TO_SERVER","isAppPageRouteDefinition","scheduleOnNextTick","Batcher","normalizeAppPath","PAGE_TYPES","getNextFlightSegmentPath","handleErrorStateResponse","handlePageMetadataResponse","debug","keys","Object","COMPILER_KEYS","treePathToEntrypoint","segmentPath","parentPath","parallelRouteKey","segment","path","startsWith","length","childSegmentPath","convertDynamicParamTypeToSyntax","dynamicParamTypeShort","param","Error","getEntryKey","compilerType","pageBundleType","page","pageKey","replace","getPageBundleType","pageBundlePath","PAGES","ROOT","APP","getEntrypointsFromTree","tree","isFirst","parallelRoutes","currentSegment","Array","isArray","isPageSegment","currentPath","slice","reduce","paths","key","childTree","childPages","ADDED","Symbol","BUILDING","BUILT","EntryTypes","entriesMap","Map","normalizeOutputPath","dir","getEntries","entries","get","set","invalidators","getInvalidator","doneCallbacks","lastClientAccessPages","lastServerAccessPagesForAppDir","Invalidator","constructor","multiCompiler","building","Set","rebuildAgain","shouldRebuildAll","size","invalidate","compilerKeys","has","add","compilers","watching","startBuilding","compilerKey","doneBuilding","rebuild","delete","push","willRebuild","disposeInactiveEntries","maxInactiveAge","forEach","entryKey","entryData","lastActiveTime","status","dispose","bundlePath","type","includes","Date","now","tryToNormalizePagePath","err","console","error","findPagePathData","rootDir","extensions","pagesDir","appDir","isGlobalNotFoundEnabled","normalizedPagePath","pagePath","isInstrumentation","pageUrl","normalize","filename","globalNotFoundPath","notFoundPath","require","resolve","keepIndex","onDemandEntryHandler","hotReloader","nextConfig","pagesBufferLength","hasAppDir","curInvalidator","outputPath","curEntries","compilation","compilationName","name","compiler","hooks","make","tap","getPagePathsFromEntrypoints","entrypoints","pagePaths","entrypoint","values","done","multiStats","clientStats","serverStats","edgeServerStats","stats","entryNames","client","server","edgeServer","entry","emit","pingIntervalTime","Math","max","min","setInterval","unref","handleAppDirPing","pages","entryInfo","unshift","pop","handlePing","pg","ensurePageImpl","appPaths","definition","isApp","url","stalledTime","stalledEnsureTimeout","setTimeout","route","pageExtensions","experimental","globalNotFound","isInsideAppDir","stackTraceLimit","addEntry","newEntry","shouldInvalidate","absolutePagePath","request","staticInfo","pageFilePath","isDev","config","added","isServerComponent","rsc","pageRuntime","runtime","pageType","onClient","onServer","edgeServerEntry","onEdgeServer","serverEntry","addedValues","entriesThatShouldBeInvalidated","filter","hasNewEntry","some","routePage","invalidatePromise","Promise","all","map","reject","once","needsRebuild","rebuildErr","clearTimeout","batcher","create","cacheKeyFn","options","JSON","stringify","schedulerFn","ensurePage","batch","onHMR","getHmrServerError","bufferedHmrServerError","addEventListener","data","send","SERVER_ERROR","errorJSON","parsedData","parse","toString","event","PING","appDirRoute","MCP_ERROR_STATE_RESPONSE","requestId","errorState","MCP_PAGE_METADATA_RESPONSE","segmentTrieData"],"mappings":"AAYA,OAAOA,iBAAiB,2BAA0B;AAClD,SAASC,YAAY,QAAQ,SAAQ;AACrC,SAASC,YAAY,QAAQ,wBAAuB;AACpD,SAASC,sBAAsB,QAAQ,sBAAqB;AAC5D,S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