/opt/canhelp/node_modules/next/dist/esm/export
NameSizeModeActions
helpers/-0755rm
routes/-0755rm
index.js337530644editdlrm
index.js.map550130644editdlrm
types.js460644editdlrm
types.js.map48930644editdlrm
utils.js6780644editdlrm
utils.js.map11030644editdlrm
worker.js207170644editdlrm
worker.js.map344570644editdlrm
Edit: /opt/canhelp/node_modules/next/dist/esm/export/index.js.map (55013B)
{"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,\n span: Span\n): Promise {\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(distDir, 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 | undefined\n try {\n prerenderManifest = require(join(distDir, PRERENDER_MANIFEST))\n } catch {}\n\n let appRoutePathManifest: Record | 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()\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()\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 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 const { publicRuntimeConfig } = nextConfig\n\n if (Object.keys(publicRuntimeConfig).length > 0) {\n renderOpts.runtimeConfig = publicRuntimeConfig\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 // only add missing 404 page when `buildExport` is false\n if (!options.buildExport) {\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']) {\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()\n const fallbackEnabledPages = new Set()\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 return null\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\n ): Promise => {\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 progress = createProgress(\n initialPhaseExportPaths.length + finalPhaseExportPaths.length,\n options.statusMessage || 'Exporting'\n )\n\n const worker = createStaticWorker(nextConfig, {\n debuggerPortOffset: getNextBuildDebuggerPortOffset({ kind: 'export-page' }),\n progress,\n })\n\n const results = await exportPagesInBatches(worker, initialPhaseExportPaths)\n\n if (finalPhaseExportPaths.length > 0) {\n const renderResumeDataCachesByPage: Record = {}\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 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 = 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(),\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 // Skip handling /_not-found route, it will copy the 404.html file later\n if (unnormalizedRoute === '/_not-found') {\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 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 await worker.end()\n\n return collector\n}\n\nasync function collectSegmentPaths(segmentsDirectory: string) {\n const results: Array = []\n await collectSegmentPathsImpl(segmentsDirectory, segmentsDirectory, results)\n return results\n}\n\nasync function collectSegmentPathsImpl(\n segmentsDirectory: string,\n directory: string,\n results: Array\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 {\n const nextExportSpan = span.traceChild('next-export')\n\n return nextExportSpan.traceAsyncFn(async () => {\n return await exportAppImpl(dir, options, nextExportSpan)\n })\n}\n"],"names":["createStaticWorker","bold","yellow","findUp","existsSync","promises","fs","dirname","join","resolve","sep","relative","formatAmpMessages","Log","RSC_SEGMENT_SUFFIX","RSC_SEGMENTS_DIR_SUFFIX","RSC_SUFFIX","SSG_FALLBACK_EXPORT_ERROR","recursiveCopy","BUILD_ID_FILE","CLIENT_PUBLIC_FILES_PATH","CLIENT_STATIC_FILES_PATH","EXPORT_DETAIL","EXPORT_MARKER","NEXT_FONT_MANIFEST","MIDDLEWARE_MANIFEST","PAGES_MANIFEST","PHASE_EXPORT","PRERENDER_MANIFEST","SERVER_DIRECTORY","SERVER_REFERENCE_MANIFEST","APP_PATH_ROUTES_MANIFEST","ROUTES_MANIFEST","FUNCTIONS_CONFIG_MANIFEST","loadConfig","eventCliSession","hasNextSupport","Telemetry","normalizePagePath","denormalizePagePath","loadEnvConfig","isAPIRoute","getPagePath","isAppRouteRoute","isAppPageRoute","isError","formatManifest","TurborepoAccessTraceResult","createProgress","isInterceptionRouteRewrite","extractInfoFromServerReferenceId","convertSegmentPathToStaticExportFilename","getNextBuildDebuggerPortOffset","ExportError","Error","code","exportAppImpl","dir","options","span","nextConfig","traceChild","traceFn","enabledDirectories","traceAsyncFn","debugPrerender","distDir","telemetry","buildExport","record","webpackVersion","cliCommand","isSrcDir","hasNowJson","cwd","isCustomServer","turboFlag","pagesDir","appDir","subFolders","trailingSlash","silent","info","buildIdFile","customRoutes","filter","config","length","warn","buildId","readFile","pagesManifest","pages","require","prerenderManifest","appRoutePathManifest","err","undefined","excludedPrerenderRoutes","Set","Object","keys","defaultPathMap","hasApiRoutes","page","dynamicRoutes","add","mapAppRouteToPage","Map","pageName","routePath","entries","set","routes","_isAppDir","outDir","outdir","rm","recursive","force","mkdir","writeFile","version","outDirectory","success","exportPathMap","defaultMap","i18n","images","loader","unoptimized","isNextImageImported","then","text","JSON","parse","catch","serverActionsManifest","app","output","routesManifest","rewrites","beforeFiles","hasInterceptionRouteRewrite","some","actionIds","node","edge","actionId","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","deploymentId","htmlLimitedBots","source","clientTraceMetadata","expireTime","staleTimes","cacheComponents","clientSegmentCache","Boolean","clientParamParsing","dynamicOnHover","inlineCss","authInterrupts","reactMaxHeadersLength","hasReadableErrorStacks","serverSourceMaps","process","env","TURBOPACK","turbopackMinify","serverMinification","enablePrerenderSourceMaps","publicRuntimeConfig","runtimeConfig","globalThis","__NEXT_DATA__","exportMap","allExportPaths","seenExportPaths","fallbackEnabledPages","path","entry","normalizedPath","has","push","prerenderInfo","fallback","size","hasMiddleware","functionsConfigManifest","middlewareManifest","middleware","functions","pagesDataDir","ampValidations","publicDir","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","progress","statusMessage","debuggerPortOffset","kind","results","result","renderResumeDataCache","finalPhaseResults","hadValidationError","collector","byPath","byPage","ssgNotFoundPaths","turborepoAccessTraceResults","failedExportAttemptsByPage","pageKey","turborepoAccessTraceResult","fromSerialized","validation","errors","get","cacheControl","metadata","hasEmptyStaticShell","hasPostponed","fetchMetrics","ssgNotFound","durations","durationsByPath","duration","ppr","unnormalizedRoute","srcRoute","appPageName","isAppPath","isAppRouteHandler","notFoundRoutes","includes","route","pagePath","distPagesDir","split","orig","handlerSrc","handlerDest","copyFile","htmlDest","ampHtmlDest","jsonDest","htmlSrc","jsonSrc","segmentsDir","segmentsDirDest","segmentPaths","collectSegmentPaths","segmentFileSrc","segmentPath","segmentFilename","segmentFileDest","console","log","failedPages","sort","flush","end","segmentsDirectory","collectSegmentPathsImpl","directory","segmentFiles","readdir","withFileTypes","segmentFile","isDirectory","name","endsWith","exportApp","nextExportSpan"],"mappings":"AAOA,SACEA,kBAAkB,QAGb,WAAU;AAGjB,SAASC,IAAI,EAAEC,MAAM,QAAQ,oBAAmB;AAChD,OAAOC,YAAY,6BAA4B;AAC/C,SAASC,UAAU,EAAEC,YAAYC,EAAE,QAAQ,KAAI;AAE/C,OAAO,yBAAwB;AAE/B,SAASC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,GAAG,EAAEC,QAAQ,QAAQ,OAAM;AAC5D,SAASC,iBAAiB,QAAQ,wBAAuB;AAEzD,YAAYC,SAAS,sBAAqB;AAC1C,SACEC,kBAAkB,EAClBC,uBAAuB,EACvBC,UAAU,EACVC,yBAAyB,QACpB,mBAAkB;AACzB,SAASC,aAAa,QAAQ,wBAAuB;AACrD,SACEC,aAAa,EACbC,wBAAwB,EACxBC,wBAAwB,EACxBC,aAAa,EACbC,aAAa,EACbC,kBAAkB,EAClBC,mBAAmB,EACnBC,cAAc,EACdC,YAAY,EACZC,kBAAkB,EAClBC,gBAAgB,EAChBC,yBAAyB,EACzBC,wBAAwB,EACxBC,eAAe,EACfC,yBAAyB,QACpB,0BAAyB;AAChC,OAAOC,gBAAgB,mBAAkB;AAEzC,SAASC,eAAe,QAAQ,sBAAqB;AACrD,SAASC,cAAc,QAAQ,oBAAmB;AAClD,SAASC,SAAS,QAAQ,uBAAsB;AAChD,SAASC,iBAAiB,QAAQ,8CAA6C;AAC/E,SAASC,mBAAmB,QAAQ,gDAA+C;AACnF,SAASC,aAAa,QAAQ,YAAW;AACzC,SAASC,UAAU,QAAQ,sBAAqB;AAChD,SAASC,WAAW,QAAQ,oBAAmB;AAG/C,SAASC,eAAe,Q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