next 15.6.0-canary.24 → 15.6.0-canary.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/next +1 -1
- package/dist/build/index.js +3 -3
- package/dist/build/swc/index.js +1 -1
- package/dist/build/webpack/config/index.d.ts +1 -1
- package/dist/build/webpack/config/index.js.map +1 -1
- package/dist/build/webpack/config/utils.js.map +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/build/webpack-config.js.map +1 -1
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiled/next-server/pages-api-turbo.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages-api-turbo.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.dev.js.map +1 -1
- package/dist/esm/build/index.js +3 -3
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/webpack/config/index.js.map +1 -1
- package/dist/esm/build/webpack/config/utils.js.map +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/build/webpack-config.js.map +1 -1
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/export/index.js.map +1 -1
- package/dist/esm/server/config-shared.js.map +1 -1
- package/dist/esm/server/config.js +1 -0
- package/dist/esm/server/config.js.map +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/shared/lib/canary-only.js +1 -1
- package/dist/export/index.js.map +1 -1
- package/dist/server/config-shared.d.ts +3 -4
- package/dist/server/config-shared.js.map +1 -1
- package/dist/server/config.js +1 -0
- package/dist/server/config.js.map +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/shared/lib/canary-only.js +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +15 -15
package/dist/export/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/export/index.ts"],"sourcesContent":["import type {\n ExportAppResult,\n ExportAppOptions,\n WorkerRenderOptsPartial,\n ExportPagesResult,\n ExportPathEntry,\n} from './types'\nimport {\n createStaticWorker,\n type PrerenderManifest,\n type StaticWorker,\n} from '../build'\nimport type { PagesManifest } from '../build/webpack/plugins/pages-manifest-plugin'\n\nimport { bold, yellow } from '../lib/picocolors'\nimport findUp from 'next/dist/compiled/find-up'\nimport { existsSync, promises as fs } from 'fs'\n\nimport '../server/require-hook'\n\nimport { dirname, join, resolve, sep, relative } from 'path'\nimport { formatAmpMessages } from '../build/output/index'\nimport type { AmpPageStatus } from '../build/output/index'\nimport * as Log from '../build/output/log'\nimport {\n RSC_SEGMENT_SUFFIX,\n RSC_SEGMENTS_DIR_SUFFIX,\n RSC_SUFFIX,\n SSG_FALLBACK_EXPORT_ERROR,\n} from '../lib/constants'\nimport { recursiveCopy } from '../lib/recursive-copy'\nimport {\n BUILD_ID_FILE,\n CLIENT_PUBLIC_FILES_PATH,\n CLIENT_STATIC_FILES_PATH,\n EXPORT_DETAIL,\n EXPORT_MARKER,\n NEXT_FONT_MANIFEST,\n MIDDLEWARE_MANIFEST,\n PAGES_MANIFEST,\n PHASE_EXPORT,\n PRERENDER_MANIFEST,\n SERVER_DIRECTORY,\n SERVER_REFERENCE_MANIFEST,\n APP_PATH_ROUTES_MANIFEST,\n ROUTES_MANIFEST,\n FUNCTIONS_CONFIG_MANIFEST,\n} from '../shared/lib/constants'\nimport loadConfig from '../server/config'\nimport type { ExportPathMap } from '../server/config-shared'\nimport { eventCliSession } from '../telemetry/events'\nimport { hasNextSupport } from '../server/ci-info'\nimport { Telemetry } from '../telemetry/storage'\nimport { normalizePagePath } from '../shared/lib/page-path/normalize-page-path'\nimport { denormalizePagePath } from '../shared/lib/page-path/denormalize-page-path'\nimport { loadEnvConfig } from '@next/env'\nimport { isAPIRoute } from '../lib/is-api-route'\nimport { getPagePath } from '../server/require'\nimport type { Span } from '../trace'\nimport type { MiddlewareManifest } from '../build/webpack/plugins/middleware-plugin'\nimport { isAppRouteRoute } from '../lib/is-app-route-route'\nimport { isAppPageRoute } from '../lib/is-app-page-route'\nimport isError from '../lib/is-error'\nimport { formatManifest } from '../build/manifests/formatter/format-manifest'\nimport { TurborepoAccessTraceResult } from '../build/turborepo-access-trace'\nimport { createProgress } from '../build/progress'\nimport type { DeepReadonly } from '../shared/lib/deep-readonly'\nimport { isInterceptionRouteRewrite } from '../lib/generate-interception-routes-rewrites'\nimport type { ActionManifest } from '../build/webpack/plugins/flight-client-entry-plugin'\nimport { extractInfoFromServerReferenceId } from '../shared/lib/server-reference-info'\nimport { convertSegmentPathToStaticExportFilename } from '../shared/lib/segment-cache/segment-value-encoding'\nimport { getNextBuildDebuggerPortOffset } from '../lib/worker'\n\nexport class ExportError extends Error {\n code = 'NEXT_EXPORT_ERROR'\n}\n\nasync function exportAppImpl(\n dir: string,\n options: Readonly<ExportAppOptions>,\n span: Span\n): Promise<ExportAppResult | null> {\n dir = resolve(dir)\n\n // attempt to load global env values so they are available in next.config.js\n span.traceChild('load-dotenv').traceFn(() => loadEnvConfig(dir, false, Log))\n\n const { enabledDirectories } = options\n\n const nextConfig =\n options.nextConfig ||\n (await span.traceChild('load-next-config').traceAsyncFn(() =>\n loadConfig(PHASE_EXPORT, dir, {\n debugPrerender: options.debugPrerender,\n })\n ))\n\n const distDir = join(dir, nextConfig.distDir)\n const telemetry = options.buildExport ? null : new Telemetry({ distDir })\n\n if (telemetry) {\n telemetry.record(\n eventCliSession(nextConfig, {\n webpackVersion: null,\n cliCommand: 'export',\n isSrcDir: null,\n hasNowJson: !!(await findUp('now.json', { cwd: dir })),\n isCustomServer: null,\n turboFlag: false,\n pagesDir: null,\n appDir: null,\n })\n )\n }\n\n const subFolders = nextConfig.trailingSlash && !options.buildExport\n\n if (!options.silent && !options.buildExport) {\n Log.info(`using build directory: ${distDir}`)\n }\n\n const buildIdFile = join(distDir, BUILD_ID_FILE)\n\n if (!existsSync(buildIdFile)) {\n throw new ExportError(\n `Could not find a production build in the '${distDir}' directory. Try building your app with 'next build' before starting the static export. https://nextjs.org/docs/messages/next-export-no-build-id`\n )\n }\n\n const customRoutes = ['rewrites', 'redirects', 'headers'].filter(\n (config) => typeof nextConfig[config] === 'function'\n )\n\n if (!hasNextSupport && !options.buildExport && customRoutes.length > 0) {\n Log.warn(\n `rewrites, redirects, and headers are not applied when exporting your application, detected (${customRoutes.join(\n ', '\n )}). See more info here: https://nextjs.org/docs/messages/export-no-custom-routes`\n )\n }\n\n const buildId = await fs.readFile(buildIdFile, 'utf8')\n\n const pagesManifest =\n !options.pages &&\n (require(join(distDir, SERVER_DIRECTORY, PAGES_MANIFEST)) as PagesManifest)\n\n let prerenderManifest: DeepReadonly<PrerenderManifest> | undefined\n try {\n prerenderManifest = require(join(distDir, PRERENDER_MANIFEST))\n } catch {}\n\n let appRoutePathManifest: Record<string, string> | undefined\n try {\n appRoutePathManifest = require(join(distDir, APP_PATH_ROUTES_MANIFEST))\n } catch (err) {\n if (\n isError(err) &&\n (err.code === 'ENOENT' || err.code === 'MODULE_NOT_FOUND')\n ) {\n // the manifest doesn't exist which will happen when using\n // \"pages\" dir instead of \"app\" dir.\n appRoutePathManifest = undefined\n } else {\n // the manifest is malformed (invalid json)\n throw err\n }\n }\n\n const excludedPrerenderRoutes = new Set<string>()\n const pages = options.pages || Object.keys(pagesManifest)\n const defaultPathMap: ExportPathMap = {}\n\n let hasApiRoutes = false\n for (const page of pages) {\n // _document and _app are not real pages\n // _error is exported as 404.html later on\n // API Routes are Node.js functions\n\n if (isAPIRoute(page)) {\n hasApiRoutes = true\n continue\n }\n\n if (page === '/_document' || page === '/_app' || page === '/_error') {\n continue\n }\n\n // iSSG pages that are dynamic should not export templated version by\n // default. In most cases, this would never work. There is no server that\n // could run `getStaticProps`. If users make their page work lazily, they\n // can manually add it to the `exportPathMap`.\n if (prerenderManifest?.dynamicRoutes[page]) {\n excludedPrerenderRoutes.add(page)\n continue\n }\n\n defaultPathMap[page] = { page }\n }\n\n const mapAppRouteToPage = new Map<string, string>()\n if (!options.buildExport && appRoutePathManifest) {\n for (const [pageName, routePath] of Object.entries(appRoutePathManifest)) {\n mapAppRouteToPage.set(routePath, pageName)\n if (\n isAppPageRoute(pageName) &&\n !prerenderManifest?.routes[routePath] &&\n !prerenderManifest?.dynamicRoutes[routePath]\n ) {\n defaultPathMap[routePath] = {\n page: pageName,\n _isAppDir: true,\n }\n }\n }\n }\n\n // Initialize the output directory\n const outDir = options.outdir\n\n if (outDir === join(dir, 'public')) {\n throw new ExportError(\n `The 'public' directory is reserved in Next.js and can not be used as the export out directory. https://nextjs.org/docs/messages/can-not-output-to-public`\n )\n }\n\n if (outDir === join(dir, 'static')) {\n throw new ExportError(\n `The 'static' directory is reserved in Next.js and can not be used as the export out directory. https://nextjs.org/docs/messages/can-not-output-to-static`\n )\n }\n\n await fs.rm(outDir, { recursive: true, force: true })\n await fs.mkdir(join(outDir, '_next', buildId), { recursive: true })\n\n await fs.writeFile(\n join(distDir, EXPORT_DETAIL),\n formatManifest({\n version: 1,\n outDirectory: outDir,\n success: false,\n }),\n 'utf8'\n )\n\n // Copy static directory\n if (!options.buildExport && existsSync(join(dir, 'static'))) {\n if (!options.silent) {\n Log.info('Copying \"static\" directory')\n }\n await span\n .traceChild('copy-static-directory')\n .traceAsyncFn(() =>\n recursiveCopy(join(dir, 'static'), join(outDir, 'static'))\n )\n }\n\n // Copy .next/static directory\n if (\n !options.buildExport &&\n existsSync(join(distDir, CLIENT_STATIC_FILES_PATH))\n ) {\n if (!options.silent) {\n Log.info('Copying \"static build\" directory')\n }\n await span\n .traceChild('copy-next-static-directory')\n .traceAsyncFn(() =>\n recursiveCopy(\n join(distDir, CLIENT_STATIC_FILES_PATH),\n join(outDir, '_next', CLIENT_STATIC_FILES_PATH)\n )\n )\n }\n\n // Get the exportPathMap from the config file\n if (typeof nextConfig.exportPathMap !== 'function') {\n nextConfig.exportPathMap = async (defaultMap) => {\n return defaultMap\n }\n }\n\n const {\n i18n,\n images: { loader = 'default', unoptimized },\n } = nextConfig\n\n if (i18n && !options.buildExport) {\n throw new ExportError(\n `i18n support is not compatible with next export. See here for more info on deploying: https://nextjs.org/docs/messages/export-no-custom-routes`\n )\n }\n\n if (!options.buildExport) {\n const { isNextImageImported } = await span\n .traceChild('is-next-image-imported')\n .traceAsyncFn(() =>\n fs\n .readFile(join(distDir, EXPORT_MARKER), 'utf8')\n .then((text) => JSON.parse(text))\n .catch(() => ({}))\n )\n\n if (\n isNextImageImported &&\n loader === 'default' &&\n !unoptimized &&\n !hasNextSupport\n ) {\n throw new ExportError(\n `Image Optimization using the default loader is not compatible with export.\n Possible solutions:\n - Use \\`next start\\` to run a server, which includes the Image Optimization API.\n - Configure \\`images.unoptimized = true\\` in \\`next.config.js\\` to disable the Image Optimization API.\n Read more: https://nextjs.org/docs/messages/export-image-api`\n )\n }\n }\n\n let serverActionsManifest: ActionManifest | undefined\n if (enabledDirectories.app) {\n serverActionsManifest = require(\n join(distDir, SERVER_DIRECTORY, SERVER_REFERENCE_MANIFEST + '.json')\n ) as ActionManifest\n\n if (nextConfig.output === 'export') {\n const routesManifest = require(join(distDir, ROUTES_MANIFEST))\n\n // We already prevent rewrites earlier in the process, however Next.js will insert rewrites\n // for interception routes so we need to check for that here.\n if (routesManifest?.rewrites?.beforeFiles?.length > 0) {\n const hasInterceptionRouteRewrite =\n routesManifest.rewrites.beforeFiles.some(isInterceptionRouteRewrite)\n\n if (hasInterceptionRouteRewrite) {\n throw new ExportError(\n `Intercepting routes are not supported with static export.\\nRead more: https://nextjs.org/docs/app/building-your-application/deploying/static-exports#unsupported-features`\n )\n }\n }\n\n const actionIds = [\n ...Object.keys(serverActionsManifest.node),\n ...Object.keys(serverActionsManifest.edge),\n ]\n\n if (\n actionIds.some(\n (actionId) =>\n extractInfoFromServerReferenceId(actionId).type === 'server-action'\n )\n ) {\n throw new ExportError(\n `Server Actions are not supported with static export.\\nRead more: https://nextjs.org/docs/app/building-your-application/deploying/static-exports#unsupported-features`\n )\n }\n }\n }\n\n // Start the rendering process\n const renderOpts: WorkerRenderOptsPartial = {\n previewProps: prerenderManifest?.preview,\n nextExport: true,\n assetPrefix: nextConfig.assetPrefix.replace(/\\/$/, ''),\n distDir,\n dev: false,\n basePath: nextConfig.basePath,\n trailingSlash: nextConfig.trailingSlash,\n canonicalBase: nextConfig.amp?.canonicalBase || '',\n ampSkipValidation: nextConfig.experimental.amp?.skipValidation || false,\n ampOptimizerConfig: nextConfig.experimental.amp?.optimizer || undefined,\n locales: i18n?.locales,\n locale: i18n?.defaultLocale,\n defaultLocale: i18n?.defaultLocale,\n domainLocales: i18n?.domains,\n disableOptimizedLoading: nextConfig.experimental.disableOptimizedLoading,\n // Exported pages do not currently support dynamic HTML.\n supportsDynamicResponse: false,\n crossOrigin: nextConfig.crossOrigin,\n optimizeCss: nextConfig.experimental.optimizeCss,\n nextConfigOutput: nextConfig.output,\n nextScriptWorkers: nextConfig.experimental.nextScriptWorkers,\n largePageDataBytes: nextConfig.experimental.largePageDataBytes,\n serverActions: nextConfig.experimental.serverActions,\n serverComponents: enabledDirectories.app,\n cacheLifeProfiles: nextConfig.experimental.cacheLife,\n nextFontManifest: require(\n join(distDir, 'server', `${NEXT_FONT_MANIFEST}.json`)\n ),\n images: nextConfig.images,\n ...(enabledDirectories.app\n ? {\n serverActionsManifest,\n }\n : {}),\n deploymentId: nextConfig.deploymentId,\n htmlLimitedBots: nextConfig.htmlLimitedBots.source,\n experimental: {\n clientTraceMetadata: nextConfig.experimental.clientTraceMetadata,\n expireTime: nextConfig.expireTime,\n staleTimes: nextConfig.experimental.staleTimes,\n cacheComponents: nextConfig.experimental.cacheComponents ?? false,\n clientSegmentCache:\n nextConfig.experimental.clientSegmentCache === 'client-only'\n ? 'client-only'\n : Boolean(nextConfig.experimental.clientSegmentCache),\n clientParamParsing: nextConfig.experimental.clientParamParsing ?? false,\n clientParamParsingOrigins:\n nextConfig.experimental.clientParamParsingOrigins,\n dynamicOnHover: nextConfig.experimental.dynamicOnHover ?? false,\n inlineCss: nextConfig.experimental.inlineCss ?? false,\n authInterrupts: !!nextConfig.experimental.authInterrupts,\n },\n reactMaxHeadersLength: nextConfig.reactMaxHeadersLength,\n hasReadableErrorStacks:\n nextConfig.experimental.serverSourceMaps === true &&\n // TODO(NDX-531): Checking (and setting) the minify flags should be\n // unnecessary once name mapping is fixed.\n (process.env.TURBOPACK\n ? nextConfig.experimental.turbopackMinify === false\n : nextConfig.experimental.serverMinification === false) &&\n nextConfig.experimental.enablePrerenderSourceMaps === true,\n }\n\n // We need this for server rendering the Link component.\n ;(globalThis as any).__NEXT_DATA__ = {\n nextExport: true,\n }\n\n const exportPathMap = await span\n .traceChild('run-export-path-map')\n .traceAsyncFn(async () => {\n const exportMap = await nextConfig.exportPathMap(defaultPathMap, {\n dev: false,\n dir,\n outDir,\n distDir,\n buildId,\n })\n return exportMap\n })\n\n // During static export, remove export 404/500 of pages router\n // when only app router presents\n if (!options.buildExport && options.appDirOnly) {\n delete exportPathMap['/404']\n delete exportPathMap['/500']\n }\n\n // only add missing 404 page when `buildExport` is false\n if (!options.buildExport && !options.appDirOnly) {\n // only add missing /404 if not specified in `exportPathMap`\n if (!exportPathMap['/404']) {\n exportPathMap['/404'] = { page: '/_error' }\n }\n\n /**\n * exports 404.html for backwards compat\n * E.g. GitHub Pages, GitLab Pages, Cloudflare Pages, Netlify\n */\n if (!exportPathMap['/404.html'] && exportPathMap['/404']) {\n // alias /404.html to /404 to be compatible with custom 404 / _error page\n exportPathMap['/404.html'] = exportPathMap['/404']\n }\n }\n\n const allExportPaths: ExportPathEntry[] = []\n const seenExportPaths = new Set<string>()\n const fallbackEnabledPages = new Set<string>()\n\n for (const [path, entry] of Object.entries(exportPathMap)) {\n // make sure to prevent duplicates\n const normalizedPath = denormalizePagePath(normalizePagePath(path))\n\n if (seenExportPaths.has(normalizedPath)) {\n continue\n }\n\n seenExportPaths.add(normalizedPath)\n\n if (!entry._isAppDir && isAPIRoute(entry.page)) {\n hasApiRoutes = true\n continue\n }\n\n allExportPaths.push({ ...entry, path: normalizedPath })\n\n if (prerenderManifest && !options.buildExport) {\n const prerenderInfo = prerenderManifest.dynamicRoutes[entry.page]\n\n if (prerenderInfo && prerenderInfo.fallback !== false) {\n fallbackEnabledPages.add(entry.page)\n }\n }\n }\n\n if (allExportPaths.length === 0) {\n if (!prerenderManifest) {\n return null\n }\n }\n\n if (fallbackEnabledPages.size > 0) {\n throw new ExportError(\n `Found pages with \\`fallback\\` enabled:\\n${[...fallbackEnabledPages].join(\n '\\n'\n )}\\n${SSG_FALLBACK_EXPORT_ERROR}\\n`\n )\n }\n\n let hasMiddleware = false\n\n if (!options.buildExport) {\n try {\n const middlewareManifest = require(\n join(distDir, SERVER_DIRECTORY, MIDDLEWARE_MANIFEST)\n ) as MiddlewareManifest\n\n const functionsConfigManifest = require(\n join(distDir, SERVER_DIRECTORY, FUNCTIONS_CONFIG_MANIFEST)\n )\n\n hasMiddleware =\n Object.keys(middlewareManifest.middleware).length > 0 ||\n Boolean(functionsConfigManifest.functions?.['/_middleware'])\n } catch {}\n\n // Warn if the user defines a path for an API page\n if (hasApiRoutes || hasMiddleware) {\n if (nextConfig.output === 'export') {\n Log.warn(\n yellow(\n `Statically exporting a Next.js application via \\`next export\\` disables API routes and middleware.`\n ) +\n `\\n` +\n yellow(\n `This command is meant for static-only hosts, and is` +\n ' ' +\n bold(`not necessary to make your application static.`)\n ) +\n `\\n` +\n yellow(\n `Pages in your application without server-side data dependencies will be automatically statically exported by \\`next build\\`, including pages powered by \\`getStaticProps\\`.`\n ) +\n `\\n` +\n yellow(\n `Learn more: https://nextjs.org/docs/messages/api-routes-static-export`\n )\n )\n }\n }\n }\n\n const pagesDataDir = options.buildExport\n ? outDir\n : join(outDir, '_next/data', buildId)\n\n const ampValidations: AmpPageStatus = {}\n\n const publicDir = join(dir, CLIENT_PUBLIC_FILES_PATH)\n // Copy public directory\n if (!options.buildExport && existsSync(publicDir)) {\n if (!options.silent) {\n Log.info('Copying \"public\" directory')\n }\n await span.traceChild('copy-public-directory').traceAsyncFn(() =>\n recursiveCopy(publicDir, outDir, {\n filter(path) {\n // Exclude paths used by pages\n return !exportPathMap[path]\n },\n })\n )\n }\n\n const exportPagesInBatches = async (\n worker: StaticWorker,\n exportPaths: ExportPathEntry[],\n renderResumeDataCachesByPage?: Record<string, string>\n ): Promise<ExportPagesResult> => {\n // Batch filtered pages into smaller batches, and call the export worker on\n // each batch. We've set a default minimum of 25 pages per batch to ensure\n // that even setups with only a few static pages can leverage a shared\n // incremental cache, however this value can be configured.\n const minPageCountPerBatch =\n nextConfig.experimental.staticGenerationMinPagesPerWorker ?? 25\n\n // Calculate the number of workers needed to ensure each batch has at least\n // minPageCountPerBatch pages.\n const numWorkers = Math.min(\n options.numWorkers,\n Math.ceil(exportPaths.length / minPageCountPerBatch)\n )\n\n // Calculate the page count per batch based on the number of workers.\n const pageCountPerBatch = Math.ceil(exportPaths.length / numWorkers)\n\n const batches = Array.from({ length: numWorkers }, (_, i) =>\n exportPaths.slice(i * pageCountPerBatch, (i + 1) * pageCountPerBatch)\n )\n\n // Distribute remaining pages.\n const remainingPages = exportPaths.slice(numWorkers * pageCountPerBatch)\n remainingPages.forEach((page, index) => {\n batches[index % batches.length].push(page)\n })\n\n return (\n await Promise.all(\n batches.map(async (batch) =>\n worker.exportPages({\n buildId,\n exportPaths: batch,\n parentSpanId: span.getId(),\n pagesDataDir,\n renderOpts,\n options,\n dir,\n distDir,\n outDir,\n nextConfig,\n cacheHandler: nextConfig.cacheHandler,\n cacheMaxMemorySize: nextConfig.cacheMaxMemorySize,\n fetchCache: true,\n fetchCacheKeyPrefix: nextConfig.experimental.fetchCacheKeyPrefix,\n renderResumeDataCachesByPage,\n })\n )\n )\n ).flat()\n }\n\n let initialPhaseExportPaths: ExportPathEntry[] = []\n const finalPhaseExportPaths: ExportPathEntry[] = []\n\n if (renderOpts.experimental.cacheComponents) {\n for (const exportPath of allExportPaths) {\n if (exportPath._allowEmptyStaticShell) {\n finalPhaseExportPaths.push(exportPath)\n } else {\n initialPhaseExportPaths.push(exportPath)\n }\n }\n } else {\n initialPhaseExportPaths = allExportPaths\n }\n\n const totalExportPaths =\n initialPhaseExportPaths.length + finalPhaseExportPaths.length\n let worker: StaticWorker | null = null\n let results: ExportPagesResult = []\n\n if (totalExportPaths > 0) {\n const progress = createProgress(\n totalExportPaths,\n options.statusMessage || 'Exporting'\n )\n\n worker = createStaticWorker(nextConfig, {\n debuggerPortOffset: getNextBuildDebuggerPortOffset({\n kind: 'export-page',\n }),\n progress,\n })\n\n results = await exportPagesInBatches(worker, initialPhaseExportPaths)\n\n if (finalPhaseExportPaths.length > 0) {\n const renderResumeDataCachesByPage: Record<string, string> = {}\n\n for (const { page, result } of results) {\n if (!result) {\n continue\n }\n\n if ('renderResumeDataCache' in result && result.renderResumeDataCache) {\n // The last RDC for each page is used. We only need one. It should have\n // all the entries that the fallback shell also needs. We don't need to\n // merge them per page.\n renderResumeDataCachesByPage[page] = result.renderResumeDataCache\n // Remove the RDC string from the result so that it can be garbage\n // collected, when there are more results for the same page.\n result.renderResumeDataCache = undefined\n }\n }\n\n const finalPhaseResults = await exportPagesInBatches(\n worker,\n finalPhaseExportPaths,\n renderResumeDataCachesByPage\n )\n\n results.push(...finalPhaseResults)\n }\n }\n\n let hadValidationError = false\n\n const collector: ExportAppResult = {\n byPath: new Map(),\n byPage: new Map(),\n ssgNotFoundPaths: new Set(),\n turborepoAccessTraceResults: new Map(),\n }\n\n const failedExportAttemptsByPage: Map<string, boolean> = new Map()\n\n for (const { result, path, page, pageKey } of results) {\n if (!result) continue\n if ('error' in result) {\n failedExportAttemptsByPage.set(pageKey, true)\n continue\n }\n\n if (result.turborepoAccessTraceResult) {\n collector.turborepoAccessTraceResults?.set(\n path,\n TurborepoAccessTraceResult.fromSerialized(\n result.turborepoAccessTraceResult\n )\n )\n }\n\n // Capture any amp validations.\n if (result.ampValidations) {\n for (const validation of result.ampValidations) {\n ampValidations[validation.page] = validation.result\n hadValidationError ||= validation.result.errors.length > 0\n }\n }\n\n if (options.buildExport) {\n // Update path info by path.\n const info = collector.byPath.get(path) ?? {}\n if (result.cacheControl) {\n info.cacheControl = result.cacheControl\n }\n if (typeof result.metadata !== 'undefined') {\n info.metadata = result.metadata\n }\n\n if (typeof result.hasEmptyStaticShell !== 'undefined') {\n info.hasEmptyStaticShell = result.hasEmptyStaticShell\n }\n\n if (typeof result.hasPostponed !== 'undefined') {\n info.hasPostponed = result.hasPostponed\n }\n\n if (typeof result.fetchMetrics !== 'undefined') {\n info.fetchMetrics = result.fetchMetrics\n }\n\n collector.byPath.set(path, info)\n\n // Update not found.\n if (result.ssgNotFound === true) {\n collector.ssgNotFoundPaths.add(path)\n }\n\n // Update durations.\n const durations = collector.byPage.get(page) ?? {\n durationsByPath: new Map<string, number>(),\n }\n durations.durationsByPath.set(path, result.duration)\n collector.byPage.set(page, durations)\n }\n }\n\n // Export mode provide static outputs that are not compatible with PPR mode.\n if (!options.buildExport && nextConfig.experimental.ppr) {\n // TODO: add message\n throw new Error('Invariant: PPR cannot be enabled in export mode')\n }\n\n // copy prerendered routes to outDir\n if (!options.buildExport && prerenderManifest) {\n await Promise.all(\n Object.keys(prerenderManifest.routes).map(async (unnormalizedRoute) => {\n // Special handling: map app /_not-found to 404.html (and 404/index.html when trailingSlash)\n if (unnormalizedRoute === '/_not-found') {\n const { srcRoute } = prerenderManifest!.routes[unnormalizedRoute]\n const appPageName = mapAppRouteToPage.get(srcRoute || '')\n const pageName = appPageName || srcRoute || unnormalizedRoute\n const isAppPath = Boolean(appPageName)\n const route = normalizePagePath(unnormalizedRoute)\n\n const pagePath = getPagePath(pageName, distDir, undefined, isAppPath)\n const distPagesDir = join(\n pagePath,\n pageName\n .slice(1)\n .split('/')\n .map(() => '..')\n .join('/')\n )\n\n const orig = join(distPagesDir, route)\n const htmlSrc = `${orig}.html`\n\n // write 404.html at root\n const htmlDest404 = join(outDir, '404.html')\n await fs.mkdir(dirname(htmlDest404), { recursive: true })\n await fs.copyFile(htmlSrc, htmlDest404)\n\n // When trailingSlash, also write 404/index.html\n if (subFolders) {\n const htmlDest404Index = join(outDir, '404', 'index.html')\n await fs.mkdir(dirname(htmlDest404Index), { recursive: true })\n await fs.copyFile(htmlSrc, htmlDest404Index)\n }\n }\n // Skip 500.html in static export\n if (unnormalizedRoute === '/_global-error') {\n return\n }\n const { srcRoute } = prerenderManifest!.routes[unnormalizedRoute]\n const appPageName = mapAppRouteToPage.get(srcRoute || '')\n const pageName = appPageName || srcRoute || unnormalizedRoute\n const isAppPath = Boolean(appPageName)\n const isAppRouteHandler = appPageName && isAppRouteRoute(appPageName)\n\n // returning notFound: true from getStaticProps will not\n // output html/json files during the build\n if (prerenderManifest!.notFoundRoutes.includes(unnormalizedRoute)) {\n return\n }\n // TODO: This rewrites /index/foo to /index/index/foo. Investigate and\n // fix. I presume this was because normalizePagePath was designed for\n // some other use case and then reused here for static exports without\n // realizing the implications.\n const route = normalizePagePath(unnormalizedRoute)\n\n const pagePath = getPagePath(pageName, distDir, undefined, isAppPath)\n const distPagesDir = join(\n pagePath,\n // strip leading / and then recurse number of nested dirs\n // to place from base folder\n pageName\n .slice(1)\n .split('/')\n .map(() => '..')\n .join('/')\n )\n\n const orig = join(distPagesDir, route)\n const handlerSrc = `${orig}.body`\n const handlerDest = join(outDir, route)\n\n if (isAppRouteHandler && existsSync(handlerSrc)) {\n await fs.mkdir(dirname(handlerDest), { recursive: true })\n await fs.copyFile(handlerSrc, handlerDest)\n return\n }\n\n const htmlDest = join(\n outDir,\n `${route}${\n subFolders && route !== '/index' ? `${sep}index` : ''\n }.html`\n )\n const ampHtmlDest = join(\n outDir,\n `${route}.amp${subFolders ? `${sep}index` : ''}.html`\n )\n const jsonDest = isAppPath\n ? join(\n outDir,\n `${route}${\n subFolders && route !== '/index' ? `${sep}index` : ''\n }.txt`\n )\n : join(pagesDataDir, `${route}.json`)\n\n await fs.mkdir(dirname(htmlDest), { recursive: true })\n await fs.mkdir(dirname(jsonDest), { recursive: true })\n\n const htmlSrc = `${orig}.html`\n const jsonSrc = `${orig}${isAppPath ? RSC_SUFFIX : '.json'}`\n\n await fs.copyFile(htmlSrc, htmlDest)\n await fs.copyFile(jsonSrc, jsonDest)\n\n if (existsSync(`${orig}.amp.html`)) {\n await fs.mkdir(dirname(ampHtmlDest), { recursive: true })\n await fs.copyFile(`${orig}.amp.html`, ampHtmlDest)\n }\n\n const segmentsDir = `${orig}${RSC_SEGMENTS_DIR_SUFFIX}`\n\n if (isAppPath && existsSync(segmentsDir)) {\n // Output a data file for each of this page's segments\n //\n // These files are requested by the client router's internal\n // prefetcher, not the user directly. So we don't need to account for\n // things like trailing slash handling.\n //\n // To keep the protocol simple, we can use the non-normalized route\n // path instead of the normalized one (which, among other things,\n // rewrites `/` to `/index`).\n const segmentsDirDest = join(outDir, unnormalizedRoute)\n const segmentPaths = await collectSegmentPaths(segmentsDir)\n await Promise.all(\n segmentPaths.map(async (segmentFileSrc) => {\n const segmentPath =\n '/' + segmentFileSrc.slice(0, -RSC_SEGMENT_SUFFIX.length)\n const segmentFilename =\n convertSegmentPathToStaticExportFilename(segmentPath)\n const segmentFileDest = join(segmentsDirDest, segmentFilename)\n await fs.mkdir(dirname(segmentFileDest), { recursive: true })\n await fs.copyFile(\n join(segmentsDir, segmentFileSrc),\n segmentFileDest\n )\n })\n )\n }\n })\n )\n }\n\n if (Object.keys(ampValidations).length) {\n console.log(formatAmpMessages(ampValidations))\n }\n if (hadValidationError) {\n throw new ExportError(\n `AMP Validation caused the export to fail. https://nextjs.org/docs/messages/amp-export-validation`\n )\n }\n\n if (failedExportAttemptsByPage.size > 0) {\n const failedPages = Array.from(failedExportAttemptsByPage.keys())\n throw new ExportError(\n `Export encountered errors on following paths:\\n\\t${failedPages\n .sort()\n .join('\\n\\t')}`\n )\n }\n\n await fs.writeFile(\n join(distDir, EXPORT_DETAIL),\n formatManifest({\n version: 1,\n outDirectory: outDir,\n success: true,\n }),\n 'utf8'\n )\n\n if (telemetry) {\n await telemetry.flush()\n }\n\n if (worker) {\n await worker.end()\n }\n\n return collector\n}\n\nasync function collectSegmentPaths(segmentsDirectory: string) {\n const results: Array<string> = []\n await collectSegmentPathsImpl(segmentsDirectory, segmentsDirectory, results)\n return results\n}\n\nasync function collectSegmentPathsImpl(\n segmentsDirectory: string,\n directory: string,\n results: Array<string>\n) {\n const segmentFiles = await fs.readdir(directory, {\n withFileTypes: true,\n })\n await Promise.all(\n segmentFiles.map(async (segmentFile) => {\n if (segmentFile.isDirectory()) {\n await collectSegmentPathsImpl(\n segmentsDirectory,\n join(directory, segmentFile.name),\n results\n )\n return\n }\n if (!segmentFile.name.endsWith(RSC_SEGMENT_SUFFIX)) {\n return\n }\n results.push(\n relative(segmentsDirectory, join(directory, segmentFile.name))\n )\n })\n )\n}\n\nexport default async function exportApp(\n dir: string,\n options: ExportAppOptions,\n span: Span\n): Promise<ExportAppResult | null> {\n const nextExportSpan = span.traceChild('next-export')\n\n return nextExportSpan.traceAsyncFn(async () => {\n return await exportAppImpl(dir, options, nextExportSpan)\n })\n}\n"],"names":["ExportError","exportApp","Error","code","exportAppImpl","dir","options","span","nextConfig","resolve","traceChild","traceFn","loadEnvConfig","Log","enabledDirectories","traceAsyncFn","loadConfig","PHASE_EXPORT","debugPrerender","distDir","join","telemetry","buildExport","Telemetry","record","eventCliSession","webpackVersion","cliCommand","isSrcDir","hasNowJson","findUp","cwd","isCustomServer","turboFlag","pagesDir","appDir","subFolders","trailingSlash","silent","info","buildIdFile","BUILD_ID_FILE","existsSync","customRoutes","filter","config","hasNextSupport","length","warn","buildId","fs","readFile","pagesManifest","pages","require","SERVER_DIRECTORY","PAGES_MANIFEST","prerenderManifest","PRERENDER_MANIFEST","appRoutePathManifest","APP_PATH_ROUTES_MANIFEST","err","isError","undefined","excludedPrerenderRoutes","Set","Object","keys","defaultPathMap","hasApiRoutes","page","isAPIRoute","dynamicRoutes","add","mapAppRouteToPage","Map","pageName","routePath","entries","set","isAppPageRoute","routes","_isAppDir","outDir","outdir","rm","recursive","force","mkdir","writeFile","EXPORT_DETAIL","formatManifest","version","outDirectory","success","recursiveCopy","CLIENT_STATIC_FILES_PATH","exportPathMap","defaultMap","i18n","images","loader","unoptimized","isNextImageImported","EXPORT_MARKER","then","text","JSON","parse","catch","serverActionsManifest","app","SERVER_REFERENCE_MANIFEST","output","routesManifest","ROUTES_MANIFEST","rewrites","beforeFiles","hasInterceptionRouteRewrite","some","isInterceptionRouteRewrite","actionIds","node","edge","actionId","extractInfoFromServerReferenceId","type","renderOpts","previewProps","preview","nextExport","assetPrefix","replace","dev","basePath","canonicalBase","amp","ampSkipValidation","experimental","skipValidation","ampOptimizerConfig","optimizer","locales","locale","defaultLocale","domainLocales","domains","disableOptimizedLoading","supportsDynamicResponse","crossOrigin","optimizeCss","nextConfigOutput","nextScriptWorkers","largePageDataBytes","serverActions","serverComponents","cacheLifeProfiles","cacheLife","nextFontManifest","NEXT_FONT_MANIFEST","deploymentId","htmlLimitedBots","source","clientTraceMetadata","expireTime","staleTimes","cacheComponents","clientSegmentCache","Boolean","clientParamParsing","clientParamParsingOrigins","dynamicOnHover","inlineCss","authInterrupts","reactMaxHeadersLength","hasReadableErrorStacks","serverSourceMaps","process","env","TURBOPACK","turbopackMinify","serverMinification","enablePrerenderSourceMaps","globalThis","__NEXT_DATA__","exportMap","appDirOnly","allExportPaths","seenExportPaths","fallbackEnabledPages","path","entry","normalizedPath","denormalizePagePath","normalizePagePath","has","push","prerenderInfo","fallback","size","SSG_FALLBACK_EXPORT_ERROR","hasMiddleware","functionsConfigManifest","middlewareManifest","MIDDLEWARE_MANIFEST","FUNCTIONS_CONFIG_MANIFEST","middleware","functions","yellow","bold","pagesDataDir","ampValidations","publicDir","CLIENT_PUBLIC_FILES_PATH","exportPagesInBatches","worker","exportPaths","renderResumeDataCachesByPage","minPageCountPerBatch","staticGenerationMinPagesPerWorker","numWorkers","Math","min","ceil","pageCountPerBatch","batches","Array","from","_","i","slice","remainingPages","forEach","index","Promise","all","map","batch","exportPages","parentSpanId","getId","cacheHandler","cacheMaxMemorySize","fetchCache","fetchCacheKeyPrefix","flat","initialPhaseExportPaths","finalPhaseExportPaths","exportPath","_allowEmptyStaticShell","totalExportPaths","results","progress","createProgress","statusMessage","createStaticWorker","debuggerPortOffset","getNextBuildDebuggerPortOffset","kind","result","renderResumeDataCache","finalPhaseResults","hadValidationError","collector","byPath","byPage","ssgNotFoundPaths","turborepoAccessTraceResults","failedExportAttemptsByPage","pageKey","turborepoAccessTraceResult","TurborepoAccessTraceResult","fromSerialized","validation","errors","get","cacheControl","metadata","hasEmptyStaticShell","hasPostponed","fetchMetrics","ssgNotFound","durations","durationsByPath","duration","ppr","unnormalizedRoute","srcRoute","appPageName","isAppPath","route","pagePath","getPagePath","distPagesDir","split","orig","htmlSrc","htmlDest404","dirname","copyFile","htmlDest404Index","isAppRouteHandler","isAppRouteRoute","notFoundRoutes","includes","handlerSrc","handlerDest","htmlDest","sep","ampHtmlDest","jsonDest","jsonSrc","RSC_SUFFIX","segmentsDir","RSC_SEGMENTS_DIR_SUFFIX","segmentsDirDest","segmentPaths","collectSegmentPaths","segmentFileSrc","segmentPath","RSC_SEGMENT_SUFFIX","segmentFilename","convertSegmentPathToStaticExportFilename","segmentFileDest","console","log","formatAmpMessages","failedPages","sort","flush","end","segmentsDirectory","collectSegmentPathsImpl","directory","segmentFiles","readdir","withFileTypes","segmentFile","isDirectory","name","endsWith","relative","nextExportSpan"],"mappings":";;;;;;;;;;;;;;;IAyEaA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AAKG,UAAU,CAAC;IAEvC,OAAO4U,eAAevU,YAAY,CAAC;QACjC,OAAO,MAAMX,cAAcC,KAAKC,SAASgV;IAC3C;AACF","ignoreList":[0]}
|
1
|
+
{"version":3,"sources":["../../src/export/index.ts"],"sourcesContent":["import type {\n ExportAppResult,\n ExportAppOptions,\n WorkerRenderOptsPartial,\n ExportPagesResult,\n ExportPathEntry,\n} from './types'\nimport {\n createStaticWorker,\n type PrerenderManifest,\n type StaticWorker,\n} from '../build'\nimport type { PagesManifest } from '../build/webpack/plugins/pages-manifest-plugin'\n\nimport { bold, yellow } from '../lib/picocolors'\nimport findUp from 'next/dist/compiled/find-up'\nimport { existsSync, promises as fs } from 'fs'\n\nimport '../server/require-hook'\n\nimport { dirname, join, resolve, sep, relative } from 'path'\nimport { formatAmpMessages } from '../build/output/index'\nimport type { AmpPageStatus } from '../build/output/index'\nimport * as Log from '../build/output/log'\nimport {\n RSC_SEGMENT_SUFFIX,\n RSC_SEGMENTS_DIR_SUFFIX,\n RSC_SUFFIX,\n SSG_FALLBACK_EXPORT_ERROR,\n} from '../lib/constants'\nimport { recursiveCopy } from '../lib/recursive-copy'\nimport {\n BUILD_ID_FILE,\n CLIENT_PUBLIC_FILES_PATH,\n CLIENT_STATIC_FILES_PATH,\n EXPORT_DETAIL,\n EXPORT_MARKER,\n NEXT_FONT_MANIFEST,\n MIDDLEWARE_MANIFEST,\n PAGES_MANIFEST,\n PHASE_EXPORT,\n PRERENDER_MANIFEST,\n SERVER_DIRECTORY,\n SERVER_REFERENCE_MANIFEST,\n APP_PATH_ROUTES_MANIFEST,\n ROUTES_MANIFEST,\n FUNCTIONS_CONFIG_MANIFEST,\n} from '../shared/lib/constants'\nimport loadConfig from '../server/config'\nimport type { ExportPathMap } from '../server/config-shared'\nimport { eventCliSession } from '../telemetry/events'\nimport { hasNextSupport } from '../server/ci-info'\nimport { Telemetry } from '../telemetry/storage'\nimport { normalizePagePath } from '../shared/lib/page-path/normalize-page-path'\nimport { denormalizePagePath } from '../shared/lib/page-path/denormalize-page-path'\nimport { loadEnvConfig } from '@next/env'\nimport { isAPIRoute } from '../lib/is-api-route'\nimport { getPagePath } from '../server/require'\nimport type { Span } from '../trace'\nimport type { MiddlewareManifest } from '../build/webpack/plugins/middleware-plugin'\nimport { isAppRouteRoute } from '../lib/is-app-route-route'\nimport { isAppPageRoute } from '../lib/is-app-page-route'\nimport isError from '../lib/is-error'\nimport { formatManifest } from '../build/manifests/formatter/format-manifest'\nimport { TurborepoAccessTraceResult } from '../build/turborepo-access-trace'\nimport { createProgress } from '../build/progress'\nimport type { DeepReadonly } from '../shared/lib/deep-readonly'\nimport { isInterceptionRouteRewrite } from '../lib/generate-interception-routes-rewrites'\nimport type { ActionManifest } from '../build/webpack/plugins/flight-client-entry-plugin'\nimport { extractInfoFromServerReferenceId } from '../shared/lib/server-reference-info'\nimport { convertSegmentPathToStaticExportFilename } from '../shared/lib/segment-cache/segment-value-encoding'\nimport { getNextBuildDebuggerPortOffset } from '../lib/worker'\n\nexport class ExportError extends Error {\n code = 'NEXT_EXPORT_ERROR'\n}\n\nasync function exportAppImpl(\n dir: string,\n options: Readonly<ExportAppOptions>,\n span: Span\n): Promise<ExportAppResult | null> {\n dir = resolve(dir)\n\n // attempt to load global env values so they are available in next.config.js\n span.traceChild('load-dotenv').traceFn(() => loadEnvConfig(dir, false, Log))\n\n const { enabledDirectories } = options\n\n const nextConfig =\n options.nextConfig ||\n (await span.traceChild('load-next-config').traceAsyncFn(() =>\n loadConfig(PHASE_EXPORT, dir, {\n debugPrerender: options.debugPrerender,\n })\n ))\n\n const distDir = join(dir, nextConfig.distDir)\n const telemetry = options.buildExport ? null : new Telemetry({ distDir })\n\n if (telemetry) {\n telemetry.record(\n eventCliSession(nextConfig, {\n webpackVersion: null,\n cliCommand: 'export',\n isSrcDir: null,\n hasNowJson: !!(await findUp('now.json', { cwd: dir })),\n isCustomServer: null,\n turboFlag: false,\n pagesDir: null,\n appDir: null,\n })\n )\n }\n\n const subFolders = nextConfig.trailingSlash && !options.buildExport\n\n if (!options.silent && !options.buildExport) {\n Log.info(`using build directory: ${distDir}`)\n }\n\n const buildIdFile = join(distDir, BUILD_ID_FILE)\n\n if (!existsSync(buildIdFile)) {\n throw new ExportError(\n `Could not find a production build in the '${distDir}' directory. Try building your app with 'next build' before starting the static export. https://nextjs.org/docs/messages/next-export-no-build-id`\n )\n }\n\n const customRoutes = (['rewrites', 'redirects', 'headers'] as const).filter(\n (config) => typeof nextConfig[config] === 'function'\n )\n\n if (!hasNextSupport && !options.buildExport && customRoutes.length > 0) {\n Log.warn(\n `rewrites, redirects, and headers are not applied when exporting your application, detected (${customRoutes.join(\n ', '\n )}). See more info here: https://nextjs.org/docs/messages/export-no-custom-routes`\n )\n }\n\n const buildId = await fs.readFile(buildIdFile, 'utf8')\n\n const pagesManifest =\n !options.pages &&\n (require(join(distDir, SERVER_DIRECTORY, PAGES_MANIFEST)) as PagesManifest)\n\n let prerenderManifest: DeepReadonly<PrerenderManifest> | undefined\n try {\n prerenderManifest = require(join(distDir, PRERENDER_MANIFEST))\n } catch {}\n\n let appRoutePathManifest: Record<string, string> | undefined\n try {\n appRoutePathManifest = require(join(distDir, APP_PATH_ROUTES_MANIFEST))\n } catch (err) {\n if (\n isError(err) &&\n (err.code === 'ENOENT' || err.code === 'MODULE_NOT_FOUND')\n ) {\n // the manifest doesn't exist which will happen when using\n // \"pages\" dir instead of \"app\" dir.\n appRoutePathManifest = undefined\n } else {\n // the manifest is malformed (invalid json)\n throw err\n }\n }\n\n const excludedPrerenderRoutes = new Set<string>()\n const pages = options.pages || Object.keys(pagesManifest)\n const defaultPathMap: ExportPathMap = {}\n\n let hasApiRoutes = false\n for (const page of pages) {\n // _document and _app are not real pages\n // _error is exported as 404.html later on\n // API Routes are Node.js functions\n\n if (isAPIRoute(page)) {\n hasApiRoutes = true\n continue\n }\n\n if (page === '/_document' || page === '/_app' || page === '/_error') {\n continue\n }\n\n // iSSG pages that are dynamic should not export templated version by\n // default. In most cases, this would never work. There is no server that\n // could run `getStaticProps`. If users make their page work lazily, they\n // can manually add it to the `exportPathMap`.\n if (prerenderManifest?.dynamicRoutes[page]) {\n excludedPrerenderRoutes.add(page)\n continue\n }\n\n defaultPathMap[page] = { page }\n }\n\n const mapAppRouteToPage = new Map<string, string>()\n if (!options.buildExport && appRoutePathManifest) {\n for (const [pageName, routePath] of Object.entries(appRoutePathManifest)) {\n mapAppRouteToPage.set(routePath, pageName)\n if (\n isAppPageRoute(pageName) &&\n !prerenderManifest?.routes[routePath] &&\n !prerenderManifest?.dynamicRoutes[routePath]\n ) {\n defaultPathMap[routePath] = {\n page: pageName,\n _isAppDir: true,\n }\n }\n }\n }\n\n // Initialize the output directory\n const outDir = options.outdir\n\n if (outDir === join(dir, 'public')) {\n throw new ExportError(\n `The 'public' directory is reserved in Next.js and can not be used as the export out directory. https://nextjs.org/docs/messages/can-not-output-to-public`\n )\n }\n\n if (outDir === join(dir, 'static')) {\n throw new ExportError(\n `The 'static' directory is reserved in Next.js and can not be used as the export out directory. https://nextjs.org/docs/messages/can-not-output-to-static`\n )\n }\n\n await fs.rm(outDir, { recursive: true, force: true })\n await fs.mkdir(join(outDir, '_next', buildId), { recursive: true })\n\n await fs.writeFile(\n join(distDir, EXPORT_DETAIL),\n formatManifest({\n version: 1,\n outDirectory: outDir,\n success: false,\n }),\n 'utf8'\n )\n\n // Copy static directory\n if (!options.buildExport && existsSync(join(dir, 'static'))) {\n if (!options.silent) {\n Log.info('Copying \"static\" directory')\n }\n await span\n .traceChild('copy-static-directory')\n .traceAsyncFn(() =>\n recursiveCopy(join(dir, 'static'), join(outDir, 'static'))\n )\n }\n\n // Copy .next/static directory\n if (\n !options.buildExport &&\n existsSync(join(distDir, CLIENT_STATIC_FILES_PATH))\n ) {\n if (!options.silent) {\n Log.info('Copying \"static build\" directory')\n }\n await span\n .traceChild('copy-next-static-directory')\n .traceAsyncFn(() =>\n recursiveCopy(\n join(distDir, CLIENT_STATIC_FILES_PATH),\n join(outDir, '_next', CLIENT_STATIC_FILES_PATH)\n )\n )\n }\n\n // Get the exportPathMap from the config file\n if (typeof nextConfig.exportPathMap !== 'function') {\n nextConfig.exportPathMap = async (defaultMap) => {\n return defaultMap\n }\n }\n\n const {\n i18n,\n images: { loader = 'default', unoptimized },\n } = nextConfig\n\n if (i18n && !options.buildExport) {\n throw new ExportError(\n `i18n support is not compatible with next export. See here for more info on deploying: https://nextjs.org/docs/messages/export-no-custom-routes`\n )\n }\n\n if (!options.buildExport) {\n const { isNextImageImported } = await span\n .traceChild('is-next-image-imported')\n .traceAsyncFn(() =>\n fs\n .readFile(join(distDir, EXPORT_MARKER), 'utf8')\n .then((text) => JSON.parse(text))\n .catch(() => ({}))\n )\n\n if (\n isNextImageImported &&\n loader === 'default' &&\n !unoptimized &&\n !hasNextSupport\n ) {\n throw new ExportError(\n `Image Optimization using the default loader is not compatible with export.\n Possible solutions:\n - Use \\`next start\\` to run a server, which includes the Image Optimization API.\n - Configure \\`images.unoptimized = true\\` in \\`next.config.js\\` to disable the Image Optimization API.\n Read more: https://nextjs.org/docs/messages/export-image-api`\n )\n }\n }\n\n let serverActionsManifest: ActionManifest | undefined\n if (enabledDirectories.app) {\n serverActionsManifest = require(\n join(distDir, SERVER_DIRECTORY, SERVER_REFERENCE_MANIFEST + '.json')\n ) as ActionManifest\n\n if (nextConfig.output === 'export') {\n const routesManifest = require(join(distDir, ROUTES_MANIFEST))\n\n // We already prevent rewrites earlier in the process, however Next.js will insert rewrites\n // for interception routes so we need to check for that here.\n if (routesManifest?.rewrites?.beforeFiles?.length > 0) {\n const hasInterceptionRouteRewrite =\n routesManifest.rewrites.beforeFiles.some(isInterceptionRouteRewrite)\n\n if (hasInterceptionRouteRewrite) {\n throw new ExportError(\n `Intercepting routes are not supported with static export.\\nRead more: https://nextjs.org/docs/app/building-your-application/deploying/static-exports#unsupported-features`\n )\n }\n }\n\n const actionIds = [\n ...Object.keys(serverActionsManifest.node),\n ...Object.keys(serverActionsManifest.edge),\n ]\n\n if (\n actionIds.some(\n (actionId) =>\n extractInfoFromServerReferenceId(actionId).type === 'server-action'\n )\n ) {\n throw new ExportError(\n `Server Actions are not supported with static export.\\nRead more: https://nextjs.org/docs/app/building-your-application/deploying/static-exports#unsupported-features`\n )\n }\n }\n }\n\n // Start the rendering process\n const renderOpts: WorkerRenderOptsPartial = {\n previewProps: prerenderManifest?.preview,\n nextExport: true,\n assetPrefix: nextConfig.assetPrefix.replace(/\\/$/, ''),\n distDir,\n dev: false,\n basePath: nextConfig.basePath,\n trailingSlash: nextConfig.trailingSlash,\n canonicalBase: nextConfig.amp?.canonicalBase || '',\n ampSkipValidation: nextConfig.experimental.amp?.skipValidation || false,\n ampOptimizerConfig: nextConfig.experimental.amp?.optimizer || undefined,\n locales: i18n?.locales,\n locale: i18n?.defaultLocale,\n defaultLocale: i18n?.defaultLocale,\n domainLocales: i18n?.domains,\n disableOptimizedLoading: nextConfig.experimental.disableOptimizedLoading,\n // Exported pages do not currently support dynamic HTML.\n supportsDynamicResponse: false,\n crossOrigin: nextConfig.crossOrigin,\n optimizeCss: nextConfig.experimental.optimizeCss,\n nextConfigOutput: nextConfig.output,\n nextScriptWorkers: nextConfig.experimental.nextScriptWorkers,\n largePageDataBytes: nextConfig.experimental.largePageDataBytes,\n serverActions: nextConfig.experimental.serverActions,\n serverComponents: enabledDirectories.app,\n cacheLifeProfiles: nextConfig.experimental.cacheLife,\n nextFontManifest: require(\n join(distDir, 'server', `${NEXT_FONT_MANIFEST}.json`)\n ),\n images: nextConfig.images,\n ...(enabledDirectories.app\n ? {\n serverActionsManifest,\n }\n : {}),\n deploymentId: nextConfig.deploymentId,\n htmlLimitedBots: nextConfig.htmlLimitedBots.source,\n experimental: {\n clientTraceMetadata: nextConfig.experimental.clientTraceMetadata,\n expireTime: nextConfig.expireTime,\n staleTimes: nextConfig.experimental.staleTimes,\n cacheComponents: nextConfig.experimental.cacheComponents ?? false,\n clientSegmentCache:\n nextConfig.experimental.clientSegmentCache === 'client-only'\n ? 'client-only'\n : Boolean(nextConfig.experimental.clientSegmentCache),\n clientParamParsing: nextConfig.experimental.clientParamParsing ?? false,\n clientParamParsingOrigins:\n nextConfig.experimental.clientParamParsingOrigins,\n dynamicOnHover: nextConfig.experimental.dynamicOnHover ?? false,\n inlineCss: nextConfig.experimental.inlineCss ?? false,\n authInterrupts: !!nextConfig.experimental.authInterrupts,\n },\n reactMaxHeadersLength: nextConfig.reactMaxHeadersLength,\n hasReadableErrorStacks:\n nextConfig.experimental.serverSourceMaps === true &&\n // TODO(NDX-531): Checking (and setting) the minify flags should be\n // unnecessary once name mapping is fixed.\n (process.env.TURBOPACK\n ? nextConfig.experimental.turbopackMinify === false\n : nextConfig.experimental.serverMinification === false) &&\n nextConfig.experimental.enablePrerenderSourceMaps === true,\n }\n\n // We need this for server rendering the Link component.\n ;(globalThis as any).__NEXT_DATA__ = {\n nextExport: true,\n }\n\n const exportPathMap = await span\n .traceChild('run-export-path-map')\n .traceAsyncFn(async () => {\n const exportMap = await nextConfig.exportPathMap(defaultPathMap, {\n dev: false,\n dir,\n outDir,\n distDir,\n buildId,\n })\n return exportMap\n })\n\n // During static export, remove export 404/500 of pages router\n // when only app router presents\n if (!options.buildExport && options.appDirOnly) {\n delete exportPathMap['/404']\n delete exportPathMap['/500']\n }\n\n // only add missing 404 page when `buildExport` is false\n if (!options.buildExport && !options.appDirOnly) {\n // only add missing /404 if not specified in `exportPathMap`\n if (!exportPathMap['/404']) {\n exportPathMap['/404'] = { page: '/_error' }\n }\n\n /**\n * exports 404.html for backwards compat\n * E.g. GitHub Pages, GitLab Pages, Cloudflare Pages, Netlify\n */\n if (!exportPathMap['/404.html'] && exportPathMap['/404']) {\n // alias /404.html to /404 to be compatible with custom 404 / _error page\n exportPathMap['/404.html'] = exportPathMap['/404']\n }\n }\n\n const allExportPaths: ExportPathEntry[] = []\n const seenExportPaths = new Set<string>()\n const fallbackEnabledPages = new Set<string>()\n\n for (const [path, entry] of Object.entries(exportPathMap)) {\n // make sure to prevent duplicates\n const normalizedPath = denormalizePagePath(normalizePagePath(path))\n\n if (seenExportPaths.has(normalizedPath)) {\n continue\n }\n\n seenExportPaths.add(normalizedPath)\n\n if (!entry._isAppDir && isAPIRoute(entry.page)) {\n hasApiRoutes = true\n continue\n }\n\n allExportPaths.push({ ...entry, path: normalizedPath })\n\n if (prerenderManifest && !options.buildExport) {\n const prerenderInfo = prerenderManifest.dynamicRoutes[entry.page]\n\n if (prerenderInfo && prerenderInfo.fallback !== false) {\n fallbackEnabledPages.add(entry.page)\n }\n }\n }\n\n if (allExportPaths.length === 0) {\n if (!prerenderManifest) {\n return null\n }\n }\n\n if (fallbackEnabledPages.size > 0) {\n throw new ExportError(\n `Found pages with \\`fallback\\` enabled:\\n${[...fallbackEnabledPages].join(\n '\\n'\n )}\\n${SSG_FALLBACK_EXPORT_ERROR}\\n`\n )\n }\n\n let hasMiddleware = false\n\n if (!options.buildExport) {\n try {\n const middlewareManifest = require(\n join(distDir, SERVER_DIRECTORY, MIDDLEWARE_MANIFEST)\n ) as MiddlewareManifest\n\n const functionsConfigManifest = require(\n join(distDir, SERVER_DIRECTORY, FUNCTIONS_CONFIG_MANIFEST)\n )\n\n hasMiddleware =\n Object.keys(middlewareManifest.middleware).length > 0 ||\n Boolean(functionsConfigManifest.functions?.['/_middleware'])\n } catch {}\n\n // Warn if the user defines a path for an API page\n if (hasApiRoutes || hasMiddleware) {\n if (nextConfig.output === 'export') {\n Log.warn(\n yellow(\n `Statically exporting a Next.js application via \\`next export\\` disables API routes and middleware.`\n ) +\n `\\n` +\n yellow(\n `This command is meant for static-only hosts, and is` +\n ' ' +\n bold(`not necessary to make your application static.`)\n ) +\n `\\n` +\n yellow(\n `Pages in your application without server-side data dependencies will be automatically statically exported by \\`next build\\`, including pages powered by \\`getStaticProps\\`.`\n ) +\n `\\n` +\n yellow(\n `Learn more: https://nextjs.org/docs/messages/api-routes-static-export`\n )\n )\n }\n }\n }\n\n const pagesDataDir = options.buildExport\n ? outDir\n : join(outDir, '_next/data', buildId)\n\n const ampValidations: AmpPageStatus = {}\n\n const publicDir = join(dir, CLIENT_PUBLIC_FILES_PATH)\n // Copy public directory\n if (!options.buildExport && existsSync(publicDir)) {\n if (!options.silent) {\n Log.info('Copying \"public\" directory')\n }\n await span.traceChild('copy-public-directory').traceAsyncFn(() =>\n recursiveCopy(publicDir, outDir, {\n filter(path) {\n // Exclude paths used by pages\n return !exportPathMap[path]\n },\n })\n )\n }\n\n const exportPagesInBatches = async (\n worker: StaticWorker,\n exportPaths: ExportPathEntry[],\n renderResumeDataCachesByPage?: Record<string, string>\n ): Promise<ExportPagesResult> => {\n // Batch filtered pages into smaller batches, and call the export worker on\n // each batch. We've set a default minimum of 25 pages per batch to ensure\n // that even setups with only a few static pages can leverage a shared\n // incremental cache, however this value can be configured.\n const minPageCountPerBatch =\n nextConfig.experimental.staticGenerationMinPagesPerWorker ?? 25\n\n // Calculate the number of workers needed to ensure each batch has at least\n // minPageCountPerBatch pages.\n const numWorkers = Math.min(\n options.numWorkers,\n Math.ceil(exportPaths.length / minPageCountPerBatch)\n )\n\n // Calculate the page count per batch based on the number of workers.\n const pageCountPerBatch = Math.ceil(exportPaths.length / numWorkers)\n\n const batches = Array.from({ length: numWorkers }, (_, i) =>\n exportPaths.slice(i * pageCountPerBatch, (i + 1) * pageCountPerBatch)\n )\n\n // Distribute remaining pages.\n const remainingPages = exportPaths.slice(numWorkers * pageCountPerBatch)\n remainingPages.forEach((page, index) => {\n batches[index % batches.length].push(page)\n })\n\n return (\n await Promise.all(\n batches.map(async (batch) =>\n worker.exportPages({\n buildId,\n exportPaths: batch,\n parentSpanId: span.getId(),\n pagesDataDir,\n renderOpts,\n options,\n dir,\n distDir,\n outDir,\n nextConfig,\n cacheHandler: nextConfig.cacheHandler,\n cacheMaxMemorySize: nextConfig.cacheMaxMemorySize,\n fetchCache: true,\n fetchCacheKeyPrefix: nextConfig.experimental.fetchCacheKeyPrefix,\n renderResumeDataCachesByPage,\n })\n )\n )\n ).flat()\n }\n\n let initialPhaseExportPaths: ExportPathEntry[] = []\n const finalPhaseExportPaths: ExportPathEntry[] = []\n\n if (renderOpts.experimental.cacheComponents) {\n for (const exportPath of allExportPaths) {\n if (exportPath._allowEmptyStaticShell) {\n finalPhaseExportPaths.push(exportPath)\n } else {\n initialPhaseExportPaths.push(exportPath)\n }\n }\n } else {\n initialPhaseExportPaths = allExportPaths\n }\n\n const totalExportPaths =\n initialPhaseExportPaths.length + finalPhaseExportPaths.length\n let worker: StaticWorker | null = null\n let results: ExportPagesResult = []\n\n if (totalExportPaths > 0) {\n const progress = createProgress(\n totalExportPaths,\n options.statusMessage || 'Exporting'\n )\n\n worker = createStaticWorker(nextConfig, {\n debuggerPortOffset: getNextBuildDebuggerPortOffset({\n kind: 'export-page',\n }),\n progress,\n })\n\n results = await exportPagesInBatches(worker, initialPhaseExportPaths)\n\n if (finalPhaseExportPaths.length > 0) {\n const renderResumeDataCachesByPage: Record<string, string> = {}\n\n for (const { page, result } of results) {\n if (!result) {\n continue\n }\n\n if ('renderResumeDataCache' in result && result.renderResumeDataCache) {\n // The last RDC for each page is used. We only need one. It should have\n // all the entries that the fallback shell also needs. We don't need to\n // merge them per page.\n renderResumeDataCachesByPage[page] = result.renderResumeDataCache\n // Remove the RDC string from the result so that it can be garbage\n // collected, when there are more results for the same page.\n result.renderResumeDataCache = undefined\n }\n }\n\n const finalPhaseResults = await exportPagesInBatches(\n worker,\n finalPhaseExportPaths,\n renderResumeDataCachesByPage\n )\n\n results.push(...finalPhaseResults)\n }\n }\n\n let hadValidationError = false\n\n const collector: ExportAppResult = {\n byPath: new Map(),\n byPage: new Map(),\n ssgNotFoundPaths: new Set(),\n turborepoAccessTraceResults: new Map(),\n }\n\n const failedExportAttemptsByPage: Map<string, boolean> = new Map()\n\n for (const { result, path, page, pageKey } of results) {\n if (!result) continue\n if ('error' in result) {\n failedExportAttemptsByPage.set(pageKey, true)\n continue\n }\n\n if (result.turborepoAccessTraceResult) {\n collector.turborepoAccessTraceResults?.set(\n path,\n TurborepoAccessTraceResult.fromSerialized(\n result.turborepoAccessTraceResult\n )\n )\n }\n\n // Capture any amp validations.\n if (result.ampValidations) {\n for (const validation of result.ampValidations) {\n ampValidations[validation.page] = validation.result\n hadValidationError ||= validation.result.errors.length > 0\n }\n }\n\n if (options.buildExport) {\n // Update path info by path.\n const info = collector.byPath.get(path) ?? {}\n if (result.cacheControl) {\n info.cacheControl = result.cacheControl\n }\n if (typeof result.metadata !== 'undefined') {\n info.metadata = result.metadata\n }\n\n if (typeof result.hasEmptyStaticShell !== 'undefined') {\n info.hasEmptyStaticShell = result.hasEmptyStaticShell\n }\n\n if (typeof result.hasPostponed !== 'undefined') {\n info.hasPostponed = result.hasPostponed\n }\n\n if (typeof result.fetchMetrics !== 'undefined') {\n info.fetchMetrics = result.fetchMetrics\n }\n\n collector.byPath.set(path, info)\n\n // Update not found.\n if (result.ssgNotFound === true) {\n collector.ssgNotFoundPaths.add(path)\n }\n\n // Update durations.\n const durations = collector.byPage.get(page) ?? {\n durationsByPath: new Map<string, number>(),\n }\n durations.durationsByPath.set(path, result.duration)\n collector.byPage.set(page, durations)\n }\n }\n\n // Export mode provide static outputs that are not compatible with PPR mode.\n if (!options.buildExport && nextConfig.experimental.ppr) {\n // TODO: add message\n throw new Error('Invariant: PPR cannot be enabled in export mode')\n }\n\n // copy prerendered routes to outDir\n if (!options.buildExport && prerenderManifest) {\n await Promise.all(\n Object.keys(prerenderManifest.routes).map(async (unnormalizedRoute) => {\n // Special handling: map app /_not-found to 404.html (and 404/index.html when trailingSlash)\n if (unnormalizedRoute === '/_not-found') {\n const { srcRoute } = prerenderManifest!.routes[unnormalizedRoute]\n const appPageName = mapAppRouteToPage.get(srcRoute || '')\n const pageName = appPageName || srcRoute || unnormalizedRoute\n const isAppPath = Boolean(appPageName)\n const route = normalizePagePath(unnormalizedRoute)\n\n const pagePath = getPagePath(pageName, distDir, undefined, isAppPath)\n const distPagesDir = join(\n pagePath,\n pageName\n .slice(1)\n .split('/')\n .map(() => '..')\n .join('/')\n )\n\n const orig = join(distPagesDir, route)\n const htmlSrc = `${orig}.html`\n\n // write 404.html at root\n const htmlDest404 = join(outDir, '404.html')\n await fs.mkdir(dirname(htmlDest404), { recursive: true })\n await fs.copyFile(htmlSrc, htmlDest404)\n\n // When trailingSlash, also write 404/index.html\n if (subFolders) {\n const htmlDest404Index = join(outDir, '404', 'index.html')\n await fs.mkdir(dirname(htmlDest404Index), { recursive: true })\n await fs.copyFile(htmlSrc, htmlDest404Index)\n }\n }\n // Skip 500.html in static export\n if (unnormalizedRoute === '/_global-error') {\n return\n }\n const { srcRoute } = prerenderManifest!.routes[unnormalizedRoute]\n const appPageName = mapAppRouteToPage.get(srcRoute || '')\n const pageName = appPageName || srcRoute || unnormalizedRoute\n const isAppPath = Boolean(appPageName)\n const isAppRouteHandler = appPageName && isAppRouteRoute(appPageName)\n\n // returning notFound: true from getStaticProps will not\n // output html/json files during the build\n if (prerenderManifest!.notFoundRoutes.includes(unnormalizedRoute)) {\n return\n }\n // TODO: This rewrites /index/foo to /index/index/foo. Investigate and\n // fix. I presume this was because normalizePagePath was designed for\n // some other use case and then reused here for static exports without\n // realizing the implications.\n const route = normalizePagePath(unnormalizedRoute)\n\n const pagePath = getPagePath(pageName, distDir, undefined, isAppPath)\n const distPagesDir = join(\n pagePath,\n // strip leading / and then recurse number of nested dirs\n // to place from base folder\n pageName\n .slice(1)\n .split('/')\n .map(() => '..')\n .join('/')\n )\n\n const orig = join(distPagesDir, route)\n const handlerSrc = `${orig}.body`\n const handlerDest = join(outDir, route)\n\n if (isAppRouteHandler && existsSync(handlerSrc)) {\n await fs.mkdir(dirname(handlerDest), { recursive: true })\n await fs.copyFile(handlerSrc, handlerDest)\n return\n }\n\n const htmlDest = join(\n outDir,\n `${route}${\n subFolders && route !== '/index' ? `${sep}index` : ''\n }.html`\n )\n const ampHtmlDest = join(\n outDir,\n `${route}.amp${subFolders ? `${sep}index` : ''}.html`\n )\n const jsonDest = isAppPath\n ? join(\n outDir,\n `${route}${\n subFolders && route !== '/index' ? `${sep}index` : ''\n }.txt`\n )\n : join(pagesDataDir, `${route}.json`)\n\n await fs.mkdir(dirname(htmlDest), { recursive: true })\n await fs.mkdir(dirname(jsonDest), { recursive: true })\n\n const htmlSrc = `${orig}.html`\n const jsonSrc = `${orig}${isAppPath ? RSC_SUFFIX : '.json'}`\n\n await fs.copyFile(htmlSrc, htmlDest)\n await fs.copyFile(jsonSrc, jsonDest)\n\n if (existsSync(`${orig}.amp.html`)) {\n await fs.mkdir(dirname(ampHtmlDest), { recursive: true })\n await fs.copyFile(`${orig}.amp.html`, ampHtmlDest)\n }\n\n const segmentsDir = `${orig}${RSC_SEGMENTS_DIR_SUFFIX}`\n\n if (isAppPath && existsSync(segmentsDir)) {\n // Output a data file for each of this page's segments\n //\n // These files are requested by the client router's internal\n // prefetcher, not the user directly. So we don't need to account for\n // things like trailing slash handling.\n //\n // To keep the protocol simple, we can use the non-normalized route\n // path instead of the normalized one (which, among other things,\n // rewrites `/` to `/index`).\n const segmentsDirDest = join(outDir, unnormalizedRoute)\n const segmentPaths = await collectSegmentPaths(segmentsDir)\n await Promise.all(\n segmentPaths.map(async (segmentFileSrc) => {\n const segmentPath =\n '/' + segmentFileSrc.slice(0, -RSC_SEGMENT_SUFFIX.length)\n const segmentFilename =\n convertSegmentPathToStaticExportFilename(segmentPath)\n const segmentFileDest = join(segmentsDirDest, segmentFilename)\n await fs.mkdir(dirname(segmentFileDest), { recursive: true })\n await fs.copyFile(\n join(segmentsDir, segmentFileSrc),\n segmentFileDest\n )\n })\n )\n }\n })\n )\n }\n\n if (Object.keys(ampValidations).length) {\n console.log(formatAmpMessages(ampValidations))\n }\n if (hadValidationError) {\n throw new ExportError(\n `AMP Validation caused the export to fail. https://nextjs.org/docs/messages/amp-export-validation`\n )\n }\n\n if (failedExportAttemptsByPage.size > 0) {\n const failedPages = Array.from(failedExportAttemptsByPage.keys())\n throw new ExportError(\n `Export encountered errors on following paths:\\n\\t${failedPages\n .sort()\n .join('\\n\\t')}`\n )\n }\n\n await fs.writeFile(\n join(distDir, EXPORT_DETAIL),\n formatManifest({\n version: 1,\n outDirectory: outDir,\n success: true,\n }),\n 'utf8'\n )\n\n if (telemetry) {\n await telemetry.flush()\n }\n\n if (worker) {\n await worker.end()\n }\n\n return collector\n}\n\nasync function collectSegmentPaths(segmentsDirectory: string) {\n const results: Array<string> = []\n await collectSegmentPathsImpl(segmentsDirectory, segmentsDirectory, results)\n return results\n}\n\nasync function collectSegmentPathsImpl(\n segmentsDirectory: string,\n directory: string,\n results: Array<string>\n) {\n const segmentFiles = await fs.readdir(directory, {\n withFileTypes: true,\n })\n await Promise.all(\n segmentFiles.map(async (segmentFile) => {\n if (segmentFile.isDirectory()) {\n await collectSegmentPathsImpl(\n segmentsDirectory,\n join(directory, segmentFile.name),\n results\n )\n return\n }\n if (!segmentFile.name.endsWith(RSC_SEGMENT_SUFFIX)) {\n return\n }\n results.push(\n relative(segmentsDirectory, join(directory, segmentFile.name))\n )\n })\n )\n}\n\nexport default async function exportApp(\n dir: string,\n options: ExportAppOptions,\n span: Span\n): Promise<ExportAppResult | null> {\n const nextExportSpan = span.traceChild('next-export')\n\n return nextExportSpan.traceAsyncFn(async () => {\n return await exportAppImpl(dir, options, nextExportSpan)\n })\n}\n"],"names":["ExportError","exportApp","Error","code","exportAppImpl","dir","options","span","nextConfig","resolve","traceChild","traceFn","loadEnvConfig","Log","enabledDirectories","traceAsyncFn","loadConfig","PHASE_EXPORT","debugPrerender","distDir","join","telemetry","buildExport","Telemetry","record","eventCliSession","webpackVersion","cliCommand","isSrcDir","hasNowJson","findUp","cwd","isCustomServer","turboFlag","pagesDir","appDir","subFolders","trailingSlash","silent","info","buildIdFile","BUILD_ID_FILE","existsSync","customRoutes","filter","config","hasNextSupport","length","warn","buildId","fs","readFile","pagesManifest","pages","require","SERVER_DIRECTORY","PAGES_MANIFEST","prerenderManifest","PRERENDER_MANIFEST","appRoutePathManifest","APP_PATH_ROUTES_MANIFEST","err","isError","undefined","excludedPrerenderRoutes","Set","Object","keys","defaultPathMap","hasApiRoutes","page","isAPIRoute","dynamicRoutes","add","mapAppRouteToPage","Map","pageName","routePath","entries","set","isAppPageRoute","routes","_isAppDir","outDir","outdir","rm","recursive","force","mkdir","writeFile","EXPORT_DETAIL","formatManifest","version","outDirectory","success","recursiveCopy","CLIENT_STATIC_FILES_PATH","exportPathMap","defaultMap","i18n","images","loader","unoptimized","isNextImageImported","EXPORT_MARKER","then","text","JSON","parse","catch","serverActionsManifest","app","SERVER_REFERENCE_MANIFEST","output","routesManifest","ROUTES_MANIFEST","rewrites","beforeFiles","hasInterceptionRouteRewrite","some","isInterceptionRouteRewrite","actionIds","node","edge","actionId","extractInfoFromServerReferenceId","type","renderOpts","previewProps","preview","nextExport","assetPrefix","replace","dev","basePath","canonicalBase","amp","ampSkipValidation","experimental","skipValidation","ampOptimizerConfig","optimizer","locales","locale","defaultLocale","domainLocales","domains","disableOptimizedLoading","supportsDynamicResponse","crossOrigin","optimizeCss","nextConfigOutput","nextScriptWorkers","largePageDataBytes","serverActions","serverComponents","cacheLifeProfiles","cacheLife","nextFontManifest","NEXT_FONT_MANIFEST","deploymentId","htmlLimitedBots","source","clientTraceMetadata","expireTime","staleTimes","cacheComponents","clientSegmentCache","Boolean","clientParamParsing","clientParamParsingOrigins","dynamicOnHover","inlineCss","authInterrupts","reactMaxHeadersLength","hasReadableErrorStacks","serverSourceMaps","process","env","TURBOPACK","turbopackMinify","serverMinification","enablePrerenderSourceMaps","globalThis","__NEXT_DATA__","exportMap","appDirOnly","allExportPaths","seenExportPaths","fallbackEnabledPages","path","entry","normalizedPath","denormalizePagePath","normalizePagePath","has","push","prerenderInfo","fallback","size","SSG_FALLBACK_EXPORT_ERROR","hasMiddleware","functionsConfigManifest","middlewareManifest","MIDDLEWARE_MANIFEST","FUNCTIONS_CONFIG_MANIFEST","middleware","functions","yellow","bold","pagesDataDir","ampValidations","publicDir","CLIENT_PUBLIC_FILES_PATH","exportPagesInBatches","worker","exportPaths","renderResumeDataCachesByPage","minPageCountPerBatch","staticGenerationMinPagesPerWorker","numWorkers","Math","min","ceil","pageCountPerBatch","batches","Array","from","_","i","slice","remainingPages","forEach","index","Promise","all","map","batch","exportPages","parentSpanId","getId","cacheHandler","cacheMaxMemorySize","fetchCache","fetchCacheKeyPrefix","flat","initialPhaseExportPaths","finalPhaseExportPaths","exportPath","_allowEmptyStaticShell","totalExportPaths","results","progress","createProgress","statusMessage","createStaticWorker","debuggerPortOffset","getNextBuildDebuggerPortOffset","kind","result","renderResumeDataCache","finalPhaseResults","hadValidationError","collector","byPath","byPage","ssgNotFoundPaths","turborepoAccessTraceResults","failedExportAttemptsByPage","pageKey","turborepoAccessTraceResult","TurborepoAccessTraceResult","fromSerialized","validation","errors","get","cacheControl","metadata","hasEmptyStaticShell","hasPostponed","fetchMetrics","ssgNotFound","durations","durationsByPath","duration","ppr","unnormalizedRoute","srcRoute","appPageName","isAppPath","route","pagePath","getPagePath","distPagesDir","split","orig","htmlSrc","htmlDest404","dirname","copyFile","htmlDest404Index","isAppRouteHandler","isAppRouteRoute","notFoundRoutes","includes","handlerSrc","handlerDest","htmlDest","sep","ampHtmlDest","jsonDest","jsonSrc","RSC_SUFFIX","segmentsDir","RSC_SEGMENTS_DIR_SUFFIX","segmentsDirDest","segmentPaths","collectSegmentPaths","segmentFileSrc","segmentPath","RSC_SEGMENT_SUFFIX","segmentFilename","convertSegmentPathToStaticExportFilename","segmentFileDest","console","log","formatAmpMessages","failedPages","sort","flush","end","segmentsDirectory","collectSegmentPathsImpl","directory","segmentFiles","readdir","withFileTypes","segmentFile","isDirectory","name","endsWith","relative","nextExportSpan"],"mappings":";;;;;;;;;;;;;;;IAyEaA,WAAW;eAAXA;;IAy5Bb,OAUC;eAV6BC;;;uBAv9BvB;4BAGsB;+DACV;oBACwB;QAEpC;sBAE+C;uBACpB;6DAEb;2BAMd;+BACuB;4BAiBvB;+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 -7,11 +7,10 @@ import type { NextParsedUrlQuery } from './request-meta';
|
|
7
7
|
import type { SizeLimit } from '../types';
|
8
8
|
import type { SupportedTestRunners } from '../cli/next-test';
|
9
9
|
import type { ExperimentalPPRConfig } from './lib/experimental/ppr';
|
10
|
-
export type NextConfigComplete = Required<NextConfig
|
10
|
+
export type NextConfigComplete = Required<Omit<NextConfig, 'configFile'>> & {
|
11
11
|
images: Required<ImageConfigComplete>;
|
12
12
|
typescript: TypeScriptConfig;
|
13
|
-
|
14
|
-
configFile?: string;
|
13
|
+
configFile: string | undefined;
|
15
14
|
configFileName: string;
|
16
15
|
htmlLimitedBots: string | undefined;
|
17
16
|
experimental: ExperimentalConfig;
|
@@ -680,7 +679,7 @@ export type ExportPathMap = {
|
|
680
679
|
*
|
681
680
|
* Read more: [Next.js Docs: `next.config.js`](https://nextjs.org/docs/app/api-reference/config/next-config-js)
|
682
681
|
*/
|
683
|
-
export interface NextConfig
|
682
|
+
export interface NextConfig {
|
684
683
|
allowedDevOrigins?: string[];
|
685
684
|
exportPathMap?: (defaultMap: ExportPathMap, ctx: {
|
686
685
|
dev: boolean;
|