{"version":3,"sources":["../../../src/build/webpack-build/impl.ts"],"sourcesContent":["import type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { stringBufferUtils } from 'next/dist/compiled/webpack-sources3'\nimport { red } from '../../lib/picocolors'\nimport formatWebpackMessages from '../../shared/lib/format-webpack-messages'\nimport { nonNullable } from '../../lib/non-nullable'\nimport type { COMPILER_INDEXES } from '../../shared/lib/constants'\nimport {\n  COMPILER_NAMES,\n  CLIENT_STATIC_FILES_RUNTIME_MAIN_APP,\n  APP_CLIENT_INTERNALS,\n  PHASE_PRODUCTION_BUILD,\n} from '../../shared/lib/constants'\nimport { runCompiler } from '../compiler'\nimport * as Log from '../output/log'\nimport getBaseWebpackConfig, { loadProjectInfo } from '../webpack-config'\nimport type { NextError } from '../../lib/is-error'\nimport {\n  TelemetryPlugin,\n  type TelemetryPluginState,\n} from '../webpack/plugins/telemetry-plugin/telemetry-plugin'\nimport {\n  NextBuildContext,\n  resumePluginState,\n  getPluginState,\n} from '../build-context'\nimport { createEntrypoints } from '../entries'\nimport loadConfig from '../../server/config'\nimport {\n  getTraceEvents,\n  initializeTraceState,\n  setGlobal,\n  trace,\n  type TraceEvent,\n  type TraceState,\n} from '../../trace'\nimport { WEBPACK_LAYERS } from '../../lib/constants'\nimport { TraceEntryPointsPlugin } from '../webpack/plugins/next-trace-entrypoints-plugin'\nimport type { BuildTraceContext } from '../webpack/plugins/next-trace-entrypoints-plugin'\nimport type { UnwrapPromise } from '../../lib/coalesced-function'\n\nimport origDebug from 'next/dist/compiled/debug'\nimport { Telemetry } from '../../telemetry/storage'\nimport { durationToString } from '../duration-to-string'\n\nconst debug = origDebug('next:build:webpack-build')\n\nfunction hrtimeToSeconds(hrtime: [number, number]): number {\n  // hrtime is a tuple of [seconds, nanoseconds]\n  return hrtime[0] + hrtime[1] / 1e9\n}\n\ntype CompilerResult = {\n  errors: webpack.StatsError[]\n  warnings: webpack.StatsError[]\n  stats: (webpack.Stats | undefined)[]\n}\n\ntype SingleCompilerResult = {\n  errors: webpack.StatsError[]\n  warnings: webpack.StatsError[]\n  stats: webpack.Stats | undefined\n}\n\nfunction isTelemetryPlugin(plugin: unknown): plugin is TelemetryPlugin {\n  return plugin instanceof TelemetryPlugin\n}\n\nfunction isTraceEntryPointsPlugin(\n  plugin: unknown\n): plugin is TraceEntryPointsPlugin {\n  return plugin instanceof TraceEntryPointsPlugin\n}\n\nexport async function webpackBuildImpl(\n  compilerName: keyof typeof COMPILER_INDEXES | null\n): Promise<{\n  duration: number\n  pluginState: any\n  buildTraceContext?: BuildTraceContext\n  telemetryState?: TelemetryPluginState\n}> {\n  let result: CompilerResult | null = {\n    warnings: [],\n    errors: [],\n    stats: [],\n  }\n  let webpackBuildStart\n  const nextBuildSpan = NextBuildContext.nextBuildSpan!\n  const dir = NextBuildContext.dir!\n  const config = NextBuildContext.config!\n  process.env.NEXT_COMPILER_NAME = compilerName || 'server'\n\n  const runWebpackSpan = nextBuildSpan.traceChild('run-webpack-compiler')\n  const entrypoints = await nextBuildSpan\n    .traceChild('create-entrypoints')\n    .traceAsyncFn(() =>\n      createEntrypoints({\n        buildId: NextBuildContext.buildId!,\n        config: config,\n        envFiles: NextBuildContext.loadedEnvFiles!,\n        isDev: false,\n        rootDir: dir,\n        pageExtensions: config.pageExtensions!,\n        pagesDir: NextBuildContext.pagesDir!,\n        appDir: NextBuildContext.appDir!,\n        pages: NextBuildContext.mappedPages!,\n        appPaths: NextBuildContext.mappedAppPages!,\n        previewMode: NextBuildContext.previewProps!,\n        rootPaths: NextBuildContext.mappedRootPaths!,\n        hasInstrumentationHook: NextBuildContext.hasInstrumentationHook!,\n      })\n    )\n\n  const commonWebpackOptions = {\n    isServer: false,\n    isCompileMode: NextBuildContext.isCompileMode,\n    buildId: NextBuildContext.buildId!,\n    encryptionKey: NextBuildContext.encryptionKey!,\n    config: config,\n    appDir: NextBuildContext.appDir!,\n    pagesDir: NextBuildContext.pagesDir!,\n    rewrites: NextBuildContext.rewrites!,\n    originalRewrites: NextBuildContext.originalRewrites,\n    originalRedirects: NextBuildContext.originalRedirects,\n    reactProductionProfiling: NextBuildContext.reactProductionProfiling!,\n    noMangling: NextBuildContext.noMangling!,\n    clientRouterFilters: NextBuildContext.clientRouterFilters!,\n    previewProps: NextBuildContext.previewProps!,\n    allowedRevalidateHeaderKeys: NextBuildContext.allowedRevalidateHeaderKeys!,\n    fetchCacheKeyPrefix: NextBuildContext.fetchCacheKeyPrefix!,\n  }\n\n  const configs = await runWebpackSpan\n    .traceChild('generate-webpack-config')\n    .traceAsyncFn(async () => {\n      const info = await loadProjectInfo({\n        dir,\n        config: commonWebpackOptions.config,\n        dev: false,\n      })\n      return Promise.all([\n        getBaseWebpackConfig(dir, {\n          ...commonWebpackOptions,\n          middlewareMatchers: entrypoints.middlewareMatchers,\n          runWebpackSpan,\n          compilerType: COMPILER_NAMES.client,\n          entrypoints: entrypoints.client,\n          ...info,\n        }),\n        getBaseWebpackConfig(dir, {\n          ...commonWebpackOptions,\n          runWebpackSpan,\n          middlewareMatchers: entrypoints.middlewareMatchers,\n          compilerType: COMPILER_NAMES.server,\n          entrypoints: entrypoints.server,\n          ...info,\n        }),\n        getBaseWebpackConfig(dir, {\n          ...commonWebpackOptions,\n          runWebpackSpan,\n          middlewareMatchers: entrypoints.middlewareMatchers,\n          compilerType: COMPILER_NAMES.edgeServer,\n          entrypoints: entrypoints.edgeServer,\n          ...info,\n        }),\n      ])\n    })\n\n  const clientConfig = configs[0]\n  const serverConfig = configs[1]\n  const edgeConfig = configs[2]\n\n  if (\n    clientConfig.optimization &&\n    (clientConfig.optimization.minimize !== true ||\n      (clientConfig.optimization.minimizer &&\n        clientConfig.optimization.minimizer.length === 0))\n  ) {\n    Log.warn(\n      `Production code optimization has been disabled in your project. Read more: https://nextjs.org/docs/messages/minification-disabled`\n    )\n  }\n\n  webpackBuildStart = process.hrtime()\n\n  debug(`starting compiler`, compilerName)\n  // We run client and server compilation separately to optimize for memory usage\n  await runWebpackSpan.traceAsyncFn(async () => {\n    if (config.experimental.webpackMemoryOptimizations) {\n      stringBufferUtils.disableDualStringBufferCaching()\n      stringBufferUtils.enterStringInterningRange()\n    }\n\n    // Run the server compilers first and then the client\n    // compiler to track the boundary of server/client components.\n    let clientResult: SingleCompilerResult | null = null\n\n    // During the server compilations, entries of client components will be\n    // injected to this set and then will be consumed by the client compiler.\n    let serverResult: UnwrapPromise<ReturnType<typeof runCompiler>>[0] | null =\n      null\n    let edgeServerResult:\n      | UnwrapPromise<ReturnType<typeof runCompiler>>[0]\n      | null = null\n\n    let inputFileSystem: webpack.Compiler['inputFileSystem'] | undefined\n\n    if (!compilerName || compilerName === 'server') {\n      debug('starting server compiler')\n      const start = Date.now()\n      ;[serverResult, inputFileSystem] = await runCompiler(serverConfig, {\n        runWebpackSpan,\n        inputFileSystem,\n      })\n      debug(`server compiler finished ${Date.now() - start}ms`)\n    }\n\n    if (!compilerName || compilerName === 'edge-server') {\n      debug('starting edge-server compiler')\n      const start = Date.now()\n      ;[edgeServerResult, inputFileSystem] = edgeConfig\n        ? await runCompiler(edgeConfig, { runWebpackSpan, inputFileSystem })\n        : [null]\n      debug(`edge-server compiler finished ${Date.now() - start}ms`)\n    }\n\n    // Only continue if there were no errors\n    if (!serverResult?.errors.length && !edgeServerResult?.errors.length) {\n      const pluginState = getPluginState()\n      for (const key in pluginState.injectedClientEntries) {\n        const value = pluginState.injectedClientEntries[key]\n        const clientEntry = clientConfig.entry as webpack.EntryObject\n        if (key === APP_CLIENT_INTERNALS) {\n          clientEntry[CLIENT_STATIC_FILES_RUNTIME_MAIN_APP] = {\n            import: [\n              // TODO-APP: cast clientEntry[CLIENT_STATIC_FILES_RUNTIME_MAIN_APP] to type EntryDescription once it's available from webpack\n              // @ts-expect-error clientEntry['main-app'] is type EntryDescription { import: ... }\n              ...clientEntry[CLIENT_STATIC_FILES_RUNTIME_MAIN_APP].import,\n              value,\n            ],\n            layer: WEBPACK_LAYERS.appPagesBrowser,\n          }\n        } else {\n          clientEntry[key] = {\n            dependOn: [CLIENT_STATIC_FILES_RUNTIME_MAIN_APP],\n            import: value,\n            layer: WEBPACK_LAYERS.appPagesBrowser,\n          }\n        }\n      }\n\n      if (!compilerName || compilerName === 'client') {\n        debug('starting client compiler')\n        const start = Date.now()\n        ;[clientResult, inputFileSystem] = await runCompiler(clientConfig, {\n          runWebpackSpan,\n          inputFileSystem,\n        })\n        debug(`client compiler finished ${Date.now() - start}ms`)\n      }\n    }\n\n    if (config.experimental.webpackMemoryOptimizations) {\n      stringBufferUtils.exitStringInterningRange()\n    }\n    inputFileSystem?.purge?.()\n\n    result = {\n      warnings: [\n        ...(clientResult?.warnings ?? []),\n        ...(serverResult?.warnings ?? []),\n        ...(edgeServerResult?.warnings ?? []),\n      ].filter(nonNullable),\n      errors: [\n        ...(clientResult?.errors ?? []),\n        ...(serverResult?.errors ?? []),\n        ...(edgeServerResult?.errors ?? []),\n      ].filter(nonNullable),\n      stats: [\n        clientResult?.stats,\n        serverResult?.stats,\n        edgeServerResult?.stats,\n      ],\n    }\n  })\n  result = nextBuildSpan\n    .traceChild('format-webpack-messages')\n    .traceFn(() => formatWebpackMessages(result, true)) as CompilerResult\n\n  const telemetryPlugin = (clientConfig as webpack.Configuration).plugins?.find(\n    isTelemetryPlugin\n  )\n\n  const traceEntryPointsPlugin = (\n    serverConfig as webpack.Configuration\n  ).plugins?.find(isTraceEntryPointsPlugin)\n\n  const webpackBuildEnd = process.hrtime(webpackBuildStart)\n\n  if (result.errors.length > 0) {\n    // Only keep the first few errors. Others are often indicative\n    // of the same problem, but confuse the reader with noise.\n    if (result.errors.length > 5) {\n      result.errors.length = 5\n    }\n    let error = result.errors.filter(Boolean).join('\\n\\n')\n\n    console.error(red('Failed to compile.\\n'))\n\n    if (\n      error.indexOf('private-next-pages') > -1 &&\n      error.indexOf('does not contain a default export') > -1\n    ) {\n      const page_name_regex = /'private-next-pages\\/(?<page_name>[^']*)'/\n      const parsed = page_name_regex.exec(error)\n      const page_name = parsed && parsed.groups && parsed.groups.page_name\n      throw new Error(\n        `webpack build failed: found page without a React Component as default export in pages/${page_name}\\n\\nSee https://nextjs.org/docs/messages/page-without-valid-component for more info.`\n      )\n    }\n\n    console.error(error)\n    console.error()\n\n    if (\n      error.indexOf('private-next-pages') > -1 ||\n      error.indexOf('__next_polyfill__') > -1\n    ) {\n      const err = new Error(\n        'webpack config.resolve.alias was incorrectly overridden. https://nextjs.org/docs/messages/invalid-resolve-alias'\n      ) as NextError\n      err.code = 'INVALID_RESOLVE_ALIAS'\n      throw err\n    }\n    const err = new Error(\n      `Build failed because of ${process.env.NEXT_RSPACK ? 'rspack' : 'webpack'} errors`\n    ) as NextError\n    err.code = 'WEBPACK_ERRORS'\n    throw err\n  } else {\n    const duration = hrtimeToSeconds(webpackBuildEnd)\n    const durationString = durationToString(duration)\n\n    if (result.warnings.length > 0) {\n      Log.warn(`Compiled with warnings in ${durationString}\\n`)\n      console.warn(result.warnings.filter(Boolean).join('\\n\\n'))\n      console.warn()\n    } else if (!compilerName) {\n      Log.event(`Compiled successfully in ${durationString}`)\n    }\n\n    return {\n      duration,\n      buildTraceContext: traceEntryPointsPlugin?.buildTraceContext,\n      pluginState: getPluginState(),\n      telemetryState: {\n        usages: telemetryPlugin?.usages() || [],\n        packagesUsedInServerSideProps:\n          telemetryPlugin?.packagesUsedInServerSideProps() || [],\n        useCacheTracker: telemetryPlugin?.getUseCacheTracker() || {},\n      },\n    }\n  }\n}\n\n// the main function when this file is run as a worker\nexport async function workerMain(workerData: {\n  compilerName: keyof typeof COMPILER_INDEXES\n  buildContext: typeof NextBuildContext\n  traceState: TraceState\n}): Promise<\n  Awaited<ReturnType<typeof webpackBuildImpl>> & {\n    debugTraceEvents: TraceEvent[]\n  }\n> {\n  // Clone the telemetry for worker\n  const telemetry = new Telemetry({\n    distDir: workerData.buildContext.config!.distDir,\n  })\n  setGlobal('telemetry', telemetry)\n  // setup new build context from the serialized data passed from the parent\n  Object.assign(NextBuildContext, workerData.buildContext)\n\n  // Initialize tracer state from the parent\n  initializeTraceState(workerData.traceState)\n\n  // Resume plugin state\n  resumePluginState(NextBuildContext.pluginState)\n\n  /// load the config because it's not serializable\n  NextBuildContext.config = await loadConfig(\n    PHASE_PRODUCTION_BUILD,\n    NextBuildContext.dir!,\n    { debugPrerender: NextBuildContext.debugPrerender }\n  )\n  NextBuildContext.nextBuildSpan = trace(\n    `worker-main-${workerData.compilerName}`\n  )\n\n  const result = await webpackBuildImpl(workerData.compilerName)\n  const { entriesTrace, chunksTrace } = result.buildTraceContext ?? {}\n  if (entriesTrace) {\n    const { entryNameMap, depModArray } = entriesTrace\n    if (depModArray) {\n      result.buildTraceContext!.entriesTrace!.depModArray = depModArray\n    }\n    if (entryNameMap) {\n      const entryEntries = entryNameMap\n      result.buildTraceContext!.entriesTrace!.entryNameMap = entryEntries\n    }\n  }\n  if (chunksTrace?.entryNameFilesMap) {\n    const entryNameFilesMap = chunksTrace.entryNameFilesMap\n    result.buildTraceContext!.chunksTrace!.entryNameFilesMap = entryNameFilesMap\n  }\n  NextBuildContext.nextBuildSpan.stop()\n  return { ...result, debugTraceEvents: getTraceEvents() }\n}\n"],"names":["stringBufferUtils","red","formatWebpackMessages","nonNullable","COMPILER_NAMES","CLIENT_STATIC_FILES_RUNTIME_MAIN_APP","APP_CLIENT_INTERNALS","PHASE_PRODUCTION_BUILD","runCompiler","Log","getBaseWebpackConfig","loadProjectInfo","TelemetryPlugin","NextBuildContext","resumePluginState","getPluginState","createEntrypoints","loadConfig","getTraceEvents","initializeTraceState","setGlobal","trace","WEBPACK_LAYERS","TraceEntryPointsPlugin","origDebug","Telemetry","durationToString","debug","hrtimeToSeconds","hrtime","isTelemetryPlugin","plugin","isTraceEntryPointsPlugin","webpackBuildImpl","compilerName","result","warnings","errors","stats","webpackBuildStart","nextBuildSpan","dir","config","process","env","NEXT_COMPILER_NAME","runWebpackSpan","traceChild","entrypoints","traceAsyncFn","buildId","envFiles","loadedEnvFiles","isDev","rootDir","pageExtensions","pagesDir","appDir","pages","mappedPages","appPaths","mappedAppPages","previewMode","previewProps","rootPaths","mappedRootPaths","hasInstrumentationHook","commonWebpackOptions","isServer","isCompileMode","encryptionKey","rewrites","originalRewrites","originalRedirects","reactProductionProfiling","noMangling","clientRouterFilters","allowedRevalidateHeaderKeys","fetchCacheKeyPrefix","configs","info","dev","Promise","all","middlewareMatchers","compilerType","client","server","edgeServer","clientConfig","serverConfig","edgeConfig","optimization","minimize","minimizer","length","warn","inputFileSystem","experimental","webpackMemoryOptimizations","disableDualStringBufferCaching","enterStringInterningRange","clientResult","serverResult","edgeServerResult","start","Date","now","pluginState","key","injectedClientEntries","value","clientEntry","entry","import","layer","appPagesBrowser","dependOn","exitStringInterningRange","purge","filter","traceFn","telemetryPlugin","plugins","find","traceEntryPointsPlugin","webpackBuildEnd","error","Boolean","join","console","indexOf","page_name_regex","parsed","exec","page_name","groups","Error","err","code","NEXT_RSPACK","duration","durationString","event","buildTraceContext","telemetryState","usages","packagesUsedInServerSideProps","useCacheTracker","getUseCacheTracker","workerMain","workerData","telemetry","distDir","buildContext","Object","assign","traceState","debugPrerender","entriesTrace","chunksTrace","entryNameMap","depModArray","entryEntries","entryNameFilesMap","stop","debugTraceEvents"],"mappings":"AACA,SAASA,iBAAiB,QAAQ,sCAAqC;AACvE,SAASC,GAAG,QAAQ,uBAAsB;AAC1C,OAAOC,2BAA2B,2CAA0C;AAC5E,SAASC,WAAW,QAAQ,yBAAwB;AAEpD,SACEC,cAAc,EACdC,oCAAoC,EACpCC,oBAAoB,EACpBC,sBAAsB,QACjB,6BAA4B;AACnC,SAASC,WAAW,QAAQ,cAAa;AACzC,YAAYC,SAAS,gBAAe;AACpC,OAAOC,wBAAwBC,eAAe,QAAQ,oBAAmB;AAEzE,SACEC,eAAe,QAEV,uDAAsD;AAC7D,SACEC,gBAAgB,EAChBC,iBAAiB,EACjBC,cAAc,QACT,mBAAkB;AACzB,SAASC,iBAAiB,QAAQ,aAAY;AAC9C,OAAOC,gBAAgB,sBAAqB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