next 15.0.4-canary.16 → 15.0.4-canary.17
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.
Potentially problematic release.
This version of next might be problematic. Click here for more details.
- package/dist/bin/next +1 -1
- package/dist/build/index.js +2 -2
- package/dist/build/swc/index.js +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/esm/build/index.js +2 -2
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/server/config-shared.js.map +1 -1
- package/dist/esm/server/config.js +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/dev/turbopack-utils.js +1 -5
- package/dist/esm/server/dev/turbopack-utils.js.map +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/server/config-shared.d.ts +1 -3
- package/dist/server/config-shared.js.map +1 -1
- package/dist/server/config.js +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/dev/turbopack-utils.js +1 -5
- package/dist/server/dev/turbopack-utils.js.map +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +15 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/server/dev/turbopack-utils.ts"],"sourcesContent":["import type { NextConfigComplete } from '../config-shared'\nimport loadJsConfig from '../../build/load-jsconfig'\nimport type {\n ServerFields,\n SetupOpts,\n} from '../lib/router-utils/setup-dev-bundler'\nimport type {\n Issue,\n StyledString,\n TurbopackResult,\n Endpoint,\n Entrypoints as RawEntrypoints,\n Update as TurbopackUpdate,\n WrittenEndpoint,\n} from '../../build/swc/types'\nimport {\n decodeMagicIdentifier,\n MAGIC_IDENTIFIER_REGEX,\n} from '../../shared/lib/magic-identifier'\nimport { bold, green, magenta, red } from '../../lib/picocolors'\nimport {\n type HMR_ACTION_TYPES,\n HMR_ACTIONS_SENT_TO_BROWSER,\n} from './hot-reloader-types'\nimport * as Log from '../../build/output/log'\nimport type { PropagateToWorkersField } from '../lib/router-utils/types'\nimport type { TurbopackManifestLoader } from './turbopack/manifest-loader'\nimport type { AppRoute, Entrypoints, PageRoute } from './turbopack/types'\nimport {\n type EntryKey,\n getEntryKey,\n splitEntryKey,\n} from './turbopack/entry-key'\nimport type ws from 'next/dist/compiled/ws'\nimport isInternal from '../../shared/lib/is-internal'\nimport { isMetadataRoute } from '../../lib/metadata/is-metadata-route'\nimport type { CustomRoutes } from '../../lib/load-custom-routes'\n\nexport async function getTurbopackJsConfig(\n dir: string,\n nextConfig: NextConfigComplete\n) {\n const { jsConfig } = await loadJsConfig(dir, nextConfig)\n return jsConfig ?? { compilerOptions: {} }\n}\n\n// An error generated from emitted Turbopack issues. This can include build\n// errors caused by issues with user code.\nexport class ModuleBuildError extends Error {\n name = 'ModuleBuildError'\n}\n\n// An error caused by an internal issue in Turbopack. These should be written\n// to a log file and details should not be shown to the user.\nexport class TurbopackInternalError extends Error {\n name = 'TurbopackInternalError'\n\n constructor(cause: Error) {\n super(cause.message)\n this.stack = cause.stack\n }\n}\n\n/**\n * Thin stopgap workaround layer to mimic existing wellknown-errors-plugin in webpack's build\n * to emit certain type of errors into cli.\n */\nexport function isWellKnownError(issue: Issue): boolean {\n const { title } = issue\n const formattedTitle = renderStyledStringToErrorAnsi(title)\n // TODO: add more well known errors\n if (\n formattedTitle.includes('Module not found') ||\n formattedTitle.includes('Unknown module type')\n ) {\n return true\n }\n\n return false\n}\n\nconst onceErrorSet = new Set()\n/**\n * Check if given issue is a warning to be display only once.\n * This mimics behavior of get-page-static-info's warnOnce.\n * @param issue\n * @returns\n */\nfunction shouldEmitOnceWarning(issue: Issue): boolean {\n const { severity, title, stage } = issue\n if (severity === 'warning' && title.value === 'Invalid page configuration') {\n if (onceErrorSet.has(issue)) {\n return false\n }\n onceErrorSet.add(issue)\n }\n if (\n severity === 'warning' &&\n stage === 'config' &&\n renderStyledStringToErrorAnsi(issue.title).includes(\"can't be external\")\n ) {\n if (onceErrorSet.has(issue)) {\n return false\n }\n onceErrorSet.add(issue)\n }\n\n return true\n}\n\n/// Print out an issue to the console which should not block\n/// the build by throwing out or blocking error overlay.\nexport function printNonFatalIssue(issue: Issue) {\n if (isRelevantWarning(issue) && shouldEmitOnceWarning(issue)) {\n Log.warn(formatIssue(issue))\n }\n}\n\nfunction isNodeModulesIssue(issue: Issue): boolean {\n if (issue.severity === 'warning' && issue.stage === 'config') {\n // Override for the externalize issue\n // `Package foo (serverExternalPackages or default list) can't be external`\n if (\n renderStyledStringToErrorAnsi(issue.title).includes(\"can't be external\")\n ) {\n return false\n }\n }\n\n return (\n issue.severity === 'warning' &&\n issue.filePath.match(/^(?:.*[\\\\/])?node_modules(?:[\\\\/].*)?$/) !== null\n )\n}\n\nexport function isRelevantWarning(issue: Issue): boolean {\n return issue.severity === 'warning' && !isNodeModulesIssue(issue)\n}\n\nexport function formatIssue(issue: Issue) {\n const { filePath, title, description, source } = issue\n let { documentationLink } = issue\n let formattedTitle = renderStyledStringToErrorAnsi(title).replace(\n /\\n/g,\n '\\n '\n )\n\n // TODO: Use error codes to identify these\n // TODO: Generalize adapting Turbopack errors to Next.js errors\n if (formattedTitle.includes('Module not found')) {\n // For compatiblity with webpack\n // TODO: include columns in webpack errors.\n documentationLink = 'https://nextjs.org/docs/messages/module-not-found'\n }\n\n let formattedFilePath = filePath\n .replace('[project]/', './')\n .replaceAll('/./', '/')\n .replace('\\\\\\\\?\\\\', '')\n\n let message = ''\n\n if (source && source.range) {\n const { start } = source.range\n message = `${formattedFilePath}:${start.line + 1}:${\n start.column + 1\n }\\n${formattedTitle}`\n } else if (formattedFilePath) {\n message = `${formattedFilePath}\\n${formattedTitle}`\n } else {\n message = formattedTitle\n }\n message += '\\n'\n\n if (\n source?.range &&\n source.source.content &&\n // ignore Next.js/React internals, as these can often be huge bundled files.\n !isInternal(filePath)\n ) {\n const { start, end } = source.range\n const { codeFrameColumns } = require('next/dist/compiled/babel/code-frame')\n\n message +=\n codeFrameColumns(\n source.source.content,\n {\n start: {\n line: start.line + 1,\n column: start.column + 1,\n },\n end: {\n line: end.line + 1,\n column: end.column + 1,\n },\n },\n { forceColor: true }\n ).trim() + '\\n\\n'\n }\n\n if (description) {\n message += renderStyledStringToErrorAnsi(description) + '\\n\\n'\n }\n\n // TODO: make it possible to enable this for debugging, but not in tests.\n // if (detail) {\n // message += renderStyledStringToErrorAnsi(detail) + '\\n\\n'\n // }\n\n // TODO: Include a trace from the issue.\n\n if (documentationLink) {\n message += documentationLink + '\\n\\n'\n }\n\n return message\n}\n\ntype IssueKey = `${Issue['severity']}-${Issue['filePath']}-${string}-${string}`\nexport type IssuesMap = Map<IssueKey, Issue>\nexport type EntryIssuesMap = Map<EntryKey, IssuesMap>\nexport type TopLevelIssuesMap = IssuesMap\n\nfunction getIssueKey(issue: Issue): IssueKey {\n return `${issue.severity}-${issue.filePath}-${JSON.stringify(\n issue.title\n )}-${JSON.stringify(issue.description)}`\n}\n\nexport function processTopLevelIssues(\n currentTopLevelIssues: TopLevelIssuesMap,\n result: TurbopackResult\n) {\n currentTopLevelIssues.clear()\n\n for (const issue of result.issues) {\n const issueKey = getIssueKey(issue)\n currentTopLevelIssues.set(issueKey, issue)\n }\n}\n\nexport function processIssues(\n currentEntryIssues: EntryIssuesMap,\n key: EntryKey,\n result: TurbopackResult,\n throwIssue: boolean,\n logErrors: boolean\n) {\n const newIssues = new Map<IssueKey, Issue>()\n currentEntryIssues.set(key, newIssues)\n\n const relevantIssues = new Set()\n\n for (const issue of result.issues) {\n if (\n issue.severity !== 'error' &&\n issue.severity !== 'fatal' &&\n issue.severity !== 'warning'\n )\n continue\n\n const issueKey = getIssueKey(issue)\n newIssues.set(issueKey, issue)\n\n if (issue.severity !== 'warning') {\n if (throwIssue) {\n const formatted = formatIssue(issue)\n relevantIssues.add(formatted)\n }\n // if we throw the issue it will most likely get handed and logged elsewhere\n else if (logErrors && isWellKnownError(issue)) {\n const formatted = formatIssue(issue)\n Log.error(formatted)\n }\n }\n }\n\n if (relevantIssues.size && throwIssue) {\n throw new ModuleBuildError([...relevantIssues].join('\\n\\n'))\n }\n}\n\nexport function renderStyledStringToErrorAnsi(string: StyledString): string {\n function decodeMagicIdentifiers(str: string): string {\n return str.replaceAll(MAGIC_IDENTIFIER_REGEX, (ident) => {\n try {\n return magenta(`{${decodeMagicIdentifier(ident)}}`)\n } catch (e) {\n return magenta(`{${ident} (decoding failed: ${e})}`)\n }\n })\n }\n\n switch (string.type) {\n case 'text':\n return decodeMagicIdentifiers(string.value)\n case 'strong':\n return bold(red(decodeMagicIdentifiers(string.value)))\n case 'code':\n return green(decodeMagicIdentifiers(string.value))\n case 'line':\n return string.value.map(renderStyledStringToErrorAnsi).join('')\n case 'stack':\n return string.value.map(renderStyledStringToErrorAnsi).join('\\n')\n default:\n throw new Error('Unknown StyledString type', string)\n }\n}\n\nconst MILLISECONDS_IN_NANOSECOND = BigInt(1_000_000)\n\nexport function msToNs(ms: number): bigint {\n return BigInt(Math.floor(ms)) * MILLISECONDS_IN_NANOSECOND\n}\n\nexport type ChangeSubscriptions = Map<\n EntryKey,\n Promise<AsyncIterableIterator<TurbopackResult>>\n>\n\nexport type HandleWrittenEndpoint = (\n key: EntryKey,\n result: TurbopackResult<WrittenEndpoint>\n) => void\n\nexport type StartChangeSubscription = (\n key: EntryKey,\n includeIssues: boolean,\n endpoint: Endpoint,\n makePayload: (\n change: TurbopackResult\n ) => Promise<HMR_ACTION_TYPES> | HMR_ACTION_TYPES | void,\n onError?: (e: Error) => Promise<HMR_ACTION_TYPES> | HMR_ACTION_TYPES | void\n) => Promise<void>\n\nexport type StopChangeSubscription = (key: EntryKey) => Promise<void>\n\nexport type SendHmr = (id: string, payload: HMR_ACTION_TYPES) => void\n\nexport type StartBuilding = (\n id: string,\n requestUrl: string | undefined,\n forceRebuild: boolean\n) => () => void\n\nexport type ReadyIds = Set<string>\n\nexport type ClientState = {\n clientIssues: EntryIssuesMap\n hmrPayloads: Map<string, HMR_ACTION_TYPES>\n turbopackUpdates: TurbopackUpdate[]\n subscriptions: Map<string, AsyncIterator<any>>\n}\n\nexport type ClientStateMap = WeakMap<ws, ClientState>\n\n// hooks only used by the dev server.\ntype HandleRouteTypeHooks = {\n handleWrittenEndpoint: HandleWrittenEndpoint\n subscribeToChanges: StartChangeSubscription\n}\n\nexport async function handleRouteType({\n dev,\n page,\n pathname,\n route,\n currentEntryIssues,\n entrypoints,\n manifestLoader,\n readyIds,\n devRewrites,\n productionRewrites,\n hooks,\n logErrors,\n}: {\n dev: boolean\n page: string\n pathname: string\n route: PageRoute | AppRoute\n\n currentEntryIssues: EntryIssuesMap\n entrypoints: Entrypoints\n manifestLoader: TurbopackManifestLoader\n devRewrites: SetupOpts['fsChecker']['rewrites'] | undefined\n productionRewrites: CustomRoutes['rewrites'] | undefined\n logErrors: boolean\n\n readyIds?: ReadyIds // dev\n\n hooks?: HandleRouteTypeHooks // dev\n}) {\n const shouldCreateWebpackStats = process.env.TURBOPACK_STATS != null\n\n switch (route.type) {\n case 'page': {\n const clientKey = getEntryKey('pages', 'client', page)\n const serverKey = getEntryKey('pages', 'server', page)\n\n try {\n if (entrypoints.global.app) {\n const key = getEntryKey('pages', 'server', '_app')\n\n const writtenEndpoint = await entrypoints.global.app.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n processIssues(\n currentEntryIssues,\n key,\n writtenEndpoint,\n false,\n logErrors\n )\n }\n await manifestLoader.loadBuildManifest('_app')\n await manifestLoader.loadPagesManifest('_app')\n\n if (entrypoints.global.document) {\n const key = getEntryKey('pages', 'server', '_document')\n\n const writtenEndpoint =\n await entrypoints.global.document.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n processIssues(\n currentEntryIssues,\n key,\n writtenEndpoint,\n false,\n logErrors\n )\n }\n await manifestLoader.loadPagesManifest('_document')\n\n const writtenEndpoint = await route.htmlEndpoint.writeToDisk()\n hooks?.handleWrittenEndpoint(serverKey, writtenEndpoint)\n\n const type = writtenEndpoint?.type\n\n await manifestLoader.loadBuildManifest(page)\n await manifestLoader.loadPagesManifest(page)\n if (type === 'edge') {\n await manifestLoader.loadMiddlewareManifest(page, 'pages')\n } else {\n manifestLoader.deleteMiddlewareManifest(serverKey)\n }\n await manifestLoader.loadFontManifest('/_app', 'pages')\n await manifestLoader.loadFontManifest(page, 'pages')\n await manifestLoader.loadLoadableManifest(page, 'pages')\n\n if (shouldCreateWebpackStats) {\n await manifestLoader.loadWebpackStats(page, 'pages')\n }\n\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints,\n })\n\n processIssues(\n currentEntryIssues,\n serverKey,\n writtenEndpoint,\n false,\n logErrors\n )\n } finally {\n if (dev) {\n // TODO subscriptions should only be caused by the WebSocket connections\n // otherwise we don't known when to unsubscribe and this leaking\n hooks?.subscribeToChanges(\n serverKey,\n false,\n route.dataEndpoint,\n () => {\n // Report the next compilation again\n readyIds?.delete(pathname)\n return {\n event: HMR_ACTIONS_SENT_TO_BROWSER.SERVER_ONLY_CHANGES,\n pages: [page],\n }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in ${page} data subscription: ${e}`,\n }\n }\n )\n hooks?.subscribeToChanges(\n clientKey,\n false,\n route.htmlEndpoint,\n () => {\n return {\n event: HMR_ACTIONS_SENT_TO_BROWSER.CLIENT_CHANGES,\n }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in ${page} html subscription: ${e}`,\n }\n }\n )\n if (entrypoints.global.document) {\n hooks?.subscribeToChanges(\n getEntryKey('pages', 'server', '_document'),\n false,\n entrypoints.global.document,\n () => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: '_document has changed (page route)',\n }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in _document subscription (page route): ${e}`,\n }\n }\n )\n }\n }\n }\n\n break\n }\n case 'page-api': {\n const key = getEntryKey('pages', 'server', page)\n\n const writtenEndpoint = await route.endpoint.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n\n const type = writtenEndpoint.type\n\n await manifestLoader.loadPagesManifest(page)\n if (type === 'edge') {\n await manifestLoader.loadMiddlewareManifest(page, 'pages')\n } else {\n manifestLoader.deleteMiddlewareManifest(key)\n }\n await manifestLoader.loadLoadableManifest(page, 'pages')\n\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints,\n })\n\n processIssues(currentEntryIssues, key, writtenEndpoint, true, logErrors)\n\n break\n }\n case 'app-page': {\n const key = getEntryKey('app', 'server', page)\n\n const writtenEndpoint = await route.htmlEndpoint.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n\n if (dev) {\n // TODO subscriptions should only be caused by the WebSocket connections\n // otherwise we don't known when to unsubscribe and this leaking\n hooks?.subscribeToChanges(\n key,\n true,\n route.rscEndpoint,\n (change) => {\n if (change.issues.some((issue) => issue.severity === 'error')) {\n // Ignore any updates that has errors\n // There will be another update without errors eventually\n return\n }\n // Report the next compilation again\n readyIds?.delete(pathname)\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.SERVER_COMPONENT_CHANGES,\n }\n },\n () => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.SERVER_COMPONENT_CHANGES,\n }\n }\n )\n }\n\n const type = writtenEndpoint.type\n\n if (type === 'edge') {\n await manifestLoader.loadMiddlewareManifest(page, 'app')\n } else {\n manifestLoader.deleteMiddlewareManifest(key)\n }\n\n await manifestLoader.loadAppBuildManifest(page)\n await manifestLoader.loadBuildManifest(page, 'app')\n await manifestLoader.loadAppPathsManifest(page)\n await manifestLoader.loadActionManifest(page)\n await manifestLoader.loadLoadableManifest(page, 'app')\n await manifestLoader.loadFontManifest(page, 'app')\n\n if (shouldCreateWebpackStats) {\n await manifestLoader.loadWebpackStats(page, 'app')\n }\n\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints,\n })\n\n processIssues(currentEntryIssues, key, writtenEndpoint, dev, logErrors)\n\n break\n }\n case 'app-route': {\n const key = getEntryKey('app', 'server', page)\n\n const writtenEndpoint = await route.endpoint.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n\n const type = writtenEndpoint.type\n\n await manifestLoader.loadAppPathsManifest(page)\n\n if (type === 'edge') {\n await manifestLoader.loadMiddlewareManifest(page, 'app')\n } else {\n manifestLoader.deleteMiddlewareManifest(key)\n }\n\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints,\n })\n processIssues(currentEntryIssues, key, writtenEndpoint, true, logErrors)\n\n break\n }\n default: {\n throw new Error(`unknown route type ${(route as any).type} for ${page}`)\n }\n }\n}\n\n/**\n * Maintains a mapping between entrypoins and the corresponding client asset paths.\n */\nexport class AssetMapper {\n private entryMap: Map<EntryKey, Set<string>> = new Map()\n private assetMap: Map<string, Set<EntryKey>> = new Map()\n\n /**\n * Overrides asset paths for a key and updates the mapping from path to key.\n *\n * @param key\n * @param assetPaths asset paths relative to the .next directory\n */\n setPathsForKey(key: EntryKey, assetPaths: string[]): void {\n this.delete(key)\n\n const newAssetPaths = new Set(assetPaths)\n this.entryMap.set(key, newAssetPaths)\n\n for (const assetPath of newAssetPaths) {\n let assetPathKeys = this.assetMap.get(assetPath)\n if (!assetPathKeys) {\n assetPathKeys = new Set()\n this.assetMap.set(assetPath, assetPathKeys)\n }\n\n assetPathKeys!.add(key)\n }\n }\n\n /**\n * Deletes the key and any asset only referenced by this key.\n *\n * @param key\n */\n delete(key: EntryKey) {\n for (const assetPath of this.getAssetPathsByKey(key)) {\n const assetPathKeys = this.assetMap.get(assetPath)\n\n assetPathKeys?.delete(key)\n\n if (!assetPathKeys?.size) {\n this.assetMap.delete(assetPath)\n }\n }\n\n this.entryMap.delete(key)\n }\n\n getAssetPathsByKey(key: EntryKey): string[] {\n return Array.from(this.entryMap.get(key) ?? [])\n }\n\n getKeysByAsset(path: string): EntryKey[] {\n return Array.from(this.assetMap.get(path) ?? [])\n }\n\n keys(): IterableIterator<EntryKey> {\n return this.entryMap.keys()\n }\n}\n\nexport function hasEntrypointForKey(\n entrypoints: Entrypoints,\n key: EntryKey,\n assetMapper: AssetMapper | undefined\n): boolean {\n const { type, page } = splitEntryKey(key)\n\n switch (type) {\n case 'app':\n return entrypoints.app.has(page)\n case 'pages':\n switch (page) {\n case '_app':\n return entrypoints.global.app != null\n case '_document':\n return entrypoints.global.document != null\n case '_error':\n return entrypoints.global.error != null\n default:\n return entrypoints.page.has(page)\n }\n case 'root':\n switch (page) {\n case 'middleware':\n return entrypoints.global.middleware != null\n case 'instrumentation':\n return entrypoints.global.instrumentation != null\n default:\n return false\n }\n case 'assets':\n if (!assetMapper) {\n return false\n }\n\n return assetMapper\n .getKeysByAsset(page)\n .some((pageKey) =>\n hasEntrypointForKey(entrypoints, pageKey, assetMapper)\n )\n default: {\n // validation that we covered all cases, this should never run.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _: never = type\n return false\n }\n }\n}\n\n// hooks only used by the dev server.\ntype HandleEntrypointsHooks = {\n handleWrittenEndpoint: HandleWrittenEndpoint\n propagateServerField: (\n field: PropagateToWorkersField,\n args: any\n ) => Promise<void>\n sendHmr: SendHmr\n startBuilding: StartBuilding\n subscribeToChanges: StartChangeSubscription\n unsubscribeFromChanges: StopChangeSubscription\n unsubscribeFromHmrEvents: (client: ws, id: string) => void\n}\n\ntype HandleEntrypointsDevOpts = {\n assetMapper: AssetMapper\n changeSubscriptions: ChangeSubscriptions\n clients: Set<ws>\n clientStates: ClientStateMap\n serverFields: ServerFields\n\n hooks: HandleEntrypointsHooks\n}\n\nexport async function handleEntrypoints({\n entrypoints,\n\n currentEntrypoints,\n\n currentEntryIssues,\n manifestLoader,\n devRewrites,\n productionRewrites,\n logErrors,\n dev,\n}: {\n entrypoints: TurbopackResult<RawEntrypoints>\n\n currentEntrypoints: Entrypoints\n\n currentEntryIssues: EntryIssuesMap\n manifestLoader: TurbopackManifestLoader\n devRewrites: SetupOpts['fsChecker']['rewrites'] | undefined\n productionRewrites: CustomRoutes['rewrites'] | undefined\n logErrors: boolean\n\n dev?: HandleEntrypointsDevOpts\n}) {\n currentEntrypoints.global.app = entrypoints.pagesAppEndpoint\n currentEntrypoints.global.document = entrypoints.pagesDocumentEndpoint\n currentEntrypoints.global.error = entrypoints.pagesErrorEndpoint\n\n currentEntrypoints.global.instrumentation = entrypoints.instrumentation\n\n currentEntrypoints.page.clear()\n currentEntrypoints.app.clear()\n\n for (const [pathname, route] of entrypoints.routes) {\n switch (route.type) {\n case 'page':\n case 'page-api':\n currentEntrypoints.page.set(pathname, route)\n break\n case 'app-page': {\n route.pages.forEach((page) => {\n currentEntrypoints.app.set(page.originalName, {\n type: 'app-page',\n ...page,\n })\n })\n break\n }\n case 'app-route': {\n currentEntrypoints.app.set(route.originalName, route)\n break\n }\n default:\n Log.info(`skipping ${pathname} (${route.type})`)\n break\n }\n }\n\n if (dev) {\n await handleEntrypointsDevCleanup({\n currentEntryIssues,\n currentEntrypoints,\n\n ...dev,\n })\n }\n\n const { middleware, instrumentation } = entrypoints\n\n // We check for explicit true/false, since it's initialized to\n // undefined during the first loop (middlewareChanges event is\n // unnecessary during the first serve)\n if (currentEntrypoints.global.middleware && !middleware) {\n const key = getEntryKey('root', 'server', 'middleware')\n // Went from middleware to no middleware\n await dev?.hooks.unsubscribeFromChanges(key)\n currentEntryIssues.delete(key)\n dev?.hooks.sendHmr('middleware', {\n event: HMR_ACTIONS_SENT_TO_BROWSER.MIDDLEWARE_CHANGES,\n })\n } else if (!currentEntrypoints.global.middleware && middleware) {\n // Went from no middleware to middleware\n dev?.hooks.sendHmr('middleware', {\n event: HMR_ACTIONS_SENT_TO_BROWSER.MIDDLEWARE_CHANGES,\n })\n }\n\n currentEntrypoints.global.middleware = middleware\n\n if (instrumentation) {\n const processInstrumentation = async (\n name: string,\n prop: 'nodeJs' | 'edge'\n ) => {\n const key = getEntryKey('root', 'server', name)\n\n const writtenEndpoint = await instrumentation[prop].writeToDisk()\n dev?.hooks.handleWrittenEndpoint(key, writtenEndpoint)\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n }\n await processInstrumentation('instrumentation.nodeJs', 'nodeJs')\n await processInstrumentation('instrumentation.edge', 'edge')\n await manifestLoader.loadMiddlewareManifest(\n 'instrumentation',\n 'instrumentation'\n )\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints: currentEntrypoints,\n })\n\n if (dev) {\n dev.serverFields.actualInstrumentationHookFile = '/instrumentation'\n await dev.hooks.propagateServerField(\n 'actualInstrumentationHookFile',\n dev.serverFields.actualInstrumentationHookFile\n )\n }\n } else {\n if (dev) {\n dev.serverFields.actualInstrumentationHookFile = undefined\n await dev.hooks.propagateServerField(\n 'actualInstrumentationHookFile',\n dev.serverFields.actualInstrumentationHookFile\n )\n }\n }\n\n if (middleware) {\n const key = getEntryKey('root', 'server', 'middleware')\n\n const endpoint = middleware.endpoint\n\n async function processMiddleware() {\n const writtenEndpoint = await endpoint.writeToDisk()\n dev?.hooks.handleWrittenEndpoint(key, writtenEndpoint)\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n await manifestLoader.loadMiddlewareManifest('middleware', 'middleware')\n if (dev) {\n dev.serverFields.middleware = {\n match: null as any,\n page: '/',\n matchers:\n manifestLoader.getMiddlewareManifest(key)?.middleware['/'].matchers,\n }\n }\n }\n await processMiddleware()\n\n if (dev) {\n dev?.hooks.subscribeToChanges(\n key,\n false,\n endpoint,\n async () => {\n const finishBuilding = dev.hooks.startBuilding(\n 'middleware',\n undefined,\n true\n )\n await processMiddleware()\n await dev.hooks.propagateServerField(\n 'actualMiddlewareFile',\n dev.serverFields.actualMiddlewareFile\n )\n await dev.hooks.propagateServerField(\n 'middleware',\n dev.serverFields.middleware\n )\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints: currentEntrypoints,\n })\n\n finishBuilding?.()\n return { event: HMR_ACTIONS_SENT_TO_BROWSER.MIDDLEWARE_CHANGES }\n },\n () => {\n return {\n event: HMR_ACTIONS_SENT_TO_BROWSER.MIDDLEWARE_CHANGES,\n }\n }\n )\n }\n } else {\n manifestLoader.deleteMiddlewareManifest(\n getEntryKey('root', 'server', 'middleware')\n )\n if (dev) {\n dev.serverFields.actualMiddlewareFile = undefined\n dev.serverFields.middleware = undefined\n }\n }\n\n if (dev) {\n await dev.hooks.propagateServerField(\n 'actualMiddlewareFile',\n dev.serverFields.actualMiddlewareFile\n )\n await dev.hooks.propagateServerField(\n 'middleware',\n dev.serverFields.middleware\n )\n }\n}\n\nasync function handleEntrypointsDevCleanup({\n currentEntryIssues,\n currentEntrypoints,\n\n assetMapper,\n changeSubscriptions,\n clients,\n clientStates,\n\n hooks,\n}: {\n currentEntrypoints: Entrypoints\n currentEntryIssues: EntryIssuesMap\n} & HandleEntrypointsDevOpts) {\n // this needs to be first as `hasEntrypointForKey` uses the `assetMapper`\n for (const key of assetMapper.keys()) {\n if (!hasEntrypointForKey(currentEntrypoints, key, assetMapper)) {\n assetMapper.delete(key)\n }\n }\n\n for (const key of changeSubscriptions.keys()) {\n // middleware is handled separately\n if (!hasEntrypointForKey(currentEntrypoints, key, assetMapper)) {\n await hooks.unsubscribeFromChanges(key)\n }\n }\n\n for (const [key] of currentEntryIssues) {\n if (!hasEntrypointForKey(currentEntrypoints, key, assetMapper)) {\n currentEntryIssues.delete(key)\n }\n }\n\n for (const client of clients) {\n const state = clientStates.get(client)\n if (!state) {\n continue\n }\n\n for (const key of state.clientIssues.keys()) {\n if (!hasEntrypointForKey(currentEntrypoints, key, assetMapper)) {\n state.clientIssues.delete(key)\n }\n }\n\n for (const id of state.subscriptions.keys()) {\n if (\n !hasEntrypointForKey(\n currentEntrypoints,\n getEntryKey('assets', 'client', id),\n assetMapper\n )\n ) {\n hooks.unsubscribeFromHmrEvents(client, id)\n }\n }\n }\n}\n\nexport async function handlePagesErrorRoute({\n dev,\n currentEntryIssues,\n entrypoints,\n manifestLoader,\n devRewrites,\n productionRewrites,\n logErrors,\n\n hooks,\n}: {\n dev: boolean\n currentEntryIssues: EntryIssuesMap\n entrypoints: Entrypoints\n manifestLoader: TurbopackManifestLoader\n devRewrites: SetupOpts['fsChecker']['rewrites'] | undefined\n productionRewrites: CustomRoutes['rewrites'] | undefined\n logErrors: boolean\n\n hooks?: HandleRouteTypeHooks // dev\n}) {\n if (entrypoints.global.app) {\n const key = getEntryKey('pages', 'server', '_app')\n\n const writtenEndpoint = await entrypoints.global.app.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n if (dev) {\n hooks?.subscribeToChanges(\n key,\n false,\n entrypoints.global.app,\n () => {\n // There's a special case for this in `../client/page-bootstrap.ts`.\n // https://github.com/vercel/next.js/blob/08d7a7e5189a835f5dcb82af026174e587575c0e/packages/next/src/client/page-bootstrap.ts#L69-L71\n return { event: HMR_ACTIONS_SENT_TO_BROWSER.CLIENT_CHANGES }\n },\n () => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: '_app has changed (error route)',\n }\n }\n )\n }\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n }\n await manifestLoader.loadBuildManifest('_app')\n await manifestLoader.loadPagesManifest('_app')\n await manifestLoader.loadFontManifest('_app')\n\n if (entrypoints.global.document) {\n const key = getEntryKey('pages', 'server', '_document')\n\n const writtenEndpoint = await entrypoints.global.document.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n if (dev) {\n hooks?.subscribeToChanges(\n key,\n false,\n entrypoints.global.document,\n () => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: '_document has changed (error route)',\n }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in _document subscription (error route): ${e}`,\n }\n }\n )\n }\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n }\n await manifestLoader.loadPagesManifest('_document')\n\n if (entrypoints.global.error) {\n const key = getEntryKey('pages', 'server', '_error')\n\n const writtenEndpoint = await entrypoints.global.error.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n if (dev) {\n hooks?.subscribeToChanges(\n key,\n false,\n entrypoints.global.error,\n () => {\n // There's a special case for this in `../client/page-bootstrap.ts`.\n // https://github.com/vercel/next.js/blob/08d7a7e5189a835f5dcb82af026174e587575c0e/packages/next/src/client/page-bootstrap.ts#L69-L71\n return { event: HMR_ACTIONS_SENT_TO_BROWSER.CLIENT_CHANGES }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in _error subscription: ${e}`,\n }\n }\n )\n }\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n }\n await manifestLoader.loadBuildManifest('_error')\n await manifestLoader.loadPagesManifest('_error')\n await manifestLoader.loadFontManifest('_error')\n\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints,\n })\n}\n\nexport function removeRouteSuffix(route: string): string {\n return route.replace(/\\/route$/, '')\n}\n\nexport function addRouteSuffix(route: string): string {\n return route + '/route'\n}\n\nexport function addMetadataIdToRoute(route: string): string {\n return route + '/[__metadata_id__]'\n}\n\n// Since turbopack will create app pages/route entries based on the structure,\n// which means the entry keys are based on file names.\n// But for special metadata conventions we'll change the page/pathname to a different path.\n// So we need this helper to map the new path back to original turbopack entry key.\nexport function normalizedPageToTurbopackStructureRoute(\n route: string,\n ext: string | false\n): string {\n let entrypointKey = route\n if (isMetadataRoute(entrypointKey)) {\n entrypointKey = entrypointKey.endsWith('/route')\n ? entrypointKey.slice(0, -'/route'.length)\n : entrypointKey\n\n if (ext) {\n if (entrypointKey.endsWith('/[__metadata_id__]')) {\n entrypointKey = entrypointKey.slice(0, -'/[__metadata_id__]'.length)\n }\n if (entrypointKey.endsWith('/sitemap.xml') && ext !== '.xml') {\n // For dynamic sitemap route, remove the extension\n entrypointKey = entrypointKey.slice(0, -'.xml'.length)\n }\n }\n entrypointKey = entrypointKey + '/route'\n }\n return entrypointKey\n}\n\nexport function isPersistentCachingEnabled(\n config: NextConfigComplete\n): boolean {\n const unstableValue = config.experimental.turbo?.unstablePersistentCaching\n if (typeof unstableValue === 'number' && unstableValue > 1) {\n throw new Error(\n 'Persistent caching in this version of Turbopack is not as stable as expected. Upgrade to a newer version of Turbopack to use this feature with the expected stability.'\n )\n }\n return !!unstableValue\n}\n"],"names":["loadJsConfig","decodeMagicIdentifier","MAGIC_IDENTIFIER_REGEX","bold","green","magenta","red","HMR_ACTIONS_SENT_TO_BROWSER","Log","getEntryKey","splitEntryKey","isInternal","isMetadataRoute","getTurbopackJsConfig","dir","nextConfig","jsConfig","compilerOptions","ModuleBuildError","Error","name","TurbopackInternalError","constructor","cause","message","stack","isWellKnownError","issue","title","formattedTitle","renderStyledStringToErrorAnsi","includes","onceErrorSet","Set","shouldEmitOnceWarning","severity","stage","value","has","add","printNonFatalIssue","isRelevantWarning","warn","formatIssue","isNodeModulesIssue","filePath","match","description","source","documentationLink","replace","formattedFilePath","replaceAll","range","start","line","column","content","end","codeFrameColumns","require","forceColor","trim","getIssueKey","JSON","stringify","processTopLevelIssues","currentTopLevelIssues","result","clear","issues","issueKey","set","processIssues","currentEntryIssues","key","throwIssue","logErrors","newIssues","Map","relevantIssues","formatted","error","size","join","string","decodeMagicIdentifiers","str","ident","e","type","map","MILLISECONDS_IN_NANOSECOND","BigInt","msToNs","ms","Math","floor","handleRouteType","dev","page","pathname","route","entrypoints","manifestLoader","readyIds","devRewrites","productionRewrites","hooks","shouldCreateWebpackStats","process","env","TURBOPACK_STATS","clientKey","serverKey","global","app","writtenEndpoint","writeToDisk","handleWrittenEndpoint","loadBuildManifest","loadPagesManifest","document","htmlEndpoint","loadMiddlewareManifest","deleteMiddlewareManifest","loadFontManifest","loadLoadableManifest","loadWebpackStats","writeManifests","subscribeToChanges","dataEndpoint","delete","event","SERVER_ONLY_CHANGES","pages","action","RELOAD_PAGE","data","CLIENT_CHANGES","endpoint","rscEndpoint","change","some","SERVER_COMPONENT_CHANGES","loadAppBuildManifest","loadAppPathsManifest","loadActionManifest","AssetMapper","setPathsForKey","assetPaths","newAssetPaths","entryMap","assetPath","assetPathKeys","assetMap","get","getAssetPathsByKey","Array","from","getKeysByAsset","path","keys","hasEntrypointForKey","assetMapper","middleware","instrumentation","pageKey","_","handleEntrypoints","currentEntrypoints","pagesAppEndpoint","pagesDocumentEndpoint","pagesErrorEndpoint","routes","forEach","originalName","info","handleEntrypointsDevCleanup","unsubscribeFromChanges","sendHmr","MIDDLEWARE_CHANGES","processInstrumentation","prop","serverFields","actualInstrumentationHookFile","propagateServerField","undefined","processMiddleware","matchers","getMiddlewareManifest","finishBuilding","startBuilding","actualMiddlewareFile","changeSubscriptions","clients","clientStates","client","state","clientIssues","id","subscriptions","unsubscribeFromHmrEvents","handlePagesErrorRoute","removeRouteSuffix","addRouteSuffix","addMetadataIdToRoute","normalizedPageToTurbopackStructureRoute","ext","entrypointKey","endsWith","slice","length","isPersistentCachingEnabled","config","unstableValue","experimental","turbo","unstablePersistentCaching"],"mappings":"AACA,OAAOA,kBAAkB,4BAA2B;AAcpD,SACEC,qBAAqB,EACrBC,sBAAsB,QACjB,oCAAmC;AAC1C,SAASC,IAAI,EAAEC,KAAK,EA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H,gBAAgBA,gBAAgB;IAClC;IACA,OAAOA;AACT;AAEA,OAAO,SAASI,2BACdC,MAA0B;QAEJA;IAAtB,MAAMC,iBAAgBD,6BAAAA,OAAOE,YAAY,CAACC,KAAK,qBAAzBH,2BAA2BI,yBAAyB;IAC1E,IAAI,OAAOH,kBAAkB,YAAYA,gBAAgB,GAAG;QAC1D,MAAM,IAAIpM,MACR;IAEJ;IACA,OAAO,CAAC,CAACoM;AACX"}
|
|
1
|
+
{"version":3,"sources":["../../../src/server/dev/turbopack-utils.ts"],"sourcesContent":["import type { NextConfigComplete } from '../config-shared'\nimport loadJsConfig from '../../build/load-jsconfig'\nimport type {\n ServerFields,\n SetupOpts,\n} from '../lib/router-utils/setup-dev-bundler'\nimport type {\n Issue,\n StyledString,\n TurbopackResult,\n Endpoint,\n Entrypoints as RawEntrypoints,\n Update as TurbopackUpdate,\n WrittenEndpoint,\n} from '../../build/swc/types'\nimport {\n decodeMagicIdentifier,\n MAGIC_IDENTIFIER_REGEX,\n} from '../../shared/lib/magic-identifier'\nimport { bold, green, magenta, red } from '../../lib/picocolors'\nimport {\n type HMR_ACTION_TYPES,\n HMR_ACTIONS_SENT_TO_BROWSER,\n} from './hot-reloader-types'\nimport * as Log from '../../build/output/log'\nimport type { PropagateToWorkersField } from '../lib/router-utils/types'\nimport type { TurbopackManifestLoader } from './turbopack/manifest-loader'\nimport type { AppRoute, Entrypoints, PageRoute } from './turbopack/types'\nimport {\n type EntryKey,\n getEntryKey,\n splitEntryKey,\n} from './turbopack/entry-key'\nimport type ws from 'next/dist/compiled/ws'\nimport isInternal from '../../shared/lib/is-internal'\nimport { isMetadataRoute } from '../../lib/metadata/is-metadata-route'\nimport type { CustomRoutes } from '../../lib/load-custom-routes'\n\nexport async function getTurbopackJsConfig(\n dir: string,\n nextConfig: NextConfigComplete\n) {\n const { jsConfig } = await loadJsConfig(dir, nextConfig)\n return jsConfig ?? { compilerOptions: {} }\n}\n\n// An error generated from emitted Turbopack issues. This can include build\n// errors caused by issues with user code.\nexport class ModuleBuildError extends Error {\n name = 'ModuleBuildError'\n}\n\n// An error caused by an internal issue in Turbopack. These should be written\n// to a log file and details should not be shown to the user.\nexport class TurbopackInternalError extends Error {\n name = 'TurbopackInternalError'\n\n constructor(cause: Error) {\n super(cause.message)\n this.stack = cause.stack\n }\n}\n\n/**\n * Thin stopgap workaround layer to mimic existing wellknown-errors-plugin in webpack's build\n * to emit certain type of errors into cli.\n */\nexport function isWellKnownError(issue: Issue): boolean {\n const { title } = issue\n const formattedTitle = renderStyledStringToErrorAnsi(title)\n // TODO: add more well known errors\n if (\n formattedTitle.includes('Module not found') ||\n formattedTitle.includes('Unknown module type')\n ) {\n return true\n }\n\n return false\n}\n\nconst onceErrorSet = new Set()\n/**\n * Check if given issue is a warning to be display only once.\n * This mimics behavior of get-page-static-info's warnOnce.\n * @param issue\n * @returns\n */\nfunction shouldEmitOnceWarning(issue: Issue): boolean {\n const { severity, title, stage } = issue\n if (severity === 'warning' && title.value === 'Invalid page configuration') {\n if (onceErrorSet.has(issue)) {\n return false\n }\n onceErrorSet.add(issue)\n }\n if (\n severity === 'warning' &&\n stage === 'config' &&\n renderStyledStringToErrorAnsi(issue.title).includes(\"can't be external\")\n ) {\n if (onceErrorSet.has(issue)) {\n return false\n }\n onceErrorSet.add(issue)\n }\n\n return true\n}\n\n/// Print out an issue to the console which should not block\n/// the build by throwing out or blocking error overlay.\nexport function printNonFatalIssue(issue: Issue) {\n if (isRelevantWarning(issue) && shouldEmitOnceWarning(issue)) {\n Log.warn(formatIssue(issue))\n }\n}\n\nfunction isNodeModulesIssue(issue: Issue): boolean {\n if (issue.severity === 'warning' && issue.stage === 'config') {\n // Override for the externalize issue\n // `Package foo (serverExternalPackages or default list) can't be external`\n if (\n renderStyledStringToErrorAnsi(issue.title).includes(\"can't be external\")\n ) {\n return false\n }\n }\n\n return (\n issue.severity === 'warning' &&\n issue.filePath.match(/^(?:.*[\\\\/])?node_modules(?:[\\\\/].*)?$/) !== null\n )\n}\n\nexport function isRelevantWarning(issue: Issue): boolean {\n return issue.severity === 'warning' && !isNodeModulesIssue(issue)\n}\n\nexport function formatIssue(issue: Issue) {\n const { filePath, title, description, source } = issue\n let { documentationLink } = issue\n let formattedTitle = renderStyledStringToErrorAnsi(title).replace(\n /\\n/g,\n '\\n '\n )\n\n // TODO: Use error codes to identify these\n // TODO: Generalize adapting Turbopack errors to Next.js errors\n if (formattedTitle.includes('Module not found')) {\n // For compatiblity with webpack\n // TODO: include columns in webpack errors.\n documentationLink = 'https://nextjs.org/docs/messages/module-not-found'\n }\n\n let formattedFilePath = filePath\n .replace('[project]/', './')\n .replaceAll('/./', '/')\n .replace('\\\\\\\\?\\\\', '')\n\n let message = ''\n\n if (source && source.range) {\n const { start } = source.range\n message = `${formattedFilePath}:${start.line + 1}:${\n start.column + 1\n }\\n${formattedTitle}`\n } else if (formattedFilePath) {\n message = `${formattedFilePath}\\n${formattedTitle}`\n } else {\n message = formattedTitle\n }\n message += '\\n'\n\n if (\n source?.range &&\n source.source.content &&\n // ignore Next.js/React internals, as these can often be huge bundled files.\n !isInternal(filePath)\n ) {\n const { start, end } = source.range\n const { codeFrameColumns } = require('next/dist/compiled/babel/code-frame')\n\n message +=\n codeFrameColumns(\n source.source.content,\n {\n start: {\n line: start.line + 1,\n column: start.column + 1,\n },\n end: {\n line: end.line + 1,\n column: end.column + 1,\n },\n },\n { forceColor: true }\n ).trim() + '\\n\\n'\n }\n\n if (description) {\n message += renderStyledStringToErrorAnsi(description) + '\\n\\n'\n }\n\n // TODO: make it possible to enable this for debugging, but not in tests.\n // if (detail) {\n // message += renderStyledStringToErrorAnsi(detail) + '\\n\\n'\n // }\n\n // TODO: Include a trace from the issue.\n\n if (documentationLink) {\n message += documentationLink + '\\n\\n'\n }\n\n return message\n}\n\ntype IssueKey = `${Issue['severity']}-${Issue['filePath']}-${string}-${string}`\nexport type IssuesMap = Map<IssueKey, Issue>\nexport type EntryIssuesMap = Map<EntryKey, IssuesMap>\nexport type TopLevelIssuesMap = IssuesMap\n\nfunction getIssueKey(issue: Issue): IssueKey {\n return `${issue.severity}-${issue.filePath}-${JSON.stringify(\n issue.title\n )}-${JSON.stringify(issue.description)}`\n}\n\nexport function processTopLevelIssues(\n currentTopLevelIssues: TopLevelIssuesMap,\n result: TurbopackResult\n) {\n currentTopLevelIssues.clear()\n\n for (const issue of result.issues) {\n const issueKey = getIssueKey(issue)\n currentTopLevelIssues.set(issueKey, issue)\n }\n}\n\nexport function processIssues(\n currentEntryIssues: EntryIssuesMap,\n key: EntryKey,\n result: TurbopackResult,\n throwIssue: boolean,\n logErrors: boolean\n) {\n const newIssues = new Map<IssueKey, Issue>()\n currentEntryIssues.set(key, newIssues)\n\n const relevantIssues = new Set()\n\n for (const issue of result.issues) {\n if (\n issue.severity !== 'error' &&\n issue.severity !== 'fatal' &&\n issue.severity !== 'warning'\n )\n continue\n\n const issueKey = getIssueKey(issue)\n newIssues.set(issueKey, issue)\n\n if (issue.severity !== 'warning') {\n if (throwIssue) {\n const formatted = formatIssue(issue)\n relevantIssues.add(formatted)\n }\n // if we throw the issue it will most likely get handed and logged elsewhere\n else if (logErrors && isWellKnownError(issue)) {\n const formatted = formatIssue(issue)\n Log.error(formatted)\n }\n }\n }\n\n if (relevantIssues.size && throwIssue) {\n throw new ModuleBuildError([...relevantIssues].join('\\n\\n'))\n }\n}\n\nexport function renderStyledStringToErrorAnsi(string: StyledString): string {\n function decodeMagicIdentifiers(str: string): string {\n return str.replaceAll(MAGIC_IDENTIFIER_REGEX, (ident) => {\n try {\n return magenta(`{${decodeMagicIdentifier(ident)}}`)\n } catch (e) {\n return magenta(`{${ident} (decoding failed: ${e})}`)\n }\n })\n }\n\n switch (string.type) {\n case 'text':\n return decodeMagicIdentifiers(string.value)\n case 'strong':\n return bold(red(decodeMagicIdentifiers(string.value)))\n case 'code':\n return green(decodeMagicIdentifiers(string.value))\n case 'line':\n return string.value.map(renderStyledStringToErrorAnsi).join('')\n case 'stack':\n return string.value.map(renderStyledStringToErrorAnsi).join('\\n')\n default:\n throw new Error('Unknown StyledString type', string)\n }\n}\n\nconst MILLISECONDS_IN_NANOSECOND = BigInt(1_000_000)\n\nexport function msToNs(ms: number): bigint {\n return BigInt(Math.floor(ms)) * MILLISECONDS_IN_NANOSECOND\n}\n\nexport type ChangeSubscriptions = Map<\n EntryKey,\n Promise<AsyncIterableIterator<TurbopackResult>>\n>\n\nexport type HandleWrittenEndpoint = (\n key: EntryKey,\n result: TurbopackResult<WrittenEndpoint>\n) => void\n\nexport type StartChangeSubscription = (\n key: EntryKey,\n includeIssues: boolean,\n endpoint: Endpoint,\n makePayload: (\n change: TurbopackResult\n ) => Promise<HMR_ACTION_TYPES> | HMR_ACTION_TYPES | void,\n onError?: (e: Error) => Promise<HMR_ACTION_TYPES> | HMR_ACTION_TYPES | void\n) => Promise<void>\n\nexport type StopChangeSubscription = (key: EntryKey) => Promise<void>\n\nexport type SendHmr = (id: string, payload: HMR_ACTION_TYPES) => void\n\nexport type StartBuilding = (\n id: string,\n requestUrl: string | undefined,\n forceRebuild: boolean\n) => () => void\n\nexport type ReadyIds = Set<string>\n\nexport type ClientState = {\n clientIssues: EntryIssuesMap\n hmrPayloads: Map<string, HMR_ACTION_TYPES>\n turbopackUpdates: TurbopackUpdate[]\n subscriptions: Map<string, AsyncIterator<any>>\n}\n\nexport type ClientStateMap = WeakMap<ws, ClientState>\n\n// hooks only used by the dev server.\ntype HandleRouteTypeHooks = {\n handleWrittenEndpoint: HandleWrittenEndpoint\n subscribeToChanges: StartChangeSubscription\n}\n\nexport async function handleRouteType({\n dev,\n page,\n pathname,\n route,\n currentEntryIssues,\n entrypoints,\n manifestLoader,\n readyIds,\n devRewrites,\n productionRewrites,\n hooks,\n logErrors,\n}: {\n dev: boolean\n page: string\n pathname: string\n route: PageRoute | AppRoute\n\n currentEntryIssues: EntryIssuesMap\n entrypoints: Entrypoints\n manifestLoader: TurbopackManifestLoader\n devRewrites: SetupOpts['fsChecker']['rewrites'] | undefined\n productionRewrites: CustomRoutes['rewrites'] | undefined\n logErrors: boolean\n\n readyIds?: ReadyIds // dev\n\n hooks?: HandleRouteTypeHooks // dev\n}) {\n const shouldCreateWebpackStats = process.env.TURBOPACK_STATS != null\n\n switch (route.type) {\n case 'page': {\n const clientKey = getEntryKey('pages', 'client', page)\n const serverKey = getEntryKey('pages', 'server', page)\n\n try {\n if (entrypoints.global.app) {\n const key = getEntryKey('pages', 'server', '_app')\n\n const writtenEndpoint = await entrypoints.global.app.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n processIssues(\n currentEntryIssues,\n key,\n writtenEndpoint,\n false,\n logErrors\n )\n }\n await manifestLoader.loadBuildManifest('_app')\n await manifestLoader.loadPagesManifest('_app')\n\n if (entrypoints.global.document) {\n const key = getEntryKey('pages', 'server', '_document')\n\n const writtenEndpoint =\n await entrypoints.global.document.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n processIssues(\n currentEntryIssues,\n key,\n writtenEndpoint,\n false,\n logErrors\n )\n }\n await manifestLoader.loadPagesManifest('_document')\n\n const writtenEndpoint = await route.htmlEndpoint.writeToDisk()\n hooks?.handleWrittenEndpoint(serverKey, writtenEndpoint)\n\n const type = writtenEndpoint?.type\n\n await manifestLoader.loadBuildManifest(page)\n await manifestLoader.loadPagesManifest(page)\n if (type === 'edge') {\n await manifestLoader.loadMiddlewareManifest(page, 'pages')\n } else {\n manifestLoader.deleteMiddlewareManifest(serverKey)\n }\n await manifestLoader.loadFontManifest('/_app', 'pages')\n await manifestLoader.loadFontManifest(page, 'pages')\n await manifestLoader.loadLoadableManifest(page, 'pages')\n\n if (shouldCreateWebpackStats) {\n await manifestLoader.loadWebpackStats(page, 'pages')\n }\n\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints,\n })\n\n processIssues(\n currentEntryIssues,\n serverKey,\n writtenEndpoint,\n false,\n logErrors\n )\n } finally {\n if (dev) {\n // TODO subscriptions should only be caused by the WebSocket connections\n // otherwise we don't known when to unsubscribe and this leaking\n hooks?.subscribeToChanges(\n serverKey,\n false,\n route.dataEndpoint,\n () => {\n // Report the next compilation again\n readyIds?.delete(pathname)\n return {\n event: HMR_ACTIONS_SENT_TO_BROWSER.SERVER_ONLY_CHANGES,\n pages: [page],\n }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in ${page} data subscription: ${e}`,\n }\n }\n )\n hooks?.subscribeToChanges(\n clientKey,\n false,\n route.htmlEndpoint,\n () => {\n return {\n event: HMR_ACTIONS_SENT_TO_BROWSER.CLIENT_CHANGES,\n }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in ${page} html subscription: ${e}`,\n }\n }\n )\n if (entrypoints.global.document) {\n hooks?.subscribeToChanges(\n getEntryKey('pages', 'server', '_document'),\n false,\n entrypoints.global.document,\n () => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: '_document has changed (page route)',\n }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in _document subscription (page route): ${e}`,\n }\n }\n )\n }\n }\n }\n\n break\n }\n case 'page-api': {\n const key = getEntryKey('pages', 'server', page)\n\n const writtenEndpoint = await route.endpoint.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n\n const type = writtenEndpoint.type\n\n await manifestLoader.loadPagesManifest(page)\n if (type === 'edge') {\n await manifestLoader.loadMiddlewareManifest(page, 'pages')\n } else {\n manifestLoader.deleteMiddlewareManifest(key)\n }\n await manifestLoader.loadLoadableManifest(page, 'pages')\n\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints,\n })\n\n processIssues(currentEntryIssues, key, writtenEndpoint, true, logErrors)\n\n break\n }\n case 'app-page': {\n const key = getEntryKey('app', 'server', page)\n\n const writtenEndpoint = await route.htmlEndpoint.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n\n if (dev) {\n // TODO subscriptions should only be caused by the WebSocket connections\n // otherwise we don't known when to unsubscribe and this leaking\n hooks?.subscribeToChanges(\n key,\n true,\n route.rscEndpoint,\n (change) => {\n if (change.issues.some((issue) => issue.severity === 'error')) {\n // Ignore any updates that has errors\n // There will be another update without errors eventually\n return\n }\n // Report the next compilation again\n readyIds?.delete(pathname)\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.SERVER_COMPONENT_CHANGES,\n }\n },\n () => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.SERVER_COMPONENT_CHANGES,\n }\n }\n )\n }\n\n const type = writtenEndpoint.type\n\n if (type === 'edge') {\n await manifestLoader.loadMiddlewareManifest(page, 'app')\n } else {\n manifestLoader.deleteMiddlewareManifest(key)\n }\n\n await manifestLoader.loadAppBuildManifest(page)\n await manifestLoader.loadBuildManifest(page, 'app')\n await manifestLoader.loadAppPathsManifest(page)\n await manifestLoader.loadActionManifest(page)\n await manifestLoader.loadLoadableManifest(page, 'app')\n await manifestLoader.loadFontManifest(page, 'app')\n\n if (shouldCreateWebpackStats) {\n await manifestLoader.loadWebpackStats(page, 'app')\n }\n\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints,\n })\n\n processIssues(currentEntryIssues, key, writtenEndpoint, dev, logErrors)\n\n break\n }\n case 'app-route': {\n const key = getEntryKey('app', 'server', page)\n\n const writtenEndpoint = await route.endpoint.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n\n const type = writtenEndpoint.type\n\n await manifestLoader.loadAppPathsManifest(page)\n\n if (type === 'edge') {\n await manifestLoader.loadMiddlewareManifest(page, 'app')\n } else {\n manifestLoader.deleteMiddlewareManifest(key)\n }\n\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints,\n })\n processIssues(currentEntryIssues, key, writtenEndpoint, true, logErrors)\n\n break\n }\n default: {\n throw new Error(`unknown route type ${(route as any).type} for ${page}`)\n }\n }\n}\n\n/**\n * Maintains a mapping between entrypoins and the corresponding client asset paths.\n */\nexport class AssetMapper {\n private entryMap: Map<EntryKey, Set<string>> = new Map()\n private assetMap: Map<string, Set<EntryKey>> = new Map()\n\n /**\n * Overrides asset paths for a key and updates the mapping from path to key.\n *\n * @param key\n * @param assetPaths asset paths relative to the .next directory\n */\n setPathsForKey(key: EntryKey, assetPaths: string[]): void {\n this.delete(key)\n\n const newAssetPaths = new Set(assetPaths)\n this.entryMap.set(key, newAssetPaths)\n\n for (const assetPath of newAssetPaths) {\n let assetPathKeys = this.assetMap.get(assetPath)\n if (!assetPathKeys) {\n assetPathKeys = new Set()\n this.assetMap.set(assetPath, assetPathKeys)\n }\n\n assetPathKeys!.add(key)\n }\n }\n\n /**\n * Deletes the key and any asset only referenced by this key.\n *\n * @param key\n */\n delete(key: EntryKey) {\n for (const assetPath of this.getAssetPathsByKey(key)) {\n const assetPathKeys = this.assetMap.get(assetPath)\n\n assetPathKeys?.delete(key)\n\n if (!assetPathKeys?.size) {\n this.assetMap.delete(assetPath)\n }\n }\n\n this.entryMap.delete(key)\n }\n\n getAssetPathsByKey(key: EntryKey): string[] {\n return Array.from(this.entryMap.get(key) ?? [])\n }\n\n getKeysByAsset(path: string): EntryKey[] {\n return Array.from(this.assetMap.get(path) ?? [])\n }\n\n keys(): IterableIterator<EntryKey> {\n return this.entryMap.keys()\n }\n}\n\nexport function hasEntrypointForKey(\n entrypoints: Entrypoints,\n key: EntryKey,\n assetMapper: AssetMapper | undefined\n): boolean {\n const { type, page } = splitEntryKey(key)\n\n switch (type) {\n case 'app':\n return entrypoints.app.has(page)\n case 'pages':\n switch (page) {\n case '_app':\n return entrypoints.global.app != null\n case '_document':\n return entrypoints.global.document != null\n case '_error':\n return entrypoints.global.error != null\n default:\n return entrypoints.page.has(page)\n }\n case 'root':\n switch (page) {\n case 'middleware':\n return entrypoints.global.middleware != null\n case 'instrumentation':\n return entrypoints.global.instrumentation != null\n default:\n return false\n }\n case 'assets':\n if (!assetMapper) {\n return false\n }\n\n return assetMapper\n .getKeysByAsset(page)\n .some((pageKey) =>\n hasEntrypointForKey(entrypoints, pageKey, assetMapper)\n )\n default: {\n // validation that we covered all cases, this should never run.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _: never = type\n return false\n }\n }\n}\n\n// hooks only used by the dev server.\ntype HandleEntrypointsHooks = {\n handleWrittenEndpoint: HandleWrittenEndpoint\n propagateServerField: (\n field: PropagateToWorkersField,\n args: any\n ) => Promise<void>\n sendHmr: SendHmr\n startBuilding: StartBuilding\n subscribeToChanges: StartChangeSubscription\n unsubscribeFromChanges: StopChangeSubscription\n unsubscribeFromHmrEvents: (client: ws, id: string) => void\n}\n\ntype HandleEntrypointsDevOpts = {\n assetMapper: AssetMapper\n changeSubscriptions: ChangeSubscriptions\n clients: Set<ws>\n clientStates: ClientStateMap\n serverFields: ServerFields\n\n hooks: HandleEntrypointsHooks\n}\n\nexport async function handleEntrypoints({\n entrypoints,\n\n currentEntrypoints,\n\n currentEntryIssues,\n manifestLoader,\n devRewrites,\n productionRewrites,\n logErrors,\n dev,\n}: {\n entrypoints: TurbopackResult<RawEntrypoints>\n\n currentEntrypoints: Entrypoints\n\n currentEntryIssues: EntryIssuesMap\n manifestLoader: TurbopackManifestLoader\n devRewrites: SetupOpts['fsChecker']['rewrites'] | undefined\n productionRewrites: CustomRoutes['rewrites'] | undefined\n logErrors: boolean\n\n dev?: HandleEntrypointsDevOpts\n}) {\n currentEntrypoints.global.app = entrypoints.pagesAppEndpoint\n currentEntrypoints.global.document = entrypoints.pagesDocumentEndpoint\n currentEntrypoints.global.error = entrypoints.pagesErrorEndpoint\n\n currentEntrypoints.global.instrumentation = entrypoints.instrumentation\n\n currentEntrypoints.page.clear()\n currentEntrypoints.app.clear()\n\n for (const [pathname, route] of entrypoints.routes) {\n switch (route.type) {\n case 'page':\n case 'page-api':\n currentEntrypoints.page.set(pathname, route)\n break\n case 'app-page': {\n route.pages.forEach((page) => {\n currentEntrypoints.app.set(page.originalName, {\n type: 'app-page',\n ...page,\n })\n })\n break\n }\n case 'app-route': {\n currentEntrypoints.app.set(route.originalName, route)\n break\n }\n default:\n Log.info(`skipping ${pathname} (${route.type})`)\n break\n }\n }\n\n if (dev) {\n await handleEntrypointsDevCleanup({\n currentEntryIssues,\n currentEntrypoints,\n\n ...dev,\n })\n }\n\n const { middleware, instrumentation } = entrypoints\n\n // We check for explicit true/false, since it's initialized to\n // undefined during the first loop (middlewareChanges event is\n // unnecessary during the first serve)\n if (currentEntrypoints.global.middleware && !middleware) {\n const key = getEntryKey('root', 'server', 'middleware')\n // Went from middleware to no middleware\n await dev?.hooks.unsubscribeFromChanges(key)\n currentEntryIssues.delete(key)\n dev?.hooks.sendHmr('middleware', {\n event: HMR_ACTIONS_SENT_TO_BROWSER.MIDDLEWARE_CHANGES,\n })\n } else if (!currentEntrypoints.global.middleware && middleware) {\n // Went from no middleware to middleware\n dev?.hooks.sendHmr('middleware', {\n event: HMR_ACTIONS_SENT_TO_BROWSER.MIDDLEWARE_CHANGES,\n })\n }\n\n currentEntrypoints.global.middleware = middleware\n\n if (instrumentation) {\n const processInstrumentation = async (\n name: string,\n prop: 'nodeJs' | 'edge'\n ) => {\n const key = getEntryKey('root', 'server', name)\n\n const writtenEndpoint = await instrumentation[prop].writeToDisk()\n dev?.hooks.handleWrittenEndpoint(key, writtenEndpoint)\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n }\n await processInstrumentation('instrumentation.nodeJs', 'nodeJs')\n await processInstrumentation('instrumentation.edge', 'edge')\n await manifestLoader.loadMiddlewareManifest(\n 'instrumentation',\n 'instrumentation'\n )\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints: currentEntrypoints,\n })\n\n if (dev) {\n dev.serverFields.actualInstrumentationHookFile = '/instrumentation'\n await dev.hooks.propagateServerField(\n 'actualInstrumentationHookFile',\n dev.serverFields.actualInstrumentationHookFile\n )\n }\n } else {\n if (dev) {\n dev.serverFields.actualInstrumentationHookFile = undefined\n await dev.hooks.propagateServerField(\n 'actualInstrumentationHookFile',\n dev.serverFields.actualInstrumentationHookFile\n )\n }\n }\n\n if (middleware) {\n const key = getEntryKey('root', 'server', 'middleware')\n\n const endpoint = middleware.endpoint\n\n async function processMiddleware() {\n const writtenEndpoint = await endpoint.writeToDisk()\n dev?.hooks.handleWrittenEndpoint(key, writtenEndpoint)\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n await manifestLoader.loadMiddlewareManifest('middleware', 'middleware')\n if (dev) {\n dev.serverFields.middleware = {\n match: null as any,\n page: '/',\n matchers:\n manifestLoader.getMiddlewareManifest(key)?.middleware['/'].matchers,\n }\n }\n }\n await processMiddleware()\n\n if (dev) {\n dev?.hooks.subscribeToChanges(\n key,\n false,\n endpoint,\n async () => {\n const finishBuilding = dev.hooks.startBuilding(\n 'middleware',\n undefined,\n true\n )\n await processMiddleware()\n await dev.hooks.propagateServerField(\n 'actualMiddlewareFile',\n dev.serverFields.actualMiddlewareFile\n )\n await dev.hooks.propagateServerField(\n 'middleware',\n dev.serverFields.middleware\n )\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints: currentEntrypoints,\n })\n\n finishBuilding?.()\n return { event: HMR_ACTIONS_SENT_TO_BROWSER.MIDDLEWARE_CHANGES }\n },\n () => {\n return {\n event: HMR_ACTIONS_SENT_TO_BROWSER.MIDDLEWARE_CHANGES,\n }\n }\n )\n }\n } else {\n manifestLoader.deleteMiddlewareManifest(\n getEntryKey('root', 'server', 'middleware')\n )\n if (dev) {\n dev.serverFields.actualMiddlewareFile = undefined\n dev.serverFields.middleware = undefined\n }\n }\n\n if (dev) {\n await dev.hooks.propagateServerField(\n 'actualMiddlewareFile',\n dev.serverFields.actualMiddlewareFile\n )\n await dev.hooks.propagateServerField(\n 'middleware',\n dev.serverFields.middleware\n )\n }\n}\n\nasync function handleEntrypointsDevCleanup({\n currentEntryIssues,\n currentEntrypoints,\n\n assetMapper,\n changeSubscriptions,\n clients,\n clientStates,\n\n hooks,\n}: {\n currentEntrypoints: Entrypoints\n currentEntryIssues: EntryIssuesMap\n} & HandleEntrypointsDevOpts) {\n // this needs to be first as `hasEntrypointForKey` uses the `assetMapper`\n for (const key of assetMapper.keys()) {\n if (!hasEntrypointForKey(currentEntrypoints, key, assetMapper)) {\n assetMapper.delete(key)\n }\n }\n\n for (const key of changeSubscriptions.keys()) {\n // middleware is handled separately\n if (!hasEntrypointForKey(currentEntrypoints, key, assetMapper)) {\n await hooks.unsubscribeFromChanges(key)\n }\n }\n\n for (const [key] of currentEntryIssues) {\n if (!hasEntrypointForKey(currentEntrypoints, key, assetMapper)) {\n currentEntryIssues.delete(key)\n }\n }\n\n for (const client of clients) {\n const state = clientStates.get(client)\n if (!state) {\n continue\n }\n\n for (const key of state.clientIssues.keys()) {\n if (!hasEntrypointForKey(currentEntrypoints, key, assetMapper)) {\n state.clientIssues.delete(key)\n }\n }\n\n for (const id of state.subscriptions.keys()) {\n if (\n !hasEntrypointForKey(\n currentEntrypoints,\n getEntryKey('assets', 'client', id),\n assetMapper\n )\n ) {\n hooks.unsubscribeFromHmrEvents(client, id)\n }\n }\n }\n}\n\nexport async function handlePagesErrorRoute({\n dev,\n currentEntryIssues,\n entrypoints,\n manifestLoader,\n devRewrites,\n productionRewrites,\n logErrors,\n\n hooks,\n}: {\n dev: boolean\n currentEntryIssues: EntryIssuesMap\n entrypoints: Entrypoints\n manifestLoader: TurbopackManifestLoader\n devRewrites: SetupOpts['fsChecker']['rewrites'] | undefined\n productionRewrites: CustomRoutes['rewrites'] | undefined\n logErrors: boolean\n\n hooks?: HandleRouteTypeHooks // dev\n}) {\n if (entrypoints.global.app) {\n const key = getEntryKey('pages', 'server', '_app')\n\n const writtenEndpoint = await entrypoints.global.app.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n if (dev) {\n hooks?.subscribeToChanges(\n key,\n false,\n entrypoints.global.app,\n () => {\n // There's a special case for this in `../client/page-bootstrap.ts`.\n // https://github.com/vercel/next.js/blob/08d7a7e5189a835f5dcb82af026174e587575c0e/packages/next/src/client/page-bootstrap.ts#L69-L71\n return { event: HMR_ACTIONS_SENT_TO_BROWSER.CLIENT_CHANGES }\n },\n () => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: '_app has changed (error route)',\n }\n }\n )\n }\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n }\n await manifestLoader.loadBuildManifest('_app')\n await manifestLoader.loadPagesManifest('_app')\n await manifestLoader.loadFontManifest('_app')\n\n if (entrypoints.global.document) {\n const key = getEntryKey('pages', 'server', '_document')\n\n const writtenEndpoint = await entrypoints.global.document.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n if (dev) {\n hooks?.subscribeToChanges(\n key,\n false,\n entrypoints.global.document,\n () => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: '_document has changed (error route)',\n }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in _document subscription (error route): ${e}`,\n }\n }\n )\n }\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n }\n await manifestLoader.loadPagesManifest('_document')\n\n if (entrypoints.global.error) {\n const key = getEntryKey('pages', 'server', '_error')\n\n const writtenEndpoint = await entrypoints.global.error.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n if (dev) {\n hooks?.subscribeToChanges(\n key,\n false,\n entrypoints.global.error,\n () => {\n // There's a special case for this in `../client/page-bootstrap.ts`.\n // https://github.com/vercel/next.js/blob/08d7a7e5189a835f5dcb82af026174e587575c0e/packages/next/src/client/page-bootstrap.ts#L69-L71\n return { event: HMR_ACTIONS_SENT_TO_BROWSER.CLIENT_CHANGES }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in _error subscription: ${e}`,\n }\n }\n )\n }\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n }\n await manifestLoader.loadBuildManifest('_error')\n await manifestLoader.loadPagesManifest('_error')\n await manifestLoader.loadFontManifest('_error')\n\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints,\n })\n}\n\nexport function removeRouteSuffix(route: string): string {\n return route.replace(/\\/route$/, '')\n}\n\nexport function addRouteSuffix(route: string): string {\n return route + '/route'\n}\n\nexport function addMetadataIdToRoute(route: string): string {\n return route + '/[__metadata_id__]'\n}\n\n// Since turbopack will create app pages/route entries based on the structure,\n// which means the entry keys are based on file names.\n// But for special metadata conventions we'll change the page/pathname to a different path.\n// So we need this helper to map the new path back to original turbopack entry key.\nexport function normalizedPageToTurbopackStructureRoute(\n route: string,\n ext: string | false\n): string {\n let entrypointKey = route\n if (isMetadataRoute(entrypointKey)) {\n entrypointKey = entrypointKey.endsWith('/route')\n ? entrypointKey.slice(0, -'/route'.length)\n : entrypointKey\n\n if (ext) {\n if (entrypointKey.endsWith('/[__metadata_id__]')) {\n entrypointKey = entrypointKey.slice(0, -'/[__metadata_id__]'.length)\n }\n if (entrypointKey.endsWith('/sitemap.xml') && ext !== '.xml') {\n // For dynamic sitemap route, remove the extension\n entrypointKey = entrypointKey.slice(0, -'.xml'.length)\n }\n }\n entrypointKey = entrypointKey + '/route'\n }\n return entrypointKey\n}\n\nexport function isPersistentCachingEnabled(\n config: NextConfigComplete\n): boolean {\n return config.experimental.turbo?.unstablePersistentCaching || false\n}\n"],"names":["loadJsConfig","decodeMagicIdentifier","MAGIC_IDENTIFIER_REGEX","bold","green","magenta","red","HMR_ACTIONS_SENT_TO_BROWSER","Log","getEntryKey","splitEntryKey","isInternal","isMetadataRoute","getTurbopackJsConfig","dir","nextConfig","jsConfig","compilerOptions","ModuleBuildError","Error","name","TurbopackInternalError","constructor","cause","message","stack","isWellKnownError","issue","title","formattedTitle","renderStyledStringToErrorAnsi","includes","onceErrorSet","Set","shouldEmitOnceWarning","severity","stage","value","has","add","printNonFatalIssue","isRelevantWarning","warn","formatIssue","isNodeModulesIssue","filePath","match","description","source","documentationLink","replace","formattedFilePath","replaceAll","range","start","line","column","content","end","codeFrameColumns","require","forceColor","trim","getIssueKey","JSON","stringify","processTopLevelIssues","currentTopLevelIssues","result","clear","issues","issueKey","set","processIssues","currentEntryIssues","key","throwIssue","logErrors","newIssues","Map","relevantIssues","formatted","error","size","join","string","decodeMagicIdentifiers","str","ident","e","type","map","MILLISECONDS_IN_NANOSECOND","BigInt","msToNs","ms","Math","floor","handleRouteType","dev","page","pathname","route","entrypoints","manifestLoader","readyIds","devRewrites","productionRewrites","hooks","shouldCreateWebpackStats","process","env","TURBOPACK_STATS","clientKey","serverKey","global","app","writtenEndpoint","writeToDisk","handleWrittenEndpoint","loadBuildManifest","loadPagesManifest","document","htmlEndpoint","loadMiddlewareManifest","deleteMiddlewareManifest","loadFontManifest","loadLoadableManifest","loadWebpackStats","writeManifests","subscribeToChanges","dataEndpoint","delete","event","SERVER_ONLY_CHANGES","pages","action","RELOAD_PAGE","data","CLIENT_CHANGES","endpoint","rscEndpoint","change","some","SERVER_COMPONENT_CHANGES","loadAppBuildManifest","loadAppPathsManifest","loadActionManifest","AssetMapper","setPathsForKey","assetPaths","newAssetPaths","entryMap","assetPath","assetPathKeys","assetMap","get","getAssetPathsByKey","Array","from","getKeysByAsset","path","keys","hasEntrypointForKey","assetMapper","middleware","instrumentation","pageKey","_","handleEntrypoints","currentEntrypoints","pagesAppEndpoint","pagesDocumentEndpoint","pagesErrorEndpoint","routes","forEach","originalName","info","handleEntrypointsDevCleanup","unsubscribeFromChanges","sendHmr","MIDDLEWARE_CHANGES","processInstrumentation","prop","serverFields","actualInstrumentationHookFile","propagateServerField","undefined","processMiddleware","matchers","getMiddlewareManifest","finishBuilding","startBuilding","actualMiddlewareFile","changeSubscriptions","clients","clientStates","client","state","clientIssues","id","subscriptions","unsubscribeFromHmrEvents","handlePagesErrorRoute","removeRouteSuffix","addRouteSuffix","addMetadataIdToRoute","normalizedPageToTurbopackStructureRoute","ext","entrypointKey","endsWith","slice","length","isPersistentCachingEnabled","config","experimental","turbo","unstablePersistentCaching"],"mappings":"AACA,OAAOA,kBAAkB,4BAA2B;AAcpD,SACEC,qBAAqB,EACrBC,sBAAsB,QACjB,oCAAmC;AAC1C,SAASC,IAAI,EAAEC,KAAK,EAAEC,OAAO,EAAEC,GAAG,QAAQ,uBAAsB;AAChE,SAEEC,2BAA2B,QACtB,uBAAsB;AAC7B,YAAYC,SAAS,yBAAwB;AAI7C,SAEEC,WAAW,EACXC,aAAa,QACR,wBAAuB;AAE9B,OAAOC,gBAAgB,+BAA8B;AACrD,SAASC,eAAe,QAAQ,uCAAsC;AAGtE,OAAO,eAAeC,qBACpBC,GAAW,EACXC,UAA8B;IAE9B,MAAM,EAAEC,QAAQ,EAAE,GAAG,MAAMhB,aAAac,KAAKC;IAC7C,OAAOC,YAAY;QAAEC,iBAAiB,CAAC;IAAE;AAC3C;AAEA,2EAA2E;AAC3E,0CAA0C;AAC1C,OAAO,MAAMC,yBAAyBC;;;aACpCC,OAAO;;AACT;AAEA,6EAA6E;AAC7E,6DAA6D;AAC7D,OAAO,MAAMC,+BAA+BF;IAG1CG,YAAYC,KAAY,CAAE;QACxB,KAAK,CAACA,MAAMC,OAAO;aAHrBJ,OAAO;QAIL,IAAI,CAACK,KAAK,GAAGF,MAAME,KAAK;IAC1B;AACF;AAEA;;;CAGC,GACD,OAAO,SAASC,iBAAiBC,KAAY;IAC3C,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAME,iBAAiBC,8BAA8BF;IACrD,mCAAmC;IACnC,IACEC,eAAeE,QAAQ,CAAC,uBACxBF,eAAeE,QAAQ,CAAC,wBACxB;QACA,OAAO;IACT;IAEA,OAAO;AACT;AAEA,MAAMC,eAAe,IAAIC;AACzB;;;;;CAKC,GACD,SA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,MAAM,IACvCH;QAEJ,IAAID,KAAK;YACP,IAAIC,cAAcC,QAAQ,CAAC,uBAAuB;gBAChDD,gBAAgBA,cAAcE,KAAK,CAAC,GAAG,CAAC,qBAAqBC,MAAM;YACrE;YACA,IAAIH,cAAcC,QAAQ,CAAC,mBAAmBF,QAAQ,QAAQ;gBAC5D,kDAAkD;gBAClDC,gBAAgBA,cAAcE,KAAK,CAAC,GAAG,CAAC,OAAOC,MAAM;YACvD;QACF;QACAH,gBAAgBA,gBAAgB;IAClC;IACA,OAAOA;AACT;AAEA,OAAO,SAASI,2BACdC,MAA0B;QAEnBA;IAAP,OAAOA,EAAAA,6BAAAA,OAAOC,YAAY,CAACC,KAAK,qBAAzBF,2BAA2BG,yBAAyB,KAAI;AACjE"}
|
|
@@ -4,7 +4,7 @@ import { bold, purple } from '../../lib/picocolors';
|
|
|
4
4
|
import { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD } from '../../shared/lib/constants';
|
|
5
5
|
import loadConfig, { getEnabledExperimentalFeatures } from '../config';
|
|
6
6
|
export function logStartInfo({ networkUrl, appUrl, envInfo, expFeatureInfo, maxExperimentalFeatures = Infinity }) {
|
|
7
|
-
Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.0.4-canary.
|
|
7
|
+
Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.0.4-canary.17"}`))}${process.env.TURBOPACK ? ' (Turbopack)' : ''}`);
|
|
8
8
|
if (appUrl) {
|
|
9
9
|
Log.bootstrap(`- Local: ${appUrl}`);
|
|
10
10
|
}
|
|
@@ -42,7 +42,7 @@ export async function getRequestHandlers({ dir, port, isDev, onCleanup, server,
|
|
|
42
42
|
export async function startServer(serverOptions) {
|
|
43
43
|
const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
|
|
44
44
|
let { port } = serverOptions;
|
|
45
|
-
process.title = `next-server (v${"15.0.4-canary.
|
|
45
|
+
process.title = `next-server (v${"15.0.4-canary.17"})`;
|
|
46
46
|
let handlersReady = ()=>{};
|
|
47
47
|
let handlersError = ()=>{};
|
|
48
48
|
let handlersPromise = new Promise((resolve, reject)=>{
|
|
@@ -115,10 +115,8 @@ export interface ExperimentalTurboOptions {
|
|
|
115
115
|
memoryLimit?: number;
|
|
116
116
|
/**
|
|
117
117
|
* Enable persistent caching for the turbopack dev server and build.
|
|
118
|
-
* Need to provide the expected level of stability, otherwise it will fail.
|
|
119
|
-
* Currently stability level: 1
|
|
120
118
|
*/
|
|
121
|
-
unstablePersistentCaching?:
|
|
119
|
+
unstablePersistentCaching?: boolean;
|
|
122
120
|
/**
|
|
123
121
|
* Enable tree shaking for the turbopack dev server and build.
|
|
124
122
|
*/
|
|
@@ -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 { ExpireTime } from './lib/revalidate'\nimport type { SupportedTestRunners } from '../cli/next-test'\nimport type { ExperimentalPPRConfig } from './lib/experimental/ppr'\nimport { INFINITE_CACHE } from '../lib/constants'\n\nexport type NextConfigComplete = Required<NextConfig> & {\n images: Required<ImageConfigComplete>\n typescript: Required<TypeScriptConfig>\n configOrigin?: string\n configFile?: string\n configFileName: string\n}\n\nexport type I18NDomains = DomainLocale[]\n\nexport interface I18NConfig {\n defaultLocale: string\n domains?: I18NDomains\n localeDetection?: false\n locales: string[]\n}\n\nexport interface DomainLocale {\n defaultLocale: string\n domain: string\n http?: true\n locales?: string[]\n}\n\nexport interface ESLintConfig {\n /** Only run ESLint on these directories with `next lint` and `next build`. */\n dirs?: string[]\n /** Do not run ESLint during production builds (`next build`). */\n ignoreDuringBuilds?: boolean\n}\n\nexport interface TypeScriptConfig {\n /** Do not run TypeScript during production builds (`next build`). */\n ignoreBuildErrors?: boolean\n /** Relative path to a custom tsconfig file */\n tsconfigPath?: string\n}\n\nexport interface EmotionConfig {\n sourceMap?: boolean\n autoLabel?: 'dev-only' | 'always' | 'never'\n labelFormat?: string\n importMap?: {\n [importName: string]: {\n [exportName: string]: {\n canonicalImport?: [string, string]\n styledBaseImport?: [string, string]\n }\n }\n }\n}\n\nexport interface StyledComponentsConfig {\n /**\n * Enabled by default in development, disabled in production to reduce file size,\n * setting this will override the default for all environments.\n */\n displayName?: boolean\n topLevelImportPaths?: string[]\n ssr?: boolean\n fileName?: boolean\n meaninglessFileNames?: string[]\n minify?: boolean\n transpileTemplateLiterals?: boolean\n namespace?: string\n pure?: boolean\n cssProp?: boolean\n}\n\ntype JSONValue =\n | string\n | number\n | boolean\n | JSONValue[]\n | { [k: string]: JSONValue }\n\nexport type TurboLoaderItem =\n | string\n | {\n loader: string\n // At the moment, Turbopack options must be JSON-serializable, so restrict values.\n options: Record<string, JSONValue>\n }\n\nexport type TurboRuleConfigItemOrShortcut =\n | TurboLoaderItem[]\n | TurboRuleConfigItem\n\nexport type TurboRuleConfigItemOptions = {\n loaders: TurboLoaderItem[]\n as?: string\n}\n\nexport type TurboRuleConfigItem =\n | TurboRuleConfigItemOptions\n | { [condition: string]: TurboRuleConfigItem }\n | false\n\nexport interface ExperimentalTurboOptions {\n /**\n * (`next --turbopack` only) A mapping of aliased imports to modules to load in their place.\n *\n * @see [Resolve Alias](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#resolve-alias)\n */\n resolveAlias?: Record<\n string,\n string | string[] | Record<string, string | string[]>\n >\n\n /**\n * (`next --turbopack` only) A list of extensions to resolve when importing files.\n *\n * @see [Resolve Extensions](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#resolve-extensions)\n */\n resolveExtensions?: string[]\n\n /**\n * (`next --turbopack` only) A list of webpack loaders to apply when running with Turbopack.\n *\n * @see [Turbopack Loaders](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#webpack-loaders)\n */\n loaders?: Record<string, TurboLoaderItem[]>\n\n /**\n * (`next --turbopack` only) A list of webpack loaders to apply when running with Turbopack.\n *\n * @see [Turbopack Loaders](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#webpack-loaders)\n */\n rules?: Record<string, TurboRuleConfigItemOrShortcut>\n\n /**\n * A target memory limit for turbo, in bytes.\n */\n memoryLimit?: number\n\n /**\n * Enable persistent caching for the turbopack dev server and build.\n * Need to provide the expected level of stability, otherwise it will fail.\n * Currently stability level: 1\n */\n unstablePersistentCaching?: number | false\n\n /**\n * Enable tree shaking for the turbopack dev server and build.\n */\n treeShaking?: boolean\n\n /**\n * The module ID strategy to use for Turbopack.\n * If not set, the default is `'named'` for development and `'deterministic'`\n * for production.\n */\n moduleIdStrategy?: 'named' | 'deterministic'\n\n /**\n * This is the repo root usually and only files above this\n * directory can be resolved by turbopack.\n */\n root?: string\n\n /**\n * Enable minification. Defaults to true in build mode and false in dev mode.\n */\n minify?: boolean\n}\n\nexport interface WebpackConfigContext {\n /** Next.js root directory */\n dir: string\n /** Indicates if the compilation will be done in development */\n dev: boolean\n /** It's `true` for server-side compilation, and `false` for client-side compilation */\n isServer: boolean\n /** The build id, used as a unique identifier between builds */\n buildId: string\n /** The next.config.js merged with default values */\n config: NextConfigComplete\n /** Default loaders used internally by Next.js */\n defaultLoaders: {\n /** Default babel-loader configuration */\n babel: any\n }\n /** Number of total Next.js pages */\n totalPages: number\n /** The webpack configuration */\n webpack: any\n /** The current server runtime */\n nextRuntime?: 'nodejs' | 'edge'\n}\n\nexport interface NextJsWebpackConfig {\n (\n /** Existing Webpack config */\n config: any,\n context: WebpackConfigContext\n ): any\n}\n\n/**\n * Set of options for the react compiler next.js\n * currently supports.\n *\n * This can be changed without breaking changes while supporting\n * react compiler in the experimental phase.\n */\nexport interface ReactCompilerOptions {\n compilationMode?: 'infer' | 'annotation' | 'all'\n panicThreshold?: 'ALL_ERRORS' | 'CRITICAL_ERRORS' | 'NONE'\n}\n\nexport interface 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\nexport interface ExperimentalConfig {\n cacheHandlers?: {\n default?: string\n remote?: string\n static?: string\n [handlerName: string]: string | undefined\n }\n multiZoneDraftMode?: boolean\n appNavFailHandling?: boolean\n flyingShuttle?: { mode?: 'full' | 'store-only' }\n prerenderEarlyExit?: boolean\n linkNoTouchStart?: boolean\n caseSensitiveRoutes?: boolean\n clientSegmentCache?: boolean\n appDocumentPreloading?: boolean\n preloadEntriesOnStart?: boolean\n /** @default true */\n strictNextHead?: boolean\n clientRouterFilter?: boolean\n clientRouterFilterRedirects?: boolean\n /**\n * This config can be used to override the cache behavior for the client router.\n * These values indicate the time, in seconds, that the cache should be considered\n * reusable. When the `prefetch` Link prop is left unspecified, this will use the `dynamic` value.\n * When the `prefetch` Link prop is set to `true`, this will use the `static` value.\n */\n staleTimes?: {\n dynamic?: number\n static?: number\n }\n cacheLife?: {\n [profile: string]: {\n // How long the client can cache a value without checking with the server.\n stale?: number\n // How frequently you want the cache to refresh on the server.\n // Stale values may be served while revalidating.\n revalidate?: number\n // In the worst case scenario, where you haven't had traffic in a while,\n // how stale can a value be until you prefer deopting to dynamic.\n // Must be longer than revalidate.\n expire?: number\n }\n }\n // decimal for percent for possible false positives\n // e.g. 0.01 for 10% potential false matches lower\n // percent increases size of the filter\n clientRouterFilterAllowedRate?: number\n externalMiddlewareRewritesResolve?: boolean\n extensionAlias?: Record<string, any>\n allowedRevalidateHeaderKeys?: string[]\n fetchCacheKeyPrefix?: string\n imgOptConcurrency?: number | null\n imgOptTimeoutInSeconds?: number\n imgOptMaxInputPixels?: number\n imgOptSequentialRead?: boolean | null\n optimisticClientCache?: boolean\n /**\n * @deprecated use config.expireTime instead\n */\n expireTime?: ExpireTime\n middlewarePrefetch?: 'strict' | 'flexible'\n manualClientBasePath?: boolean\n /**\n * CSS Chunking strategy. Defaults to 'loose', 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?: 'strict' | 'loose'\n disablePostcssPresetEnv?: boolean\n cpus?: number\n memoryBasedWorkersCount?: boolean\n proxyTimeout?: number\n isrFlushToDisk?: boolean\n workerThreads?: boolean\n // optimizeCss can be boolean or critters' option object\n // Use Record<string, unknown> as critters doesn't export its Option type\n // https://github.com/GoogleChromeLabs/critters/blob/a590c05f9197b656d2aeaae9369df2483c26b072/packages/critters/src/index.d.ts\n optimizeCss?: boolean | Record<string, unknown>\n nextScriptWorkers?: boolean\n scrollRestoration?: boolean\n externalDir?: boolean\n amp?: {\n optimizer?: any\n validator?: string\n skipValidation?: boolean\n }\n disableOptimizedLoading?: boolean\n gzipSize?: boolean\n craCompat?: boolean\n esmExternals?: boolean | 'loose'\n fullySpecified?: boolean\n urlImports?: NonNullable<webpack.Configuration['experiments']>['buildHttp']\n swcTraceProfiling?: boolean\n forceSwcTransforms?: boolean\n\n swcPlugins?: Array<[string, Record<string, unknown>]>\n largePageDataBytes?: number\n /**\n * If set to `false`, webpack won't fall back to polyfill Node.js modules in the browser\n * Full list of old polyfills is accessible here:\n * [webpack/webpack#ModuleNotoundError.js#L13-L42](https://github.com/webpack/webpack/blob/2a0536cf510768111a3a6dceeb14cb79b9f59273/lib/ModuleNotFoundError.js#L13-L42)\n */\n fallbackNodePolyfills?: false\n sri?: {\n algorithm?: SubresourceIntegrityAlgorithm\n }\n\n webVitalsAttribution?: Array<(typeof WEB_VITALS)[number]>\n\n /**\n * Automatically apply the \"modularizeImports\" optimization to imports of the specified packages.\n */\n optimizePackageImports?: string[]\n\n /**\n * Optimize React APIs for server builds.\n */\n optimizeServerReact?: boolean\n\n turbo?: ExperimentalTurboOptions\n\n /**\n * For use with `@next/mdx`. Compile MDX files using the new Rust compiler.\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/mdxRs\n */\n mdxRs?:\n | boolean\n | {\n development?: boolean\n jsx?: boolean\n jsxRuntime?: string\n jsxImportSource?: string\n providerImportSource?: string\n mdxType?: 'gfm' | 'commonmark'\n }\n\n /**\n * Generate Route types and enable type checking for Link and Router.push, etc.\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/typedRoutes\n */\n typedRoutes?: boolean\n\n /**\n * Enable type-checking and autocompletion for environment variables.\n *\n * @default false\n */\n typedEnv?: boolean\n\n /**\n * Runs the compilations for server and edge in parallel instead of in serial.\n * This will make builds faster if there is enough server and edge functions\n * in the application at the cost of more memory.\n *\n * NOTE: This option is only valid when the build process can use workers. See\n * the documentation for `webpackBuildWorker` for more details.\n */\n parallelServerCompiles?: boolean\n\n /**\n * Runs the logic to collect build traces for the server routes in parallel\n * with other work during the compilation. This will increase the speed of\n * the build at the cost of more memory. This option may incur some additional\n * work compared to if the option was disabled since the work is started\n * before data from the client compilation is available to potentially reduce\n * the amount of code that needs to be traced. Despite that, this may still\n * result in faster builds for some applications.\n *\n * Valid values are:\n * - `true`: Collect the server build traces in parallel.\n * - `false`: Do not collect the server build traces in parallel.\n * - `undefined`: Collect server build traces in parallel only in the `experimental-compile` mode.\n *\n * NOTE: This option is only valid when the build process can use workers. See\n * the documentation for `webpackBuildWorker` for more details.\n */\n parallelServerBuildTraces?: boolean\n\n /**\n * Run the Webpack build in a separate process to optimize memory usage during build.\n * Valid values are:\n * - `false`: Disable the Webpack build worker\n * - `true`: Enable the Webpack build worker\n * - `undefined`: Enable the Webpack build worker only if the webpack config is not customized\n */\n webpackBuildWorker?: boolean\n\n /**\n * Enables optimizations to reduce memory usage in Webpack. This reduces the max size of the heap\n * but may increase compile times slightly.\n * Valid values are:\n * - `false`: Disable Webpack memory optimizations (default).\n * - `true`: Enables Webpack memory optimizations.\n */\n webpackMemoryOptimizations?: boolean\n\n /**\n * The array of the meta tags to the client injected by tracing propagation data.\n */\n clientTraceMetadata?: string[]\n\n /**\n * Enables experimental Partial Prerendering feature of Next.js.\n * Using this feature will enable the `react@experimental` for the `app` directory.\n */\n ppr?: ExperimentalPPRConfig\n\n /**\n * Enables experimental taint APIs in React.\n * Using this feature will enable the `react@experimental` for the `app` directory.\n */\n taint?: boolean\n\n /**\n * Enables leveraging experimental captureOwnerStack API in React,\n * to create a better stack trace for React errors.\n */\n reactOwnerStack?: boolean\n\n serverActions?: {\n /**\n * Allows adjusting body parser size limit for server actions.\n */\n bodySizeLimit?: SizeLimit\n\n /**\n * Allowed origins that can bypass Server Action's CSRF check. This is helpful\n * when you have reverse proxy in front of your app.\n * @example\n * [\"my-app.com\", \"*.my-app.com\"]\n */\n allowedOrigins?: string[]\n }\n\n /**\n * enables the minification of server code.\n */\n serverMinification?: boolean\n\n /**\n * Enables source maps generation for the server production bundle.\n */\n serverSourceMaps?: boolean\n\n /**\n * @internal Used by the Next.js internals only.\n */\n trustHostHeader?: boolean\n\n useWasmBinary?: boolean\n\n /**\n * Use lightningcss instead of postcss-loader\n */\n useLightningcss?: boolean\n\n /**\n * Enables early import feature for app router modules\n */\n useEarlyImport?: boolean\n\n /**\n * Enables `fetch` requests to be proxied to the experimental test proxy server\n */\n testProxy?: boolean\n\n /**\n * Set a default test runner to be used by `next experimental-test`.\n */\n defaultTestRunner?: SupportedTestRunners\n /**\n * Allow NODE_ENV=development even for `next build`.\n */\n allowDevelopmentBuild?: true\n /**\n * @deprecated use `config.bundlePagesRouterDependencies` instead\n *\n */\n bundlePagesExternals?: boolean\n /**\n * @deprecated use `config.serverExternalPackages` instead\n *\n */\n serverComponentsExternalPackages?: string[]\n /**\n * Enable experimental React compiler optimization.\n * Configuration accepts partial config object to the compiler, if provided\n * compiler will be enabled.\n */\n reactCompiler?: boolean | ReactCompilerOptions\n\n /**\n * Enables `unstable_after`\n */\n after?: 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.\n */\n dynamicIO?: boolean\n}\n\nexport type ExportPathMap = {\n [path: string]: {\n page: string\n query?: NextParsedUrlQuery\n\n /**\n * The parameters that are currently unknown.\n *\n * @internal\n */\n _fallbackRouteParams?: readonly string[]\n\n /**\n * @internal\n */\n _isAppDir?: boolean\n\n /**\n * @internal\n */\n _isDynamicError?: boolean\n\n /**\n * @internal\n */\n _isRoutePPREnabled?: boolean\n\n /**\n * When true, it indicates that this page is being rendered in an attempt to\n * discover if the page will be safe to generate with PPR. This is only\n * enabled when the app has `experimental.dynamicIO` enabled but does not\n * have `experimental.ppr` enabled.\n *\n * @internal\n */\n _isProspectiveRender?: boolean\n }\n}\n\n/**\n * Next.js can be configured through a `next.config.js` file in the root of your project directory.\n *\n * This can change the behavior, enable experimental features, and configure other advanced options.\n *\n * Read more: [Next.js Docs: `next.config.js`](https://nextjs.org/docs/api-reference/next.config.js/introduction)\n */\nexport interface NextConfig extends Record<string, any> {\n exportPathMap?: (\n defaultMap: ExportPathMap,\n ctx: {\n dev: boolean\n dir: string\n outDir: string | null\n distDir: string\n buildId: string\n }\n ) => Promise<ExportPathMap> | ExportPathMap\n\n /**\n * Internationalization configuration\n *\n * @see [Internationalization docs](https://nextjs.org/docs/advanced-features/i18n-routing)\n */\n i18n?: I18NConfig | null\n\n /**\n * @since version 11\n * @see [ESLint configuration](https://nextjs.org/docs/app/api-reference/config/eslint)\n */\n eslint?: ESLintConfig\n\n /**\n * @see [Next.js TypeScript documentation](https://nextjs.org/docs/app/api-reference/config/typescript)\n */\n typescript?: TypeScriptConfig\n\n /**\n * Headers allow you to set custom HTTP headers for an incoming request path.\n *\n * @see [Headers configuration documentation](https://nextjs.org/docs/api-reference/next.config.js/headers)\n */\n headers?: () => Promise<Header[]>\n\n /**\n * Rewrites allow you to map an incoming request path to a different destination path.\n *\n * @see [Rewrites configuration documentation](https://nextjs.org/docs/api-reference/next.config.js/rewrites)\n */\n rewrites?: () => Promise<\n | Rewrite[]\n | {\n beforeFiles: Rewrite[]\n afterFiles: Rewrite[]\n fallback: Rewrite[]\n }\n >\n\n /**\n * Redirects allow you to redirect an incoming request path to a different destination path.\n *\n * @see [Redirects configuration documentation](https://nextjs.org/docs/api-reference/next.config.js/redirects)\n */\n redirects?: () => Promise<Redirect[]>\n\n /**\n * @see [Moment.js locales excluded by default](https://nextjs.org/docs/upgrading#momentjs-locales-excluded-by-default)\n */\n excludeDefaultMomentLocales?: boolean\n\n /**\n * Before continuing to add custom webpack configuration to your application make sure Next.js doesn't already support your use-case\n *\n * @see [Custom Webpack Config documentation](https://nextjs.org/docs/api-reference/next.config.js/custom-webpack-config)\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/api-reference/next.config.js/trailing-slash)\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/api-reference/next.config.js/environment-variables)\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/api-reference/next.config.js/cdn-support-with-asset-prefix)\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/api-reference/next.config.js/configuring-the-build-id)\n */\n generateBuildId?: () => string | null | Promise<string | null>\n\n /** @see [Disabling ETag Configuration](https://nextjs.org/docs/api-reference/next.config.js/disabling-etag-generation) */\n generateEtags?: boolean\n\n /** @see [Including non-page files in the pages directory](https://nextjs.org/docs/api-reference/next.config.js/custom-page-extensions) */\n pageExtensions?: string[]\n\n /** @see [Compression documentation](https://nextjs.org/docs/api-reference/next.config.js/compression) */\n compress?: boolean\n\n /** @see [Disabling x-powered-by](https://nextjs.org/docs/api-reference/next.config.js/disabling-x-powered-by) */\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 /** Show \"building...\"\" indicator in development */\n buildActivity?: boolean\n /** Position of \"building...\" indicator in browser */\n buildActivityPosition?:\n | 'bottom-right'\n | 'bottom-left'\n | 'top-right'\n | 'top-left'\n\n appIsrStatus?: boolean\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/api-reference/next.config.js/configuring-onDemandEntries)\n */\n onDemandEntries?: {\n /** period (in ms) where the server will keep pages in the buffer */\n maxInactiveAge?: number\n /** number of pages that should be kept simultaneously without being disposed */\n pagesBufferLength?: number\n }\n\n /** @see [`next/amp`](https://nextjs.org/docs/api-reference/next/amp) */\n amp?: {\n canonicalBase?: string\n }\n\n /**\n * A unique identifier for a deployment that will be included in each request's query string or header.\n */\n deploymentId?: string\n\n /**\n * Deploy a Next.js application under a sub-path of a domain\n *\n * @see [Base path configuration](https://nextjs.org/docs/api-reference/next.config.js/basepath)\n */\n basePath?: string\n\n /** @see [Customizing sass options](https://nextjs.org/docs/app/api-reference/next-config-js/sassOptions) */\n sassOptions?: {\n implementation?: string\n [key: string]: any\n }\n\n /**\n * Enable browser source map generation during the production build\n *\n * @see [Source Maps](https://nextjs.org/docs/advanced-features/source-maps)\n */\n productionBrowserSourceMaps?: boolean\n\n /**\n * Enable react profiling in production\n *\n */\n reactProductionProfiling?: boolean\n\n /**\n * The Next.js runtime is Strict Mode-compliant.\n *\n * @see [React Strict Mode](https://nextjs.org/docs/api-reference/next.config.js/react-strict-mode)\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/api-reference/next.config.js/react-max-headers-length)\n */\n reactMaxHeadersLength?: number\n\n /**\n * Add public (in browser) runtime configuration to your app\n *\n * @see [Runtime configuration](https://nextjs.org/docs/api-reference/next.config.js/runtime-configuration)\n */\n publicRuntimeConfig?: { [key: string]: any }\n\n /**\n * Add server runtime configuration to your app\n *\n * @see [Runtime configuration](https://nextjs.org/docs/api-reference/next.config.js/runtime-configuration)\n */\n serverRuntimeConfig?: { [key: string]: any }\n\n /**\n * Next.js enables HTTP Keep-Alive by default.\n * You may want to disable HTTP Keep-Alive for certain `fetch()` calls or globally.\n *\n * @see [Disabling HTTP Keep-Alive](https://nextjs.org/docs/app/api-reference/next-config-js/httpAgentOptions)\n */\n httpAgentOptions?: { keepAlive?: boolean }\n\n /**\n * Timeout after waiting to generate static pages in seconds\n *\n * @default 60\n */\n staticPageGenerationTimeout?: number\n\n /**\n * Add `\"crossorigin\"` attribute to generated `<script>` elements generated by `<Head />` or `<NextScript />` components\n *\n *\n * @see [`crossorigin` attribute documentation](https://developer.mozilla.org/docs/Web/HTML/Attributes/crossorigin)\n */\n crossOrigin?: 'anonymous' | 'use-credentials'\n\n /**\n * Optionally enable compiler transforms\n *\n * @see [Supported Compiler Options](https://nextjs.org/docs/advanced-features/compiler#supported-features)\n */\n compiler?: {\n reactRemoveProperties?:\n | boolean\n | {\n properties?: string[]\n }\n relay?: {\n src: string\n artifactDirectory?: string\n language?: 'typescript' | 'javascript' | 'flow'\n eagerEsModules?: boolean\n }\n removeConsole?:\n | boolean\n | {\n exclude?: string[]\n }\n styledComponents?: boolean | StyledComponentsConfig\n emotion?: boolean | EmotionConfig\n\n styledJsx?:\n | boolean\n | {\n useLightningcss?: boolean\n }\n\n /**\n * Replaces variables in your code during compile time. Each key will be\n * replaced with the respective values.\n */\n define?: Record<string, string>\n }\n\n /**\n * The type of build output.\n * - `undefined`: The default build output, `.next` directory, that works with production mode `next start` or a hosting provider like Vercel\n * - `'standalone'`: A standalone build output, `.next/standalone` directory, that only includes necessary files/dependencies. Useful for self-hosting in a Docker container.\n * - `'export'`: An exported build output, `out` directory, that only includes static HTML/CSS/JS. Useful for self-hosting without a Node.js server.\n * @see [Output File Tracing](https://nextjs.org/docs/advanced-features/output-file-tracing)\n * @see [Static HTML Export](https://nextjs.org/docs/advanced-features/static-html-export)\n */\n output?: 'standalone' | 'export'\n\n /**\n * Automatically transpile and bundle dependencies from local packages (like monorepos) or from external dependencies (`node_modules`). This replaces the\n * `next-transpile-modules` package.\n * @see [transpilePackages](https://nextjs.org/docs/advanced-features/compiler#module-transpilation)\n */\n transpilePackages?: string[]\n\n skipMiddlewareUrlNormalize?: boolean\n\n skipTrailingSlashRedirect?: boolean\n\n modularizeImports?: Record<\n string,\n {\n transform: string | Record<string, string>\n preventFullImport?: boolean\n skipDefaultConversion?: boolean\n }\n >\n\n logging?: LoggingConfig | false\n\n /**\n * period (in seconds) where the server allow to serve stale cache\n */\n expireTime?: ExpireTime\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\nexport const defaultConfig: NextConfig = {\n env: {},\n webpack: null,\n eslint: {\n ignoreDuringBuilds: false,\n },\n typescript: {\n ignoreBuildErrors: false,\n tsconfigPath: 'tsconfig.json',\n },\n distDir: '.next',\n cleanDistDir: true,\n assetPrefix: '',\n cacheHandler: process.env.NEXT_CACHE_HANDLER_PATH,\n // default to 50MB limit\n cacheMaxMemorySize: 50 * 1024 * 1024,\n configOrigin: 'default',\n useFileSystemPublicRoutes: true,\n generateBuildId: () => null,\n generateEtags: true,\n pageExtensions: ['tsx', 'ts', 'jsx', 'js'],\n poweredByHeader: true,\n compress: true,\n images: imageConfigDefault,\n devIndicators: {\n appIsrStatus: true,\n buildActivity: true,\n buildActivityPosition: 'bottom-right',\n },\n onDemandEntries: {\n maxInactiveAge: 60 * 1000,\n pagesBufferLength: 5,\n },\n amp: {\n canonicalBase: '',\n },\n basePath: '',\n sassOptions: {},\n trailingSlash: false,\n i18n: null,\n productionBrowserSourceMaps: false,\n excludeDefaultMomentLocales: true,\n serverRuntimeConfig: {},\n publicRuntimeConfig: {},\n reactProductionProfiling: false,\n reactStrictMode: null,\n reactMaxHeadersLength: 6000,\n httpAgentOptions: {\n keepAlive: true,\n },\n logging: {},\n expireTime: process.env.__NEXT_TEST_MODE ? undefined : 31536000,\n staticPageGenerationTimeout: 60,\n output: !!process.env.NEXT_PRIVATE_STANDALONE ? 'standalone' : undefined,\n modularizeImports: undefined,\n outputFileTracingRoot: process.env.NEXT_PRIVATE_OUTPUT_TRACE_ROOT || '',\n experimental: {\n cacheLife: {\n default: {\n stale: undefined, // defaults to staleTimes.static\n revalidate: 60 * 15, // 15 minutes\n expire: INFINITE_CACHE,\n },\n seconds: {\n stale: undefined, // defaults to staleTimes.dynamic\n revalidate: 1, // 1 second\n expire: 60, // 1 minute\n },\n minutes: {\n stale: 60 * 5, // 5 minutes\n revalidate: 60, // 1 minute\n expire: 60 * 60, // 1 hour\n },\n hours: {\n stale: 60 * 5, // 5 minutes\n revalidate: 60 * 60, // 1 hour\n expire: 60 * 60 * 24, // 1 day\n },\n days: {\n stale: 60 * 5, // 5 minutes\n revalidate: 60 * 60 * 24, // 1 day\n expire: 60 * 60 * 24 * 7, // 1 week\n },\n weeks: {\n stale: 60 * 5, // 5 minutes\n revalidate: 60 * 60 * 24 * 7, // 1 week\n expire: 60 * 60 * 24 * 30, // 1 month\n },\n max: {\n stale: 60 * 5, // 5 minutes\n revalidate: 60 * 60 * 24 * 30, // 1 month\n expire: INFINITE_CACHE, // Unbounded.\n },\n },\n cacheHandlers: {\n default: process.env.NEXT_DEFAULT_CACHE_HANDLER_PATH,\n remote: process.env.NEXT_REMOTE_CACHE_HANDLER_PATH,\n static: process.env.NEXT_STATIC_CACHE_HANDLER_PATH,\n },\n multiZoneDraftMode: false,\n appNavFailHandling: Boolean(process.env.NEXT_PRIVATE_FLYING_SHUTTLE),\n flyingShuttle: Boolean(process.env.NEXT_PRIVATE_FLYING_SHUTTLE)\n ? {\n mode: 'full',\n }\n : undefined,\n prerenderEarlyExit: true,\n serverMinification: true,\n serverSourceMaps: false,\n linkNoTouchStart: false,\n caseSensitiveRoutes: false,\n clientSegmentCache: false,\n appDocumentPreloading: undefined,\n preloadEntriesOnStart: true,\n clientRouterFilter: true,\n clientRouterFilterRedirects: false,\n fetchCacheKeyPrefix: '',\n middlewarePrefetch: 'flexible',\n optimisticClientCache: true,\n manualClientBasePath: false,\n cpus: Math.max(\n 1,\n (Number(process.env.CIRCLE_NODE_TOTAL) ||\n (os.cpus() || { length: 1 }).length) - 1\n ),\n memoryBasedWorkersCount: false,\n imgOptConcurrency: null,\n imgOptTimeoutInSeconds: 7,\n imgOptMaxInputPixels: 268_402_689, // https://sharp.pixelplumbing.com/api-constructor#:~:text=%5Boptions.limitInputPixels%5D\n imgOptSequentialRead: null,\n isrFlushToDisk: true,\n workerThreads: false,\n proxyTimeout: undefined,\n optimizeCss: false,\n nextScriptWorkers: false,\n scrollRestoration: false,\n externalDir: false,\n disableOptimizedLoading: false,\n gzipSize: true,\n craCompat: false,\n esmExternals: true,\n fullySpecified: false,\n swcTraceProfiling: false,\n forceSwcTransforms: false,\n swcPlugins: undefined,\n largePageDataBytes: 128 * 1000, // 128KB by default\n disablePostcssPresetEnv: undefined,\n amp: undefined,\n urlImports: undefined,\n turbo: undefined,\n typedRoutes: false,\n typedEnv: false,\n clientTraceMetadata: undefined,\n parallelServerCompiles: false,\n parallelServerBuildTraces: false,\n ppr:\n // TODO: remove once we've made PPR default\n // If we're testing, and the `__NEXT_EXPERIMENTAL_PPR` environment variable\n // has been set to `true`, enable the experimental PPR feature so long as it\n // wasn't explicitly disabled in the config.\n !!(\n process.env.__NEXT_TEST_MODE &&\n process.env.__NEXT_EXPERIMENTAL_PPR === 'true'\n ),\n reactOwnerStack: false,\n webpackBuildWorker: undefined,\n webpackMemoryOptimizations: false,\n optimizeServerReact: true,\n useEarlyImport: false,\n staleTimes: {\n dynamic: 0,\n static: 300,\n },\n allowDevelopmentBuild: undefined,\n reactCompiler: undefined,\n after: false,\n staticGenerationRetryCount: undefined,\n serverComponentsHmrCache: true,\n staticGenerationMaxConcurrency: 8,\n staticGenerationMinPagesPerWorker: 25,\n dynamicIO: false,\n },\n bundlePagesRouterDependencies: false,\n}\n\nexport async function normalizeConfig(phase: string, config: any) {\n if (typeof config === 'function') {\n config = config(phase, { defaultConfig })\n }\n // Support `new Promise` and `async () =>` as return values of the config export\n return await config\n}\n"],"names":["defaultConfig","normalizeConfig","env","webpack","eslint","ignoreDuringBuilds","typescript","ignoreBuildErrors","tsconfigPath","distDir","cleanDistDir","assetPrefix","cacheHandler","process","NEXT_CACHE_HANDLER_PATH","cacheMaxMemorySize","configOrigin","useFileSystemPublicRoutes","generateBuildId","generateEtags","pageExtensions","poweredByHeader","compress","images","imageConfigDefault","devIndicators","appIsrStatus","buildActivity","buildActivityPosition","onDemandEntries","maxInactiveAge","pagesBufferLength","amp","canonicalBase","basePath","sassOptions","trailingSlash","i18n","productionBrowserSourceMaps","excludeDefaultMomentLocales","serverRuntimeConfig","publicRuntimeConfig","reactProductionProfiling","reactStrictMode","reactMaxHeadersLength","httpAgentOptions","keepAlive","logging","expireTime","__NEXT_TEST_MODE","undefined","staticPageGenerationTimeout","output","NEXT_PRIVATE_STANDALONE","modularizeImports","outputFileTracingRoot","NEXT_PRIVATE_OUTPUT_TRACE_ROOT","experimental","cacheLife","default","stale","revalidate","expire","INFINITE_CACHE","seconds","minutes","hours","days","weeks","max","cacheHandlers","NEXT_DEFAULT_CACHE_HANDLER_PATH","remote","NEXT_REMOTE_CACHE_HANDLER_PATH","static","NEXT_STATIC_CACHE_HANDLER_PATH","multiZoneDraftMode","appNavFailHandling","Boolean","NEXT_PRIVATE_FLYING_SHUTTLE","flyingShuttle","mode","prerenderEarlyExit","serverMinification","serverSourceMaps","linkNoTouchStart","caseSensitiveRoutes","clientSegmentCache","appDocumentPreloading","preloadEntriesOnStart","clientRouterFilter","clientRouterFilterRedirects","fetchCacheKeyPrefix","middlewarePrefetch","optimisticClientCache","manualClientBasePath","cpus","Math","Number","CIRCLE_NODE_TOTAL","os","length","memoryBasedWorkersCount","imgOptConcurrency","imgOptTimeoutInSeconds","imgOptMaxInputPixels","imgOptSequentialRead","isrFlushToDisk","workerThreads","proxyTimeout","optimizeCss","nextScriptWorkers","scrollRestoration","externalDir","disableOptimizedLoading","gzipSize","craCompat","esmExternals","fullySpecified","swcTraceProfiling","forceSwcTransforms","swcPlugins","largePageDataBytes","disablePostcssPresetEnv","urlImports","turbo","typedRoutes","typedEnv","clientTraceMetadata","parallelServerCompiles","parallelServerBuildTraces","ppr","__NEXT_EXPERIMENTAL_PPR","reactOwnerStack","webpackBuildWorker","webpackMemoryOptimizations","optimizeServerReact","useEarlyImport","staleTimes","dynamic","allowDevelopmentBuild","reactCompiler","after","staticGenerationRetryCount","serverComponentsHmrCache","staticGenerationMaxConcurrency","staticGenerationMinPagesPerWorker","dynamicIO","bundlePagesRouterDependencies","phase","config"],"mappings":";;;;;;;;;;;;;;;IAu9BaA,aAAa;eAAbA;;IAyLSC,eAAe;eAAfA;;;2DAhpCP;6BAGoB;2BAYJ;;;;;;AAw8BxB,MAAMD,gBAA4B;IACvCE,KAAK,CAAC;IACNC,SAAS;IACTC,QAAQ;QACNC,oBAAoB;IACtB;IACAC,YAAY;QACVC,mBAAmB;QACnBC,cAAc;IAChB;IACAC,SAAS;IACTC,cAAc;IACdC,aAAa;IACbC,cAAcC,QAAQX,GAAG,CAACY,uBAAuB;IACjD,wBAAwB;IACxBC,oBAAoB,KAAK,OAAO;IAChCC,cAAc;IACdC,2BAA2B;IAC3BC,iBAAiB,IAAM;IACvBC,eAAe;IACfC,gBAAgB;QAAC;QAAO;QAAM;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;QAC3C,2EAA2E;QAC3E,4EAA4E;QAC5E,4CAA4C;QAC5C,CAAC,CACCtH,CAAAA,QAAQX,GAAG,CAAC+C,gBAAgB,IAC5BpC,QAAQX,GAAG,CAACkI,uBAAuB,KAAK,MAAK;QAEjDC,iBAAiB;QACjBC,oBAAoBpF;QACpBqF,4BAA4B;QAC5BC,qBAAqB;QACrBC,gBAAgB;QAChBC,YAAY;YACVC,SAAS;YACTjE,QAAQ;QACV;QACAkE,uBAAuB1F;QACvB2F,eAAe3F;QACf4F,OAAO;QACPC,4BAA4B7F;QAC5B8F,0BAA0B;QAC1BC,gCAAgC;QAChCC,mCAAmC;QACnCC,WAAW;IACb;IACAC,+BAA+B;AACjC;AAEO,eAAenJ,gBAAgBoJ,KAAa,EAAEC,MAAW;IAC9D,IAAI,OAAOA,WAAW,YAAY;QAChCA,SAASA,OAAOD,OAAO;YAAErJ;QAAc;IACzC;IACA,gFAAgF;IAChF,OAAO,MAAMsJ;AACf"}
|
|
1
|
+
{"version":3,"sources":["../../src/server/config-shared.ts"],"sourcesContent":["import os from 'os'\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport type { Header, Redirect, Rewrite } from '../lib/load-custom-routes'\nimport { imageConfigDefault } from '../shared/lib/image-config'\nimport type {\n ImageConfig,\n ImageConfigComplete,\n} from '../shared/lib/image-config'\nimport type { SubresourceIntegrityAlgorithm } from '../build/webpack/plugins/subresource-integrity-plugin'\nimport type { WEB_VITALS } from '../shared/lib/utils'\nimport type { NextParsedUrlQuery } from './request-meta'\nimport type { SizeLimit } from '../types'\nimport type { ExpireTime } from './lib/revalidate'\nimport type { SupportedTestRunners } from '../cli/next-test'\nimport type { ExperimentalPPRConfig } from './lib/experimental/ppr'\nimport { INFINITE_CACHE } from '../lib/constants'\n\nexport type NextConfigComplete = Required<NextConfig> & {\n images: Required<ImageConfigComplete>\n typescript: Required<TypeScriptConfig>\n configOrigin?: string\n configFile?: string\n configFileName: string\n}\n\nexport type I18NDomains = DomainLocale[]\n\nexport interface I18NConfig {\n defaultLocale: string\n domains?: I18NDomains\n localeDetection?: false\n locales: string[]\n}\n\nexport interface DomainLocale {\n defaultLocale: string\n domain: string\n http?: true\n locales?: string[]\n}\n\nexport interface ESLintConfig {\n /** Only run ESLint on these directories with `next lint` and `next build`. */\n dirs?: string[]\n /** Do not run ESLint during production builds (`next build`). */\n ignoreDuringBuilds?: boolean\n}\n\nexport interface TypeScriptConfig {\n /** Do not run TypeScript during production builds (`next build`). */\n ignoreBuildErrors?: boolean\n /** Relative path to a custom tsconfig file */\n tsconfigPath?: string\n}\n\nexport interface EmotionConfig {\n sourceMap?: boolean\n autoLabel?: 'dev-only' | 'always' | 'never'\n labelFormat?: string\n importMap?: {\n [importName: string]: {\n [exportName: string]: {\n canonicalImport?: [string, string]\n styledBaseImport?: [string, string]\n }\n }\n }\n}\n\nexport interface StyledComponentsConfig {\n /**\n * Enabled by default in development, disabled in production to reduce file size,\n * setting this will override the default for all environments.\n */\n displayName?: boolean\n topLevelImportPaths?: string[]\n ssr?: boolean\n fileName?: boolean\n meaninglessFileNames?: string[]\n minify?: boolean\n transpileTemplateLiterals?: boolean\n namespace?: string\n pure?: boolean\n cssProp?: boolean\n}\n\ntype JSONValue =\n | string\n | number\n | boolean\n | JSONValue[]\n | { [k: string]: JSONValue }\n\nexport type TurboLoaderItem =\n | string\n | {\n loader: string\n // At the moment, Turbopack options must be JSON-serializable, so restrict values.\n options: Record<string, JSONValue>\n }\n\nexport type TurboRuleConfigItemOrShortcut =\n | TurboLoaderItem[]\n | TurboRuleConfigItem\n\nexport type TurboRuleConfigItemOptions = {\n loaders: TurboLoaderItem[]\n as?: string\n}\n\nexport type TurboRuleConfigItem =\n | TurboRuleConfigItemOptions\n | { [condition: string]: TurboRuleConfigItem }\n | false\n\nexport interface ExperimentalTurboOptions {\n /**\n * (`next --turbopack` only) A mapping of aliased imports to modules to load in their place.\n *\n * @see [Resolve Alias](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#resolve-alias)\n */\n resolveAlias?: Record<\n string,\n string | string[] | Record<string, string | string[]>\n >\n\n /**\n * (`next --turbopack` only) A list of extensions to resolve when importing files.\n *\n * @see [Resolve Extensions](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#resolve-extensions)\n */\n resolveExtensions?: string[]\n\n /**\n * (`next --turbopack` only) A list of webpack loaders to apply when running with Turbopack.\n *\n * @see [Turbopack Loaders](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#webpack-loaders)\n */\n loaders?: Record<string, TurboLoaderItem[]>\n\n /**\n * (`next --turbopack` only) A list of webpack loaders to apply when running with Turbopack.\n *\n * @see [Turbopack Loaders](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#webpack-loaders)\n */\n rules?: Record<string, TurboRuleConfigItemOrShortcut>\n\n /**\n * A target memory limit for turbo, in bytes.\n */\n memoryLimit?: number\n\n /**\n * Enable persistent caching for the turbopack dev server and build.\n */\n unstablePersistentCaching?: boolean\n\n /**\n * Enable tree shaking for the turbopack dev server and build.\n */\n treeShaking?: boolean\n\n /**\n * The module ID strategy to use for Turbopack.\n * If not set, the default is `'named'` for development and `'deterministic'`\n * for production.\n */\n moduleIdStrategy?: 'named' | 'deterministic'\n\n /**\n * This is the repo root usually and only files above this\n * directory can be resolved by turbopack.\n */\n root?: string\n\n /**\n * Enable minification. Defaults to true in build mode and false in dev mode.\n */\n minify?: boolean\n}\n\nexport interface WebpackConfigContext {\n /** Next.js root directory */\n dir: string\n /** Indicates if the compilation will be done in development */\n dev: boolean\n /** It's `true` for server-side compilation, and `false` for client-side compilation */\n isServer: boolean\n /** The build id, used as a unique identifier between builds */\n buildId: string\n /** The next.config.js merged with default values */\n config: NextConfigComplete\n /** Default loaders used internally by Next.js */\n defaultLoaders: {\n /** Default babel-loader configuration */\n babel: any\n }\n /** Number of total Next.js pages */\n totalPages: number\n /** The webpack configuration */\n webpack: any\n /** The current server runtime */\n nextRuntime?: 'nodejs' | 'edge'\n}\n\nexport interface NextJsWebpackConfig {\n (\n /** Existing Webpack config */\n config: any,\n context: WebpackConfigContext\n ): any\n}\n\n/**\n * Set of options for the react compiler next.js\n * currently supports.\n *\n * This can be changed without breaking changes while supporting\n * react compiler in the experimental phase.\n */\nexport interface ReactCompilerOptions {\n compilationMode?: 'infer' | 'annotation' | 'all'\n panicThreshold?: 'ALL_ERRORS' | 'CRITICAL_ERRORS' | 'NONE'\n}\n\nexport interface 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\nexport interface ExperimentalConfig {\n cacheHandlers?: {\n default?: string\n remote?: string\n static?: string\n [handlerName: string]: string | undefined\n }\n multiZoneDraftMode?: boolean\n appNavFailHandling?: boolean\n flyingShuttle?: { mode?: 'full' | 'store-only' }\n prerenderEarlyExit?: boolean\n linkNoTouchStart?: boolean\n caseSensitiveRoutes?: boolean\n clientSegmentCache?: boolean\n appDocumentPreloading?: boolean\n preloadEntriesOnStart?: boolean\n /** @default true */\n strictNextHead?: boolean\n clientRouterFilter?: boolean\n clientRouterFilterRedirects?: boolean\n /**\n * This config can be used to override the cache behavior for the client router.\n * These values indicate the time, in seconds, that the cache should be considered\n * reusable. When the `prefetch` Link prop is left unspecified, this will use the `dynamic` value.\n * When the `prefetch` Link prop is set to `true`, this will use the `static` value.\n */\n staleTimes?: {\n dynamic?: number\n static?: number\n }\n cacheLife?: {\n [profile: string]: {\n // How long the client can cache a value without checking with the server.\n stale?: number\n // How frequently you want the cache to refresh on the server.\n // Stale values may be served while revalidating.\n revalidate?: number\n // In the worst case scenario, where you haven't had traffic in a while,\n // how stale can a value be until you prefer deopting to dynamic.\n // Must be longer than revalidate.\n expire?: number\n }\n }\n // decimal for percent for possible false positives\n // e.g. 0.01 for 10% potential false matches lower\n // percent increases size of the filter\n clientRouterFilterAllowedRate?: number\n externalMiddlewareRewritesResolve?: boolean\n extensionAlias?: Record<string, any>\n allowedRevalidateHeaderKeys?: string[]\n fetchCacheKeyPrefix?: string\n imgOptConcurrency?: number | null\n imgOptTimeoutInSeconds?: number\n imgOptMaxInputPixels?: number\n imgOptSequentialRead?: boolean | null\n optimisticClientCache?: boolean\n /**\n * @deprecated use config.expireTime instead\n */\n expireTime?: ExpireTime\n middlewarePrefetch?: 'strict' | 'flexible'\n manualClientBasePath?: boolean\n /**\n * CSS Chunking strategy. Defaults to 'loose', 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?: 'strict' | 'loose'\n disablePostcssPresetEnv?: boolean\n cpus?: number\n memoryBasedWorkersCount?: boolean\n proxyTimeout?: number\n isrFlushToDisk?: boolean\n workerThreads?: boolean\n // optimizeCss can be boolean or critters' option object\n // Use Record<string, unknown> as critters doesn't export its Option type\n // https://github.com/GoogleChromeLabs/critters/blob/a590c05f9197b656d2aeaae9369df2483c26b072/packages/critters/src/index.d.ts\n optimizeCss?: boolean | Record<string, unknown>\n nextScriptWorkers?: boolean\n scrollRestoration?: boolean\n externalDir?: boolean\n amp?: {\n optimizer?: any\n validator?: string\n skipValidation?: boolean\n }\n disableOptimizedLoading?: boolean\n gzipSize?: boolean\n craCompat?: boolean\n esmExternals?: boolean | 'loose'\n fullySpecified?: boolean\n urlImports?: NonNullable<webpack.Configuration['experiments']>['buildHttp']\n swcTraceProfiling?: boolean\n forceSwcTransforms?: boolean\n\n swcPlugins?: Array<[string, Record<string, unknown>]>\n largePageDataBytes?: number\n /**\n * If set to `false`, webpack won't fall back to polyfill Node.js modules in the browser\n * Full list of old polyfills is accessible here:\n * [webpack/webpack#ModuleNotoundError.js#L13-L42](https://github.com/webpack/webpack/blob/2a0536cf510768111a3a6dceeb14cb79b9f59273/lib/ModuleNotFoundError.js#L13-L42)\n */\n fallbackNodePolyfills?: false\n sri?: {\n algorithm?: SubresourceIntegrityAlgorithm\n }\n\n webVitalsAttribution?: Array<(typeof WEB_VITALS)[number]>\n\n /**\n * Automatically apply the \"modularizeImports\" optimization to imports of the specified packages.\n */\n optimizePackageImports?: string[]\n\n /**\n * Optimize React APIs for server builds.\n */\n optimizeServerReact?: boolean\n\n turbo?: ExperimentalTurboOptions\n\n /**\n * For use with `@next/mdx`. Compile MDX files using the new Rust compiler.\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/mdxRs\n */\n mdxRs?:\n | boolean\n | {\n development?: boolean\n jsx?: boolean\n jsxRuntime?: string\n jsxImportSource?: string\n providerImportSource?: string\n mdxType?: 'gfm' | 'commonmark'\n }\n\n /**\n * Generate Route types and enable type checking for Link and Router.push, etc.\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/typedRoutes\n */\n typedRoutes?: boolean\n\n /**\n * Enable type-checking and autocompletion for environment variables.\n *\n * @default false\n */\n typedEnv?: boolean\n\n /**\n * Runs the compilations for server and edge in parallel instead of in serial.\n * This will make builds faster if there is enough server and edge functions\n * in the application at the cost of more memory.\n *\n * NOTE: This option is only valid when the build process can use workers. See\n * the documentation for `webpackBuildWorker` for more details.\n */\n parallelServerCompiles?: boolean\n\n /**\n * Runs the logic to collect build traces for the server routes in parallel\n * with other work during the compilation. This will increase the speed of\n * the build at the cost of more memory. This option may incur some additional\n * work compared to if the option was disabled since the work is started\n * before data from the client compilation is available to potentially reduce\n * the amount of code that needs to be traced. Despite that, this may still\n * result in faster builds for some applications.\n *\n * Valid values are:\n * - `true`: Collect the server build traces in parallel.\n * - `false`: Do not collect the server build traces in parallel.\n * - `undefined`: Collect server build traces in parallel only in the `experimental-compile` mode.\n *\n * NOTE: This option is only valid when the build process can use workers. See\n * the documentation for `webpackBuildWorker` for more details.\n */\n parallelServerBuildTraces?: boolean\n\n /**\n * Run the Webpack build in a separate process to optimize memory usage during build.\n * Valid values are:\n * - `false`: Disable the Webpack build worker\n * - `true`: Enable the Webpack build worker\n * - `undefined`: Enable the Webpack build worker only if the webpack config is not customized\n */\n webpackBuildWorker?: boolean\n\n /**\n * Enables optimizations to reduce memory usage in Webpack. This reduces the max size of the heap\n * but may increase compile times slightly.\n * Valid values are:\n * - `false`: Disable Webpack memory optimizations (default).\n * - `true`: Enables Webpack memory optimizations.\n */\n webpackMemoryOptimizations?: boolean\n\n /**\n * The array of the meta tags to the client injected by tracing propagation data.\n */\n clientTraceMetadata?: string[]\n\n /**\n * Enables experimental Partial Prerendering feature of Next.js.\n * Using this feature will enable the `react@experimental` for the `app` directory.\n */\n ppr?: ExperimentalPPRConfig\n\n /**\n * Enables experimental taint APIs in React.\n * Using this feature will enable the `react@experimental` for the `app` directory.\n */\n taint?: boolean\n\n /**\n * Enables leveraging experimental captureOwnerStack API in React,\n * to create a better stack trace for React errors.\n */\n reactOwnerStack?: boolean\n\n serverActions?: {\n /**\n * Allows adjusting body parser size limit for server actions.\n */\n bodySizeLimit?: SizeLimit\n\n /**\n * Allowed origins that can bypass Server Action's CSRF check. This is helpful\n * when you have reverse proxy in front of your app.\n * @example\n * [\"my-app.com\", \"*.my-app.com\"]\n */\n allowedOrigins?: string[]\n }\n\n /**\n * enables the minification of server code.\n */\n serverMinification?: boolean\n\n /**\n * Enables source maps generation for the server production bundle.\n */\n serverSourceMaps?: boolean\n\n /**\n * @internal Used by the Next.js internals only.\n */\n trustHostHeader?: boolean\n\n useWasmBinary?: boolean\n\n /**\n * Use lightningcss instead of postcss-loader\n */\n useLightningcss?: boolean\n\n /**\n * Enables early import feature for app router modules\n */\n useEarlyImport?: boolean\n\n /**\n * Enables `fetch` requests to be proxied to the experimental test proxy server\n */\n testProxy?: boolean\n\n /**\n * Set a default test runner to be used by `next experimental-test`.\n */\n defaultTestRunner?: SupportedTestRunners\n /**\n * Allow NODE_ENV=development even for `next build`.\n */\n allowDevelopmentBuild?: true\n /**\n * @deprecated use `config.bundlePagesRouterDependencies` instead\n *\n */\n bundlePagesExternals?: boolean\n /**\n * @deprecated use `config.serverExternalPackages` instead\n *\n */\n serverComponentsExternalPackages?: string[]\n /**\n * Enable experimental React compiler optimization.\n * Configuration accepts partial config object to the compiler, if provided\n * compiler will be enabled.\n */\n reactCompiler?: boolean | ReactCompilerOptions\n\n /**\n * Enables `unstable_after`\n */\n after?: 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.\n */\n dynamicIO?: boolean\n}\n\nexport type ExportPathMap = {\n [path: string]: {\n page: string\n query?: NextParsedUrlQuery\n\n /**\n * The parameters that are currently unknown.\n *\n * @internal\n */\n _fallbackRouteParams?: readonly string[]\n\n /**\n * @internal\n */\n _isAppDir?: boolean\n\n /**\n * @internal\n */\n _isDynamicError?: boolean\n\n /**\n * @internal\n */\n _isRoutePPREnabled?: boolean\n\n /**\n * When true, it indicates that this page is being rendered in an attempt to\n * discover if the page will be safe to generate with PPR. This is only\n * enabled when the app has `experimental.dynamicIO` enabled but does not\n * have `experimental.ppr` enabled.\n *\n * @internal\n */\n _isProspectiveRender?: boolean\n }\n}\n\n/**\n * Next.js can be configured through a `next.config.js` file in the root of your project directory.\n *\n * This can change the behavior, enable experimental features, and configure other advanced options.\n *\n * Read more: [Next.js Docs: `next.config.js`](https://nextjs.org/docs/api-reference/next.config.js/introduction)\n */\nexport interface NextConfig extends Record<string, any> {\n exportPathMap?: (\n defaultMap: ExportPathMap,\n ctx: {\n dev: boolean\n dir: string\n outDir: string | null\n distDir: string\n buildId: string\n }\n ) => Promise<ExportPathMap> | ExportPathMap\n\n /**\n * Internationalization configuration\n *\n * @see [Internationalization docs](https://nextjs.org/docs/advanced-features/i18n-routing)\n */\n i18n?: I18NConfig | null\n\n /**\n * @since version 11\n * @see [ESLint configuration](https://nextjs.org/docs/app/api-reference/config/eslint)\n */\n eslint?: ESLintConfig\n\n /**\n * @see [Next.js TypeScript documentation](https://nextjs.org/docs/app/api-reference/config/typescript)\n */\n typescript?: TypeScriptConfig\n\n /**\n * Headers allow you to set custom HTTP headers for an incoming request path.\n *\n * @see [Headers configuration documentation](https://nextjs.org/docs/api-reference/next.config.js/headers)\n */\n headers?: () => Promise<Header[]>\n\n /**\n * Rewrites allow you to map an incoming request path to a different destination path.\n *\n * @see [Rewrites configuration documentation](https://nextjs.org/docs/api-reference/next.config.js/rewrites)\n */\n rewrites?: () => Promise<\n | Rewrite[]\n | {\n beforeFiles: Rewrite[]\n afterFiles: Rewrite[]\n fallback: Rewrite[]\n }\n >\n\n /**\n * Redirects allow you to redirect an incoming request path to a different destination path.\n *\n * @see [Redirects configuration documentation](https://nextjs.org/docs/api-reference/next.config.js/redirects)\n */\n redirects?: () => Promise<Redirect[]>\n\n /**\n * @see [Moment.js locales excluded by default](https://nextjs.org/docs/upgrading#momentjs-locales-excluded-by-default)\n */\n excludeDefaultMomentLocales?: boolean\n\n /**\n * Before continuing to add custom webpack configuration to your application make sure Next.js doesn't already support your use-case\n *\n * @see [Custom Webpack Config documentation](https://nextjs.org/docs/api-reference/next.config.js/custom-webpack-config)\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/api-reference/next.config.js/trailing-slash)\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/api-reference/next.config.js/environment-variables)\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/api-reference/next.config.js/cdn-support-with-asset-prefix)\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/api-reference/next.config.js/configuring-the-build-id)\n */\n generateBuildId?: () => string | null | Promise<string | null>\n\n /** @see [Disabling ETag Configuration](https://nextjs.org/docs/api-reference/next.config.js/disabling-etag-generation) */\n generateEtags?: boolean\n\n /** @see [Including non-page files in the pages directory](https://nextjs.org/docs/api-reference/next.config.js/custom-page-extensions) */\n pageExtensions?: string[]\n\n /** @see [Compression documentation](https://nextjs.org/docs/api-reference/next.config.js/compression) */\n compress?: boolean\n\n /** @see [Disabling x-powered-by](https://nextjs.org/docs/api-reference/next.config.js/disabling-x-powered-by) */\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 /** Show \"building...\"\" indicator in development */\n buildActivity?: boolean\n /** Position of \"building...\" indicator in browser */\n buildActivityPosition?:\n | 'bottom-right'\n | 'bottom-left'\n | 'top-right'\n | 'top-left'\n\n appIsrStatus?: boolean\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/api-reference/next.config.js/configuring-onDemandEntries)\n */\n onDemandEntries?: {\n /** period (in ms) where the server will keep pages in the buffer */\n maxInactiveAge?: number\n /** number of pages that should be kept simultaneously without being disposed */\n pagesBufferLength?: number\n }\n\n /** @see [`next/amp`](https://nextjs.org/docs/api-reference/next/amp) */\n amp?: {\n canonicalBase?: string\n }\n\n /**\n * A unique identifier for a deployment that will be included in each request's query string or header.\n */\n deploymentId?: string\n\n /**\n * Deploy a Next.js application under a sub-path of a domain\n *\n * @see [Base path configuration](https://nextjs.org/docs/api-reference/next.config.js/basepath)\n */\n basePath?: string\n\n /** @see [Customizing sass options](https://nextjs.org/docs/app/api-reference/next-config-js/sassOptions) */\n sassOptions?: {\n implementation?: string\n [key: string]: any\n }\n\n /**\n * Enable browser source map generation during the production build\n *\n * @see [Source Maps](https://nextjs.org/docs/advanced-features/source-maps)\n */\n productionBrowserSourceMaps?: boolean\n\n /**\n * Enable react profiling in production\n *\n */\n reactProductionProfiling?: boolean\n\n /**\n * The Next.js runtime is Strict Mode-compliant.\n *\n * @see [React Strict Mode](https://nextjs.org/docs/api-reference/next.config.js/react-strict-mode)\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/api-reference/next.config.js/react-max-headers-length)\n */\n reactMaxHeadersLength?: number\n\n /**\n * Add public (in browser) runtime configuration to your app\n *\n * @see [Runtime configuration](https://nextjs.org/docs/api-reference/next.config.js/runtime-configuration)\n */\n publicRuntimeConfig?: { [key: string]: any }\n\n /**\n * Add server runtime configuration to your app\n *\n * @see [Runtime configuration](https://nextjs.org/docs/api-reference/next.config.js/runtime-configuration)\n */\n serverRuntimeConfig?: { [key: string]: any }\n\n /**\n * Next.js enables HTTP Keep-Alive by default.\n * You may want to disable HTTP Keep-Alive for certain `fetch()` calls or globally.\n *\n * @see [Disabling HTTP Keep-Alive](https://nextjs.org/docs/app/api-reference/next-config-js/httpAgentOptions)\n */\n httpAgentOptions?: { keepAlive?: boolean }\n\n /**\n * Timeout after waiting to generate static pages in seconds\n *\n * @default 60\n */\n staticPageGenerationTimeout?: number\n\n /**\n * Add `\"crossorigin\"` attribute to generated `<script>` elements generated by `<Head />` or `<NextScript />` components\n *\n *\n * @see [`crossorigin` attribute documentation](https://developer.mozilla.org/docs/Web/HTML/Attributes/crossorigin)\n */\n crossOrigin?: 'anonymous' | 'use-credentials'\n\n /**\n * Optionally enable compiler transforms\n *\n * @see [Supported Compiler Options](https://nextjs.org/docs/advanced-features/compiler#supported-features)\n */\n compiler?: {\n reactRemoveProperties?:\n | boolean\n | {\n properties?: string[]\n }\n relay?: {\n src: string\n artifactDirectory?: string\n language?: 'typescript' | 'javascript' | 'flow'\n eagerEsModules?: boolean\n }\n removeConsole?:\n | boolean\n | {\n exclude?: string[]\n }\n styledComponents?: boolean | StyledComponentsConfig\n emotion?: boolean | EmotionConfig\n\n styledJsx?:\n | boolean\n | {\n useLightningcss?: boolean\n }\n\n /**\n * Replaces variables in your code during compile time. Each key will be\n * replaced with the respective values.\n */\n define?: Record<string, string>\n }\n\n /**\n * The type of build output.\n * - `undefined`: The default build output, `.next` directory, that works with production mode `next start` or a hosting provider like Vercel\n * - `'standalone'`: A standalone build output, `.next/standalone` directory, that only includes necessary files/dependencies. Useful for self-hosting in a Docker container.\n * - `'export'`: An exported build output, `out` directory, that only includes static HTML/CSS/JS. Useful for self-hosting without a Node.js server.\n * @see [Output File Tracing](https://nextjs.org/docs/advanced-features/output-file-tracing)\n * @see [Static HTML Export](https://nextjs.org/docs/advanced-features/static-html-export)\n */\n output?: 'standalone' | 'export'\n\n /**\n * Automatically transpile and bundle dependencies from local packages (like monorepos) or from external dependencies (`node_modules`). This replaces the\n * `next-transpile-modules` package.\n * @see [transpilePackages](https://nextjs.org/docs/advanced-features/compiler#module-transpilation)\n */\n transpilePackages?: string[]\n\n skipMiddlewareUrlNormalize?: boolean\n\n skipTrailingSlashRedirect?: boolean\n\n modularizeImports?: Record<\n string,\n {\n transform: string | Record<string, string>\n preventFullImport?: boolean\n skipDefaultConversion?: boolean\n }\n >\n\n logging?: LoggingConfig | false\n\n /**\n * period (in seconds) where the server allow to serve stale cache\n */\n expireTime?: ExpireTime\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\nexport const defaultConfig: NextConfig = {\n env: {},\n webpack: null,\n eslint: {\n ignoreDuringBuilds: false,\n },\n typescript: {\n ignoreBuildErrors: false,\n tsconfigPath: 'tsconfig.json',\n },\n distDir: '.next',\n cleanDistDir: true,\n assetPrefix: '',\n cacheHandler: process.env.NEXT_CACHE_HANDLER_PATH,\n // default to 50MB limit\n cacheMaxMemorySize: 50 * 1024 * 1024,\n configOrigin: 'default',\n useFileSystemPublicRoutes: true,\n generateBuildId: () => null,\n generateEtags: true,\n pageExtensions: ['tsx', 'ts', 'jsx', 'js'],\n poweredByHeader: true,\n compress: true,\n images: imageConfigDefault,\n devIndicators: {\n appIsrStatus: true,\n buildActivity: true,\n buildActivityPosition: 'bottom-right',\n },\n onDemandEntries: {\n maxInactiveAge: 60 * 1000,\n pagesBufferLength: 5,\n },\n amp: {\n canonicalBase: '',\n },\n basePath: '',\n sassOptions: {},\n trailingSlash: false,\n i18n: null,\n productionBrowserSourceMaps: false,\n excludeDefaultMomentLocales: true,\n serverRuntimeConfig: {},\n publicRuntimeConfig: {},\n reactProductionProfiling: false,\n reactStrictMode: null,\n reactMaxHeadersLength: 6000,\n httpAgentOptions: {\n keepAlive: true,\n },\n logging: {},\n expireTime: process.env.__NEXT_TEST_MODE ? undefined : 31536000,\n staticPageGenerationTimeout: 60,\n output: !!process.env.NEXT_PRIVATE_STANDALONE ? 'standalone' : undefined,\n modularizeImports: undefined,\n outputFileTracingRoot: process.env.NEXT_PRIVATE_OUTPUT_TRACE_ROOT || '',\n experimental: {\n cacheLife: {\n default: {\n stale: undefined, // defaults to staleTimes.static\n revalidate: 60 * 15, // 15 minutes\n expire: INFINITE_CACHE,\n },\n seconds: {\n stale: undefined, // defaults to staleTimes.dynamic\n revalidate: 1, // 1 second\n expire: 60, // 1 minute\n },\n minutes: {\n stale: 60 * 5, // 5 minutes\n revalidate: 60, // 1 minute\n expire: 60 * 60, // 1 hour\n },\n hours: {\n stale: 60 * 5, // 5 minutes\n revalidate: 60 * 60, // 1 hour\n expire: 60 * 60 * 24, // 1 day\n },\n days: {\n stale: 60 * 5, // 5 minutes\n revalidate: 60 * 60 * 24, // 1 day\n expire: 60 * 60 * 24 * 7, // 1 week\n },\n weeks: {\n stale: 60 * 5, // 5 minutes\n revalidate: 60 * 60 * 24 * 7, // 1 week\n expire: 60 * 60 * 24 * 30, // 1 month\n },\n max: {\n stale: 60 * 5, // 5 minutes\n revalidate: 60 * 60 * 24 * 30, // 1 month\n expire: INFINITE_CACHE, // Unbounded.\n },\n },\n cacheHandlers: {\n default: process.env.NEXT_DEFAULT_CACHE_HANDLER_PATH,\n remote: process.env.NEXT_REMOTE_CACHE_HANDLER_PATH,\n static: process.env.NEXT_STATIC_CACHE_HANDLER_PATH,\n },\n multiZoneDraftMode: false,\n appNavFailHandling: Boolean(process.env.NEXT_PRIVATE_FLYING_SHUTTLE),\n flyingShuttle: Boolean(process.env.NEXT_PRIVATE_FLYING_SHUTTLE)\n ? {\n mode: 'full',\n }\n : undefined,\n prerenderEarlyExit: true,\n serverMinification: true,\n serverSourceMaps: false,\n linkNoTouchStart: false,\n caseSensitiveRoutes: false,\n clientSegmentCache: false,\n appDocumentPreloading: undefined,\n preloadEntriesOnStart: true,\n clientRouterFilter: true,\n clientRouterFilterRedirects: false,\n fetchCacheKeyPrefix: '',\n middlewarePrefetch: 'flexible',\n optimisticClientCache: true,\n manualClientBasePath: false,\n cpus: Math.max(\n 1,\n (Number(process.env.CIRCLE_NODE_TOTAL) ||\n (os.cpus() || { length: 1 }).length) - 1\n ),\n memoryBasedWorkersCount: false,\n imgOptConcurrency: null,\n imgOptTimeoutInSeconds: 7,\n imgOptMaxInputPixels: 268_402_689, // https://sharp.pixelplumbing.com/api-constructor#:~:text=%5Boptions.limitInputPixels%5D\n imgOptSequentialRead: null,\n isrFlushToDisk: true,\n workerThreads: false,\n proxyTimeout: undefined,\n optimizeCss: false,\n nextScriptWorkers: false,\n scrollRestoration: false,\n externalDir: false,\n disableOptimizedLoading: false,\n gzipSize: true,\n craCompat: false,\n esmExternals: true,\n fullySpecified: false,\n swcTraceProfiling: false,\n forceSwcTransforms: false,\n swcPlugins: undefined,\n largePageDataBytes: 128 * 1000, // 128KB by default\n disablePostcssPresetEnv: undefined,\n amp: undefined,\n urlImports: undefined,\n turbo: undefined,\n typedRoutes: false,\n typedEnv: false,\n clientTraceMetadata: undefined,\n parallelServerCompiles: false,\n parallelServerBuildTraces: false,\n ppr:\n // TODO: remove once we've made PPR default\n // If we're testing, and the `__NEXT_EXPERIMENTAL_PPR` environment variable\n // has been set to `true`, enable the experimental PPR feature so long as it\n // wasn't explicitly disabled in the config.\n !!(\n process.env.__NEXT_TEST_MODE &&\n process.env.__NEXT_EXPERIMENTAL_PPR === 'true'\n ),\n reactOwnerStack: false,\n webpackBuildWorker: undefined,\n webpackMemoryOptimizations: false,\n optimizeServerReact: true,\n useEarlyImport: false,\n staleTimes: {\n dynamic: 0,\n static: 300,\n },\n allowDevelopmentBuild: undefined,\n reactCompiler: undefined,\n after: false,\n staticGenerationRetryCount: undefined,\n serverComponentsHmrCache: true,\n staticGenerationMaxConcurrency: 8,\n staticGenerationMinPagesPerWorker: 25,\n dynamicIO: false,\n },\n bundlePagesRouterDependencies: false,\n}\n\nexport async function normalizeConfig(phase: string, config: any) {\n if (typeof config === 'function') {\n config = config(phase, { defaultConfig })\n }\n // Support `new Promise` and `async () =>` as return values of the config export\n return await config\n}\n"],"names":["defaultConfig","normalizeConfig","env","webpack","eslint","ignoreDuringBuilds","typescript","ignoreBuildErrors","tsconfigPath","distDir","cleanDistDir","assetPrefix","cacheHandler","process","NEXT_CACHE_HANDLER_PATH","cacheMaxMemorySize","configOrigin","useFileSystemPublicRoutes","generateBuildId","generateEtags","pageExtensions","poweredByHeader","compress","images","imageConfigDefault","devIndicators","appIsrStatus","buildActivity","buildActivityPosition","onDemandEntries","maxInactiveAge","pagesBufferLength","amp","canonicalBase","basePath","sassOptions","trailingSlash","i18n","productionBrowserSourceMaps","excludeDefaultMomentLocales","serverRuntimeConfig","publicRuntimeConfig","reactProductionProfiling","reactStrictMode","reactMaxHeadersLength","httpAgentOptions","keepAlive","logging","expireTime","__NEXT_TEST_MODE","undefined","staticPageGenerationTimeout","output","NEXT_PRIVATE_STANDALONE","modularizeImports","outputFileTracingRoot","NEXT_PRIVATE_OUTPUT_TRACE_ROOT","experimental","cacheLife","default","stale","revalidate","expire","INFINITE_CACHE","seconds","minutes","hours","days","weeks","max","cacheHandlers","NEXT_DEFAULT_CACHE_HANDLER_PATH","remote","NEXT_REMOTE_CACHE_HANDLER_PATH","static","NEXT_STATIC_CACHE_HANDLER_PATH","multiZoneDraftMode","appNavFailHandling","Boolean","NEXT_PRIVATE_FLYING_SHUTTLE","flyingShuttle","mode","prerenderEarlyExit","serverMinification","serverSourceMaps","linkNoTouchStart","caseSensitiveRoutes","clientSegmentCache","appDocumentPreloading","preloadEntriesOnStart","clientRouterFilter","clientRouterFilterRedirects","fetchCacheKeyPrefix","middlewarePrefetch","optimisticClientCache","manualClientBasePath","cpus","Math","Number","CIRCLE_NODE_TOTAL","os","length","memoryBasedWorkersCount","imgOptConcurrency","imgOptTimeoutInSeconds","imgOptMaxInputPixels","imgOptSequentialRead","isrFlushToDisk","workerThreads","proxyTimeout","optimizeCss","nextScriptWorkers","scrollRestoration","externalDir","disableOptimizedLoading","gzipSize","craCompat","esmExternals","fullySpecified","swcTraceProfiling","forceSwcTransforms","swcPlugins","largePageDataBytes","disablePostcssPresetEnv","urlImports","turbo","typedRoutes","typedEnv","clientTraceMetadata","parallelServerCompiles","parallelServerBuildTraces","ppr","__NEXT_EXPERIMENTAL_PPR","reactOwnerStack","webpackBuildWorker","webpackMemoryOptimizations","optimizeServerReact","useEarlyImport","staleTimes","dynamic","allowDevelopmentBuild","reactCompiler","after","staticGenerationRetryCount","serverComponentsHmrCache","staticGenerationMaxConcurrency","staticGenerationMinPagesPerWorker","dynamicIO","bundlePagesRouterDependencies","phase","config"],"mappings":";;;;;;;;;;;;;;;IAq9BaA,aAAa;eAAbA;;IAyLSC,eAAe;eAAfA;;;2DA9oCP;6BAGoB;2BAYJ;;;;;;AAs8BxB,MAAMD,gBAA4B;IACvCE,KAAK,CAAC;IACNC,SAAS;IACTC,QAAQ;QACNC,oBAAoB;IACtB;IACAC,YAAY;QACVC,mBAAmB;QACnBC,cAAc;IAChB;IACAC,SAAS;IACTC,cAAc;IACdC,aAAa;IACbC,cAAcC,QAAQX,GAAG,CAACY,uBAAuB;IACjD,wBAAwB;IACxBC,oBAAoB,KAAK,OAAO;IAChCC,cAAc;IACdC,2BAA2B;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ACVC,qBAAqB9E;QACrB+E,wBAAwB;QACxBC,2BAA2B;QAC3BC,KACE,2CAA2C;QAC3C,2EAA2E;QAC3E,4EAA4E;QAC5E,4CAA4C;QAC5C,CAAC,CACCtH,CAAAA,QAAQX,GAAG,CAAC+C,gBAAgB,IAC5BpC,QAAQX,GAAG,CAACkI,uBAAuB,KAAK,MAAK;QAEjDC,iBAAiB;QACjBC,oBAAoBpF;QACpBqF,4BAA4B;QAC5BC,qBAAqB;QACrBC,gBAAgB;QAChBC,YAAY;YACVC,SAAS;YACTjE,QAAQ;QACV;QACAkE,uBAAuB1F;QACvB2F,eAAe3F;QACf4F,OAAO;QACPC,4BAA4B7F;QAC5B8F,0BAA0B;QAC1BC,gCAAgC;QAChCC,mCAAmC;QACnCC,WAAW;IACb;IACAC,+BAA+B;AACjC;AAEO,eAAenJ,gBAAgBoJ,KAAa,EAAEC,MAAW;IAC9D,IAAI,OAAOA,WAAW,YAAY;QAChCA,SAASA,OAAOD,OAAO;YAAErJ;QAAc;IACzC;IACA,gFAAgF;IAChF,OAAO,MAAMsJ;AACf"}
|
package/dist/server/config.js
CHANGED
|
@@ -234,7 +234,7 @@ function assignDefaults(dir, userConfig, silent) {
|
|
|
234
234
|
if (((_result_experimental = result.experimental) == null ? void 0 : _result_experimental.allowDevelopmentBuild) && process.env.NODE_ENV !== 'development') {
|
|
235
235
|
throw new Error(`The experimental.allowDevelopmentBuild option requires NODE_ENV to be explicitly set to 'development'.`);
|
|
236
236
|
}
|
|
237
|
-
if (!((_process_env___NEXT_VERSION = "15.0.4-canary.
|
|
237
|
+
if (!((_process_env___NEXT_VERSION = "15.0.4-canary.17") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_SKIP_CANARY_CHECK) {
|
|
238
238
|
var _result_experimental7, _result_experimental8, _result_experimental_turbo3, _result_experimental9;
|
|
239
239
|
// Prevents usage of certain experimental features outside of canary
|
|
240
240
|
if ((_result_experimental7 = result.experimental) == null ? void 0 : _result_experimental7.ppr) {
|
|
@@ -104,7 +104,7 @@ async function createHotReloaderTurbopack(opts, serverFields, distDir, resetFetc
|
|
|
104
104
|
}
|
|
105
105
|
const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
|
|
106
106
|
const hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
|
|
107
|
-
version: "15.0.4-canary.
|
|
107
|
+
version: "15.0.4-canary.17"
|
|
108
108
|
});
|
|
109
109
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
|
110
110
|
// of the current `next dev` invocation.
|
|
@@ -260,7 +260,7 @@ class HotReloaderWebpack {
|
|
|
260
260
|
this.previewProps = previewProps;
|
|
261
261
|
this.rewrites = rewrites;
|
|
262
262
|
this.hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
|
|
263
|
-
version: "15.0.4-canary.
|
|
263
|
+
version: "15.0.4-canary.17"
|
|
264
264
|
});
|
|
265
265
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
|
266
266
|
// of the current `next dev` invocation.
|