next 15.2.1-canary.1 → 15.2.1-canary.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of next might be problematic. Click here for more details.

Files changed (81) hide show
  1. package/dist/bin/next +1 -1
  2. package/dist/build/handle-externals.d.ts +2 -3
  3. package/dist/build/handle-externals.js +4 -4
  4. package/dist/build/handle-externals.js.map +1 -1
  5. package/dist/build/index.js +2 -2
  6. package/dist/build/swc/index.js +1 -1
  7. package/dist/build/webpack/plugins/build-manifest-plugin.js +3 -5
  8. package/dist/build/webpack/plugins/build-manifest-plugin.js.map +1 -1
  9. package/dist/build/webpack/plugins/css-minimizer-plugin.js +2 -2
  10. package/dist/build/webpack/plugins/css-minimizer-plugin.js.map +1 -1
  11. package/dist/build/webpack/plugins/minify-webpack-plugin/src/index.js +2 -2
  12. package/dist/build/webpack/plugins/minify-webpack-plugin/src/index.js.map +1 -1
  13. package/dist/build/webpack/plugins/next-trace-entrypoints-plugin.d.ts +1 -3
  14. package/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js +5 -6
  15. package/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js.map +1 -1
  16. package/dist/build/webpack/utils.d.ts +3 -1
  17. package/dist/build/webpack/utils.js +10 -0
  18. package/dist/build/webpack/utils.js.map +1 -1
  19. package/dist/build/webpack-config.js +2 -4
  20. package/dist/build/webpack-config.js.map +1 -1
  21. package/dist/client/app-bootstrap.js +1 -1
  22. package/dist/client/components/react-dev-overlay/server/shared.d.ts +0 -3
  23. package/dist/client/components/react-dev-overlay/server/shared.js.map +1 -1
  24. package/dist/client/components/react-dev-overlay/ui/styles/colors.js +1 -1
  25. package/dist/client/components/react-dev-overlay/ui/styles/colors.js.map +1 -1
  26. package/dist/client/components/react-dev-overlay/utils/stack-frame.d.ts +11 -3
  27. package/dist/client/components/react-dev-overlay/utils/stack-frame.js +2 -5
  28. package/dist/client/components/react-dev-overlay/utils/stack-frame.js.map +1 -1
  29. package/dist/client/components/router-reducer/reducers/navigate-reducer.js +29 -9
  30. package/dist/client/components/router-reducer/reducers/navigate-reducer.js.map +1 -1
  31. package/dist/client/components/segment-cache/navigation.d.ts +5 -1
  32. package/dist/client/components/segment-cache/navigation.js +28 -19
  33. package/dist/client/components/segment-cache/navigation.js.map +1 -1
  34. package/dist/client/index.js +1 -1
  35. package/dist/compiled/next-server/app-page-experimental.runtime.dev.js +2 -2
  36. package/dist/compiled/next-server/app-page-experimental.runtime.dev.js.map +1 -1
  37. package/dist/compiled/next-server/app-page.runtime.dev.js +2 -2
  38. package/dist/compiled/next-server/app-page.runtime.dev.js.map +1 -1
  39. package/dist/esm/build/handle-externals.js +4 -4
  40. package/dist/esm/build/handle-externals.js.map +1 -1
  41. package/dist/esm/build/index.js +2 -2
  42. package/dist/esm/build/swc/index.js +1 -1
  43. package/dist/esm/build/webpack/plugins/build-manifest-plugin.js +3 -5
  44. package/dist/esm/build/webpack/plugins/build-manifest-plugin.js.map +1 -1
  45. package/dist/esm/build/webpack/plugins/css-minimizer-plugin.js +2 -2
  46. package/dist/esm/build/webpack/plugins/css-minimizer-plugin.js.map +1 -1
  47. package/dist/esm/build/webpack/plugins/minify-webpack-plugin/src/index.js +2 -2
  48. package/dist/esm/build/webpack/plugins/minify-webpack-plugin/src/index.js.map +1 -1
  49. package/dist/esm/build/webpack/plugins/next-trace-entrypoints-plugin.js +5 -6
  50. package/dist/esm/build/webpack/plugins/next-trace-entrypoints-plugin.js.map +1 -1
  51. package/dist/esm/build/webpack/utils.js +6 -0
  52. package/dist/esm/build/webpack/utils.js.map +1 -1
  53. package/dist/esm/build/webpack-config.js +2 -4
  54. package/dist/esm/build/webpack-config.js.map +1 -1
  55. package/dist/esm/client/app-bootstrap.js +1 -1
  56. package/dist/esm/client/components/react-dev-overlay/server/shared.js.map +1 -1
  57. package/dist/esm/client/components/react-dev-overlay/ui/styles/colors.js +1 -1
  58. package/dist/esm/client/components/react-dev-overlay/ui/styles/colors.js.map +1 -1
  59. package/dist/esm/client/components/react-dev-overlay/utils/stack-frame.js +2 -5
  60. package/dist/esm/client/components/react-dev-overlay/utils/stack-frame.js.map +1 -1
  61. package/dist/esm/client/components/router-reducer/reducers/navigate-reducer.js +29 -9
  62. package/dist/esm/client/components/router-reducer/reducers/navigate-reducer.js.map +1 -1
  63. package/dist/esm/client/components/segment-cache/navigation.js +28 -19
  64. package/dist/esm/client/components/segment-cache/navigation.js.map +1 -1
  65. package/dist/esm/client/index.js +1 -1
  66. package/dist/esm/lib/server-external-packages.json +4 -0
  67. package/dist/esm/server/config.js +1 -1
  68. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  69. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  70. package/dist/esm/server/lib/app-info-log.js +1 -1
  71. package/dist/esm/server/lib/start-server.js +1 -1
  72. package/dist/lib/server-external-packages.json +4 -0
  73. package/dist/server/config.js +1 -1
  74. package/dist/server/dev/hot-reloader-turbopack.js +1 -1
  75. package/dist/server/dev/hot-reloader-webpack.js +1 -1
  76. package/dist/server/lib/app-info-log.js +1 -1
  77. package/dist/server/lib/start-server.js +1 -1
  78. package/dist/telemetry/anonymous-meta.js +1 -1
  79. package/dist/telemetry/events/session-stopped.js +2 -2
  80. package/dist/telemetry/events/version.js +2 -2
  81. package/package.json +15 -15
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/build/webpack/plugins/next-trace-entrypoints-plugin.ts"],"sourcesContent":["import nodePath from 'path'\nimport type { Span } from '../../../trace'\nimport { spans } from './profiling-plugin'\nimport isError from '../../../lib/is-error'\nimport { nodeFileTrace } from 'next/dist/compiled/@vercel/nft'\nimport type { NodeFileTraceReasons } from 'next/dist/compiled/@vercel/nft'\nimport {\n CLIENT_REFERENCE_MANIFEST,\n TRACE_OUTPUT_VERSION,\n type CompilerNameValues,\n} from '../../../shared/lib/constants'\nimport { webpack, sources } from 'next/dist/compiled/webpack/webpack'\nimport {\n NODE_ESM_RESOLVE_OPTIONS,\n NODE_RESOLVE_OPTIONS,\n} from '../../webpack-config'\nimport type { NextConfigComplete } from '../../../server/config-shared'\nimport picomatch from 'next/dist/compiled/picomatch'\nimport { getModuleBuildInfo } from '../loaders/get-module-build-info'\nimport { getPageFilePath } from '../../entries'\nimport { resolveExternal } from '../../handle-externals'\nimport { isStaticMetadataRoute } from '../../../lib/metadata/is-metadata-route'\n\nconst PLUGIN_NAME = 'TraceEntryPointsPlugin'\nexport const TRACE_IGNORES = [\n '**/*/next/dist/server/next.js',\n '**/*/next/dist/bin/next',\n]\n\nconst NOT_TRACEABLE = [\n '.wasm',\n '.png',\n '.jpg',\n '.jpeg',\n '.gif',\n '.webp',\n '.avif',\n '.ico',\n '.bmp',\n '.svg',\n]\n\nfunction getModuleFromDependency(\n compilation: any,\n dep: any\n): webpack.Module & { resource?: string; request?: string } {\n return compilation.moduleGraph.getModule(dep)\n}\n\nexport function getFilesMapFromReasons(\n fileList: Set<string>,\n reasons: NodeFileTraceReasons,\n ignoreFn?: (file: string, parent?: string) => Boolean\n) {\n // this uses the reasons tree to collect files specific to a\n // certain parent allowing us to not have to trace each parent\n // separately\n const parentFilesMap = new Map<string, Map<string, { ignored: boolean }>>()\n\n function propagateToParents(\n parents: Set<string>,\n file: string,\n seen = new Set<string>()\n ) {\n for (const parent of parents || []) {\n if (!seen.has(parent)) {\n seen.add(parent)\n let parentFiles = parentFilesMap.get(parent)\n\n if (!parentFiles) {\n parentFiles = new Map()\n parentFilesMap.set(parent, parentFiles)\n }\n const ignored = Boolean(ignoreFn?.(file, parent))\n parentFiles.set(file, { ignored })\n\n const parentReason = reasons.get(parent)\n\n if (parentReason?.parents) {\n propagateToParents(parentReason.parents, file, seen)\n }\n }\n }\n }\n\n for (const file of fileList!) {\n const reason = reasons!.get(file)\n const isInitial =\n reason?.type.length === 1 && reason.type.includes('initial')\n\n if (\n !reason ||\n !reason.parents ||\n (isInitial && reason.parents.size === 0)\n ) {\n continue\n }\n propagateToParents(reason.parents, file)\n }\n return parentFilesMap\n}\n\nexport interface TurbotraceAction {\n action: 'print' | 'annotate'\n input: string[]\n contextDirectory: string\n processCwd: string\n showAll?: boolean\n memoryLimit?: number\n}\n\nexport interface BuildTraceContext {\n entriesTrace?: {\n action: TurbotraceAction\n appDir: string\n outputPath: string\n depModArray: string[]\n entryNameMap: Record<string, string>\n absolutePathByEntryName: Record<string, string>\n }\n chunksTrace?: {\n action: TurbotraceAction\n outputPath: string\n entryNameFilesMap: Record<string, Array<string>>\n }\n}\n\nexport class TraceEntryPointsPlugin implements webpack.WebpackPluginInstance {\n public buildTraceContext: BuildTraceContext = {}\n\n private rootDir: string\n private appDir: string | undefined\n private pagesDir: string | undefined\n private optOutBundlingPackages: string[]\n private appDirEnabled?: boolean\n private tracingRoot: string\n private entryTraces: Map<string, Map<string, { bundled: boolean }>>\n private traceIgnores: string[]\n private esmExternals?: NextConfigComplete['experimental']['esmExternals']\n private compilerType: CompilerNameValues\n\n constructor({\n rootDir,\n appDir,\n pagesDir,\n compilerType,\n optOutBundlingPackages,\n appDirEnabled,\n traceIgnores,\n esmExternals,\n outputFileTracingRoot,\n }: {\n rootDir: string\n compilerType: CompilerNameValues\n appDir: string | undefined\n pagesDir: string | undefined\n optOutBundlingPackages: string[]\n appDirEnabled?: boolean\n traceIgnores?: string[]\n outputFileTracingRoot?: string\n esmExternals?: NextConfigComplete['experimental']['esmExternals']\n }) {\n this.rootDir = rootDir\n this.appDir = appDir\n this.pagesDir = pagesDir\n this.entryTraces = new Map()\n this.esmExternals = esmExternals\n this.appDirEnabled = appDirEnabled\n this.traceIgnores = traceIgnores || []\n this.tracingRoot = outputFileTracingRoot || rootDir\n this.optOutBundlingPackages = optOutBundlingPackages\n this.compilerType = compilerType\n }\n\n // Here we output all traced assets and webpack chunks to a\n // ${page}.js.nft.json file\n async createTraceAssets(compilation: webpack.Compilation, span: Span) {\n const outputPath = compilation.outputOptions.path || ''\n\n await span.traceChild('create-trace-assets').traceAsyncFn(async () => {\n const entryFilesMap = new Map<any, Set<string>>()\n const chunksToTrace = new Set<string>()\n const entryNameFilesMap = new Map<string, Array<string>>()\n\n const isTraceable = (file: string) =>\n !NOT_TRACEABLE.some((suffix) => {\n return file.endsWith(suffix)\n })\n\n for (const entrypoint of compilation.entrypoints.values()) {\n const entryFiles = new Set<string>()\n\n for (const chunk of process.env.NEXT_RSPACK\n ? entrypoint.chunks\n : entrypoint.getEntrypointChunk().getAllReferencedChunks()) {\n for (const file of chunk.files) {\n if (isTraceable(file)) {\n const filePath = nodePath.join(outputPath, file)\n chunksToTrace.add(filePath)\n entryFiles.add(filePath)\n }\n }\n for (const file of chunk.auxiliaryFiles) {\n if (isTraceable(file)) {\n const filePath = nodePath.join(outputPath, file)\n chunksToTrace.add(filePath)\n entryFiles.add(filePath)\n }\n }\n }\n entryFilesMap.set(entrypoint, entryFiles)\n entryNameFilesMap.set(entrypoint.name || '', [...entryFiles])\n }\n\n // startTrace existed and callable\n this.buildTraceContext.chunksTrace = {\n action: {\n action: 'annotate',\n input: [...chunksToTrace],\n contextDirectory: this.tracingRoot,\n processCwd: this.rootDir,\n },\n outputPath,\n entryNameFilesMap: Object.fromEntries(entryNameFilesMap),\n }\n\n // server compiler outputs to `server/chunks` so we traverse up\n // one, but edge-server does not so don't for that one\n const outputPrefix = this.compilerType === 'server' ? '../' : ''\n\n for (const [entrypoint, entryFiles] of entryFilesMap) {\n const traceOutputName = `${outputPrefix}${entrypoint.name}.js.nft.json`\n const traceOutputPath = nodePath.dirname(\n nodePath.join(outputPath, traceOutputName)\n )\n\n // don't include the entry itself in the trace\n entryFiles.delete(\n nodePath.join(outputPath, `${outputPrefix}${entrypoint.name}.js`)\n )\n\n if (entrypoint.name.startsWith('app/') && this.appDir) {\n const appDirRelativeEntryPath =\n this.buildTraceContext.entriesTrace?.absolutePathByEntryName[\n entrypoint.name\n ]?.replace(this.appDir, '')\n\n const entryIsStaticMetadataRoute =\n appDirRelativeEntryPath &&\n isStaticMetadataRoute(appDirRelativeEntryPath)\n\n // Include the client reference manifest in the trace, but not for\n // static metadata routes, for which we don't generate those.\n if (!entryIsStaticMetadataRoute) {\n entryFiles.add(\n nodePath.join(\n outputPath,\n outputPrefix,\n entrypoint.name.replace(/%5F/g, '_') +\n '_' +\n CLIENT_REFERENCE_MANIFEST +\n '.js'\n )\n )\n }\n }\n\n const finalFiles: string[] = []\n\n await Promise.all(\n [\n ...new Set([\n ...entryFiles,\n ...(this.entryTraces.get(entrypoint.name)?.keys() || []),\n ]),\n ].map(async (file) => {\n const fileInfo = this.entryTraces.get(entrypoint.name)?.get(file)\n\n const relativeFile = nodePath\n .relative(traceOutputPath, file)\n .replace(/\\\\/g, '/')\n\n if (file) {\n if (!fileInfo?.bundled) {\n finalFiles.push(relativeFile)\n }\n }\n })\n )\n\n compilation.emitAsset(\n traceOutputName,\n new sources.RawSource(\n JSON.stringify({\n version: TRACE_OUTPUT_VERSION,\n files: finalFiles,\n })\n ) as unknown as webpack.sources.RawSource\n )\n }\n })\n }\n\n tapfinishModules(\n compilation: webpack.Compilation,\n traceEntrypointsPluginSpan: Span,\n doResolve: (\n request: string,\n parent: string,\n job: import('@vercel/nft/out/node-file-trace').Job,\n isEsmRequested: boolean\n ) => Promise<string>,\n readlink: any,\n stat: any\n ) {\n compilation.hooks.finishModules.tapAsync(\n PLUGIN_NAME,\n async (_stats: any, callback: any) => {\n const finishModulesSpan =\n traceEntrypointsPluginSpan.traceChild('finish-modules')\n await finishModulesSpan\n .traceAsyncFn(async () => {\n // we create entry -> module maps so that we can\n // look them up faster instead of having to iterate\n // over the compilation modules list\n const entryNameMap = new Map<string, string>()\n const entryModMap = new Map<string, any>()\n const additionalEntries = new Map<string, Map<string, any>>()\n const absolutePathByEntryName = new Map<string, string>()\n\n const depModMap = new Map<string, any>()\n\n await finishModulesSpan\n .traceChild('get-entries')\n .traceAsyncFn(async () => {\n for (const [name, entry] of compilation.entries.entries()) {\n const normalizedName = name?.replace(/\\\\/g, '/')\n\n const isPage = normalizedName.startsWith('pages/')\n const isApp =\n this.appDirEnabled && normalizedName.startsWith('app/')\n\n if (isApp || isPage) {\n for (const dep of entry.dependencies) {\n if (!dep) continue\n const entryMod = getModuleFromDependency(compilation, dep)\n\n // Handle case where entry is a loader coming from Next.js.\n // For example edge-loader or app-loader.\n if (entryMod && entryMod.resource === '') {\n const moduleBuildInfo = getModuleBuildInfo(entryMod)\n // All loaders that are used to create entries have a `route` property on the buildInfo.\n if (moduleBuildInfo.route) {\n const absolutePath = getPageFilePath({\n absolutePagePath:\n moduleBuildInfo.route.absolutePagePath,\n rootDir: this.rootDir,\n appDir: this.appDir,\n pagesDir: this.pagesDir,\n })\n\n // Ensures we don't handle non-pages.\n if (\n (this.pagesDir &&\n absolutePath.startsWith(this.pagesDir)) ||\n (this.appDir &&\n absolutePath.startsWith(this.appDir))\n ) {\n entryModMap.set(absolutePath, entryMod)\n entryNameMap.set(absolutePath, name)\n absolutePathByEntryName.set(name, absolutePath)\n }\n }\n\n // If there was no `route` property, we can assume that it was something custom instead.\n // In order to trace these we add them to the additionalEntries map.\n if (entryMod.request) {\n let curMap = additionalEntries.get(name)\n\n if (!curMap) {\n curMap = new Map()\n additionalEntries.set(name, curMap)\n }\n depModMap.set(entryMod.request, entryMod)\n curMap.set(entryMod.resource, entryMod)\n }\n }\n\n if (entryMod && entryMod.resource) {\n entryNameMap.set(entryMod.resource, name)\n entryModMap.set(entryMod.resource, entryMod)\n\n let curMap = additionalEntries.get(name)\n\n if (!curMap) {\n curMap = new Map()\n additionalEntries.set(name, curMap)\n }\n depModMap.set(entryMod.resource, entryMod)\n curMap.set(entryMod.resource, entryMod)\n }\n }\n }\n }\n })\n\n const readFile = async (\n path: string\n ): Promise<Buffer | string | null> => {\n const mod = depModMap.get(path) || entryModMap.get(path)\n\n // map the transpiled source when available to avoid\n // parse errors in node-file-trace\n let source: Buffer | string = mod?.originalSource?.()?.buffer()\n return source || ''\n }\n\n const entryPaths = Array.from(entryModMap.keys())\n\n const collectDependencies = async (mod: any, parent: string) => {\n if (!mod || !mod.dependencies) return\n\n for (const dep of mod.dependencies) {\n const depMod = getModuleFromDependency(compilation, dep)\n\n if (depMod?.resource && !depModMap.get(depMod.resource)) {\n depModMap.set(depMod.resource, depMod)\n await collectDependencies(depMod, parent)\n }\n }\n }\n const entriesToTrace = [...entryPaths]\n\n for (const entry of entryPaths) {\n await collectDependencies(entryModMap.get(entry), entry)\n const entryName = entryNameMap.get(entry)!\n const curExtraEntries = additionalEntries.get(entryName)\n\n if (curExtraEntries) {\n entriesToTrace.push(...curExtraEntries.keys())\n }\n }\n\n const contextDirectory = this.tracingRoot\n const chunks = [...entriesToTrace]\n\n this.buildTraceContext.entriesTrace = {\n action: {\n action: 'print',\n input: chunks,\n contextDirectory,\n processCwd: this.rootDir,\n },\n appDir: this.rootDir,\n depModArray: Array.from(depModMap.keys()),\n entryNameMap: Object.fromEntries(entryNameMap),\n absolutePathByEntryName: Object.fromEntries(\n absolutePathByEntryName\n ),\n outputPath: compilation.outputOptions.path!,\n }\n\n let fileList: Set<string>\n let reasons: NodeFileTraceReasons\n const ignores = [\n ...TRACE_IGNORES,\n ...this.traceIgnores,\n '**/node_modules/**',\n ]\n\n // pre-compile the ignore matcher to avoid repeating on every ignoreFn call\n const isIgnoreMatcher = picomatch(ignores, {\n contains: true,\n dot: true,\n })\n const ignoreFn = (path: string) => {\n return isIgnoreMatcher(path)\n }\n\n await finishModulesSpan\n .traceChild('node-file-trace-plugin', {\n traceEntryCount: entriesToTrace.length + '',\n })\n .traceAsyncFn(async () => {\n const result = await nodeFileTrace(entriesToTrace, {\n base: this.tracingRoot,\n processCwd: this.rootDir,\n readFile,\n readlink,\n stat,\n resolve: doResolve\n ? async (id, parent, job, isCjs) => {\n return doResolve(id, parent, job, !isCjs)\n }\n : undefined,\n ignore: ignoreFn,\n mixedModules: true,\n })\n // @ts-ignore\n fileList = result.fileList\n result.esmFileList.forEach((file) => fileList.add(file))\n reasons = result.reasons\n })\n\n await finishModulesSpan\n .traceChild('collect-traced-files')\n .traceAsyncFn(() => {\n const parentFilesMap = getFilesMapFromReasons(\n fileList,\n reasons,\n (file) => {\n // if a file was imported and a loader handled it\n // we don't include it in the trace e.g.\n // static image imports, CSS imports\n file = nodePath.join(this.tracingRoot, file)\n const depMod = depModMap.get(file)\n const isAsset = reasons\n .get(nodePath.relative(this.tracingRoot, file))\n ?.type.includes('asset')\n\n return (\n !isAsset &&\n Array.isArray(depMod?.loaders) &&\n depMod.loaders.length > 0\n )\n }\n )\n\n for (const entry of entryPaths) {\n const entryName = entryNameMap.get(entry)!\n const normalizedEntry = nodePath.relative(\n this.tracingRoot,\n entry\n )\n const curExtraEntries = additionalEntries.get(entryName)\n const finalDeps = new Map<string, { bundled: boolean }>()\n\n // ensure we include entry source file as well for\n // hash comparison\n finalDeps.set(entry, {\n bundled: true,\n })\n\n for (const [dep, info] of parentFilesMap\n .get(normalizedEntry)\n ?.entries() || []) {\n finalDeps.set(nodePath.join(this.tracingRoot, dep), {\n bundled: info.ignored,\n })\n }\n\n if (curExtraEntries) {\n for (const extraEntry of curExtraEntries.keys()) {\n const normalizedExtraEntry = nodePath.relative(\n this.tracingRoot,\n extraEntry\n )\n finalDeps.set(extraEntry, { bundled: false })\n\n for (const [dep, info] of parentFilesMap\n .get(normalizedExtraEntry)\n ?.entries() || []) {\n finalDeps.set(nodePath.join(this.tracingRoot, dep), {\n bundled: info.ignored,\n })\n }\n }\n }\n this.entryTraces.set(entryName, finalDeps)\n }\n })\n })\n .then(\n () => callback(),\n (err) => callback(err)\n )\n }\n )\n }\n\n apply(compiler: webpack.Compiler) {\n compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {\n compilation.hooks.processAssets.tapAsync(\n {\n name: PLUGIN_NAME,\n stage: webpack.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE,\n },\n (_assets: any, callback: any) => {\n this.createTraceAssets(compilation, traceEntrypointsPluginSpan)\n .then(() => callback())\n .catch((err) => callback(err))\n }\n )\n\n // rspack doesn't support all API below so only create trace assets\n if (process.env.NEXT_RSPACK) {\n return\n }\n\n const readlink = async (path: string): Promise<string | null> => {\n try {\n return await new Promise((resolve, reject) => {\n ;(\n compilation.inputFileSystem\n .readlink as typeof import('fs').readlink\n )(path, (err, link) => {\n if (err) return reject(err)\n resolve(link)\n })\n })\n } catch (e) {\n if (\n isError(e) &&\n (e.code === 'EINVAL' || e.code === 'ENOENT' || e.code === 'UNKNOWN')\n ) {\n return null\n }\n throw e\n }\n }\n const stat = async (path: string): Promise<import('fs').Stats | null> => {\n try {\n return await new Promise((resolve, reject) => {\n ;(compilation.inputFileSystem.stat as typeof import('fs').stat)(\n path,\n (err, stats) => {\n if (err) return reject(err)\n resolve(stats)\n }\n )\n })\n } catch (e) {\n if (isError(e) && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) {\n return null\n }\n throw e\n }\n }\n\n const compilationSpan = spans.get(compilation) || spans.get(compiler)!\n const traceEntrypointsPluginSpan = compilationSpan.traceChild(\n 'next-trace-entrypoint-plugin'\n )\n traceEntrypointsPluginSpan.traceFn(() => {\n compilation.hooks.processAssets.tapAsync(\n {\n name: PLUGIN_NAME,\n stage: webpack.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE,\n },\n (_, callback: any) => {\n this.createTraceAssets(compilation, traceEntrypointsPluginSpan)\n .then(() => callback())\n .catch((err) => callback(err))\n }\n )\n\n let resolver = compilation.resolverFactory.get('normal')\n\n function getPkgName(name: string) {\n const segments = name.split('/')\n if (name[0] === '@' && segments.length > 1)\n return segments.length > 1 ? segments.slice(0, 2).join('/') : null\n return segments.length ? segments[0] : null\n }\n\n const getResolve = (\n options: Parameters<typeof resolver.withOptions>[0]\n ) => {\n const curResolver = resolver.withOptions(options)\n\n return (\n parent: string,\n request: string,\n job: import('@vercel/nft/out/node-file-trace').Job\n ) =>\n new Promise<[string, boolean]>((resolve, reject) => {\n const context = nodePath.dirname(parent)\n\n curResolver.resolve(\n {},\n context,\n request,\n {\n fileDependencies: compilation.fileDependencies,\n missingDependencies: compilation.missingDependencies,\n contextDependencies: compilation.contextDependencies,\n },\n async (err: any, result?, resContext?) => {\n if (err) return reject(err)\n\n if (!result) {\n return reject(new Error('module not found'))\n }\n\n // webpack resolver doesn't strip loader query info\n // from the result so use path instead\n if (result.includes('?') || result.includes('!')) {\n result = resContext?.path || result\n }\n\n try {\n // we need to collect all parent package.json's used\n // as webpack's resolve doesn't expose this and parent\n // package.json could be needed for resolving e.g. stylis\n // stylis/package.json -> stylis/dist/umd/package.json\n if (result.includes('node_modules')) {\n let requestPath = result\n .replace(/\\\\/g, '/')\n .replace(/\\0/g, '')\n\n if (\n !nodePath.isAbsolute(request) &&\n request.includes('/') &&\n resContext?.descriptionFileRoot\n ) {\n requestPath = (\n resContext.descriptionFileRoot +\n request.slice(getPkgName(request)?.length || 0) +\n nodePath.sep +\n 'package.json'\n )\n .replace(/\\\\/g, '/')\n .replace(/\\0/g, '')\n }\n\n const rootSeparatorIndex = requestPath.indexOf('/')\n let separatorIndex: number\n while (\n (separatorIndex = requestPath.lastIndexOf('/')) >\n rootSeparatorIndex\n ) {\n requestPath = requestPath.slice(0, separatorIndex)\n const curPackageJsonPath = `${requestPath}/package.json`\n if (await job.isFile(curPackageJsonPath)) {\n await job.emitFile(\n await job.realpath(curPackageJsonPath),\n 'resolve',\n parent\n )\n }\n }\n }\n } catch (_err) {\n // we failed to resolve the package.json boundary,\n // we don't block emitting the initial asset from this\n }\n resolve([result, options.dependencyType === 'esm'])\n }\n )\n })\n }\n\n const CJS_RESOLVE_OPTIONS = {\n ...NODE_RESOLVE_OPTIONS,\n fullySpecified: undefined,\n modules: undefined,\n extensions: undefined,\n }\n const BASE_CJS_RESOLVE_OPTIONS = {\n ...CJS_RESOLVE_OPTIONS,\n alias: false,\n }\n const ESM_RESOLVE_OPTIONS = {\n ...NODE_ESM_RESOLVE_OPTIONS,\n fullySpecified: undefined,\n modules: undefined,\n extensions: undefined,\n }\n const BASE_ESM_RESOLVE_OPTIONS = {\n ...ESM_RESOLVE_OPTIONS,\n alias: false,\n }\n\n const doResolve = async (\n request: string,\n parent: string,\n job: import('@vercel/nft/out/node-file-trace').Job,\n isEsmRequested: boolean\n ): Promise<string> => {\n const context = nodePath.dirname(parent)\n // When in esm externals mode, and using import, we resolve with\n // ESM resolving options.\n const { res } = await resolveExternal(\n this.rootDir,\n this.esmExternals,\n context,\n request,\n isEsmRequested,\n this.optOutBundlingPackages,\n (options) => (_: string, resRequest: string) => {\n return getResolve(options)(parent, resRequest, job)\n },\n undefined,\n undefined,\n ESM_RESOLVE_OPTIONS,\n CJS_RESOLVE_OPTIONS,\n BASE_ESM_RESOLVE_OPTIONS,\n BASE_CJS_RESOLVE_OPTIONS\n )\n\n if (!res) {\n throw new Error(`failed to resolve ${request} from ${parent}`)\n }\n return res.replace(/\\0/g, '')\n }\n\n this.tapfinishModules(\n compilation,\n traceEntrypointsPluginSpan,\n doResolve,\n readlink,\n stat\n )\n })\n })\n }\n}\n"],"names":["nodePath","spans","isError","nodeFileTrace","CLIENT_REFERENCE_MANIFEST","TRACE_OUTPUT_VERSION","webpack","sources","NODE_ESM_RESOLVE_OPTIONS","NODE_RESOLVE_OPTIONS","picomatch","getModuleBuildInfo","getPageFilePath","resolveExternal","isStaticMetadataRoute","PLUGIN_NAME","TRACE_IGNORES","NOT_TRACEABLE","getModuleFromDependency","compilation","dep","moduleGraph","getModule","getFilesMapFromReasons","fileList","reasons","ignoreFn","parentFilesMap","Map","propagateToParents","parents","file","seen","Set","parent","has","add","parentFiles","get","set","ignored","Boolean","parentReason","reason","isInitial","type","length","includes","size","TraceEntryPointsPlugin","constructor","rootDir","appDir","pagesDir","compilerType","optOutBundlingPackages","appDirEnabled","traceIgnores","esmExternals","outputFileTracingRoot","buildTraceContext","entryTraces","tracingRoot","createTraceAssets","span","outputPath","outputOptions","path","traceChild","traceAsyncFn","entryFilesMap","chunksToTrace","entryNameFilesMap","isTraceable","some","suffix","endsWith","entrypoint","entrypoints","values","entryFiles","chunk","process","env","NEXT_RSPACK","chunks","getEntrypointChunk","getAllReferencedChunks","files","filePath","join","auxiliaryFiles","name","chunksTrace","action","input","contextDirectory","processCwd","Object","fromEntries","outputPrefix","traceOutputName","traceOutputPath","dirname","delete","startsWith","appDirRelativeEntryPath","entriesTrace","absolutePathByEntryName","replace","entryIsStaticMetadataRoute","finalFiles","Promise","all","keys","map","fileInfo","relativeFile","relative","bundled","push","emitAsset","RawSource","JSON","stringify","version","tapfinishModules","traceEntrypointsPluginSpan","doResolve","readlink","stat","hooks","finishModules","tapAsync","_stats","callback","finishModulesSpan","entryNameMap","entryModMap","additionalEntries","depModMap","entry","entries","normalizedName","isPage","isApp","dependencies","entryMod","resource","moduleBuildInfo","route","absolutePath","absolutePagePath","request","curMap","readFile","mod","source","originalSource","buffer","entryPaths","Array","from","collectDependencies","depMod","entriesToTrace","entryName","curExtraEntries","depModArray","ignores","isIgnoreMatcher","contains","dot","traceEntryCount","result","base","resolve","id","job","isCjs","undefined","ignore","mixedModules","esmFileList","forEach","isAsset","isArray","loaders","normalizedEntry","finalDeps","info","extraEntry","normalizedExtraEntry","then","err","apply","compiler","tap","processAssets","stage","Compilation","PROCESS_ASSETS_STAGE_SUMMARIZE","_assets","catch","reject","inputFileSystem","link","e","code","stats","compilationSpan","traceFn","_","resolver","resolverFactory","getPkgName","segments","split","slice","getResolve","options","curResolver","withOptions","context","fileDependencies","missingDependencies","contextDependencies","resContext","Error","requestPath","isAbsolute","descriptionFileRoot","sep","rootSeparatorIndex","indexOf","separatorIndex","lastIndexOf","curPackageJsonPath","isFile","emitFile","realpath","_err","dependencyType","CJS_RESOLVE_OPTIONS","fullySpecified","modules","extensions","BASE_CJS_RESOLVE_OPTIONS","alias","ESM_RESOLVE_OPTIONS","BASE_ESM_RESOLVE_OPTIONS","isEsmRequested","res","resRequest"],"mappings":"AAAA,OAAOA,cAAc,OAAM;AAE3B,SAASC,KAAK,QAAQ,qBAAoB;AAC1C,OAAOC,aAAa,wBAAuB;AAC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AAE,GAAG,MAAM/O,gBACpB,IAAI,CAACsC,OAAO,EACZ,IAAI,CAACO,YAAY,EACjBqK,SACAtE,SACAkG,gBACA,IAAI,CAACpM,sBAAsB,EAC3B,CAACqK,UAAY,CAACR,GAAWyC;4BACvB,OAAOlC,WAAWC,SAAS1L,QAAQ2N,YAAY3E;wBACjD,GACAE,WACAA,WACAqE,qBACAN,qBACAO,0BACAH;oBAGF,IAAI,CAACK,KAAK;wBACR,MAAM,qBAAwD,CAAxD,IAAIxB,MAAM,CAAC,kBAAkB,EAAE3E,QAAQ,MAAM,EAAEvH,QAAQ,GAAvD,qBAAA;mCAAA;wCAAA;0CAAA;wBAAuD;oBAC/D;oBACA,OAAO0N,IAAI/I,OAAO,CAAC,OAAO;gBAC5B;gBAEA,IAAI,CAACiB,gBAAgB,CACnB3G,aACA4G,4BACAC,WACAC,UACAC;YAEJ;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../src/build/webpack/plugins/next-trace-entrypoints-plugin.ts"],"sourcesContent":["import nodePath from 'path'\nimport type { Span } from '../../../trace'\nimport isError from '../../../lib/is-error'\nimport { nodeFileTrace } from 'next/dist/compiled/@vercel/nft'\nimport type { NodeFileTraceReasons } from 'next/dist/compiled/@vercel/nft'\nimport {\n CLIENT_REFERENCE_MANIFEST,\n TRACE_OUTPUT_VERSION,\n type CompilerNameValues,\n} from '../../../shared/lib/constants'\nimport { webpack, sources } from 'next/dist/compiled/webpack/webpack'\nimport {\n NODE_ESM_RESOLVE_OPTIONS,\n NODE_RESOLVE_OPTIONS,\n} from '../../webpack-config'\nimport type { NextConfigComplete } from '../../../server/config-shared'\nimport picomatch from 'next/dist/compiled/picomatch'\nimport { getModuleBuildInfo } from '../loaders/get-module-build-info'\nimport { getPageFilePath } from '../../entries'\nimport { resolveExternal } from '../../handle-externals'\nimport { isStaticMetadataRoute } from '../../../lib/metadata/is-metadata-route'\nimport { getCompilationSpan } from '../utils'\n\nconst PLUGIN_NAME = 'TraceEntryPointsPlugin'\nexport const TRACE_IGNORES = [\n '**/*/next/dist/server/next.js',\n '**/*/next/dist/bin/next',\n]\n\nconst NOT_TRACEABLE = [\n '.wasm',\n '.png',\n '.jpg',\n '.jpeg',\n '.gif',\n '.webp',\n '.avif',\n '.ico',\n '.bmp',\n '.svg',\n]\n\nfunction getModuleFromDependency(\n compilation: any,\n dep: any\n): webpack.Module & { resource?: string; request?: string } {\n return compilation.moduleGraph.getModule(dep)\n}\n\nexport function getFilesMapFromReasons(\n fileList: Set<string>,\n reasons: NodeFileTraceReasons,\n ignoreFn?: (file: string, parent?: string) => Boolean\n) {\n // this uses the reasons tree to collect files specific to a\n // certain parent allowing us to not have to trace each parent\n // separately\n const parentFilesMap = new Map<string, Map<string, { ignored: boolean }>>()\n\n function propagateToParents(\n parents: Set<string>,\n file: string,\n seen = new Set<string>()\n ) {\n for (const parent of parents || []) {\n if (!seen.has(parent)) {\n seen.add(parent)\n let parentFiles = parentFilesMap.get(parent)\n\n if (!parentFiles) {\n parentFiles = new Map()\n parentFilesMap.set(parent, parentFiles)\n }\n const ignored = Boolean(ignoreFn?.(file, parent))\n parentFiles.set(file, { ignored })\n\n const parentReason = reasons.get(parent)\n\n if (parentReason?.parents) {\n propagateToParents(parentReason.parents, file, seen)\n }\n }\n }\n }\n\n for (const file of fileList!) {\n const reason = reasons!.get(file)\n const isInitial =\n reason?.type.length === 1 && reason.type.includes('initial')\n\n if (\n !reason ||\n !reason.parents ||\n (isInitial && reason.parents.size === 0)\n ) {\n continue\n }\n propagateToParents(reason.parents, file)\n }\n return parentFilesMap\n}\n\nexport interface TurbotraceAction {\n action: 'print' | 'annotate'\n input: string[]\n contextDirectory: string\n processCwd: string\n showAll?: boolean\n memoryLimit?: number\n}\n\nexport interface BuildTraceContext {\n entriesTrace?: {\n action: TurbotraceAction\n appDir: string\n outputPath: string\n depModArray: string[]\n entryNameMap: Record<string, string>\n absolutePathByEntryName: Record<string, string>\n }\n chunksTrace?: {\n action: TurbotraceAction\n outputPath: string\n entryNameFilesMap: Record<string, Array<string>>\n }\n}\n\nexport class TraceEntryPointsPlugin implements webpack.WebpackPluginInstance {\n public buildTraceContext: BuildTraceContext = {}\n\n private rootDir: string\n private appDir: string | undefined\n private pagesDir: string | undefined\n private appDirEnabled?: boolean\n private tracingRoot: string\n private entryTraces: Map<string, Map<string, { bundled: boolean }>>\n private traceIgnores: string[]\n private esmExternals?: NextConfigComplete['experimental']['esmExternals']\n private compilerType: CompilerNameValues\n\n constructor({\n rootDir,\n appDir,\n pagesDir,\n compilerType,\n appDirEnabled,\n traceIgnores,\n esmExternals,\n outputFileTracingRoot,\n }: {\n rootDir: string\n compilerType: CompilerNameValues\n appDir: string | undefined\n pagesDir: string | undefined\n appDirEnabled?: boolean\n traceIgnores?: string[]\n outputFileTracingRoot?: string\n esmExternals?: NextConfigComplete['experimental']['esmExternals']\n }) {\n this.rootDir = rootDir\n this.appDir = appDir\n this.pagesDir = pagesDir\n this.entryTraces = new Map()\n this.esmExternals = esmExternals\n this.appDirEnabled = appDirEnabled\n this.traceIgnores = traceIgnores || []\n this.tracingRoot = outputFileTracingRoot || rootDir\n this.compilerType = compilerType\n }\n\n // Here we output all traced assets and webpack chunks to a\n // ${page}.js.nft.json file\n async createTraceAssets(compilation: webpack.Compilation, span: Span) {\n const outputPath = compilation.outputOptions.path || ''\n\n await span.traceChild('create-trace-assets').traceAsyncFn(async () => {\n const entryFilesMap = new Map<any, Set<string>>()\n const chunksToTrace = new Set<string>()\n const entryNameFilesMap = new Map<string, Array<string>>()\n\n const isTraceable = (file: string) =>\n !NOT_TRACEABLE.some((suffix) => {\n return file.endsWith(suffix)\n })\n\n for (const entrypoint of compilation.entrypoints.values()) {\n const entryFiles = new Set<string>()\n\n for (const chunk of process.env.NEXT_RSPACK\n ? entrypoint.chunks\n : entrypoint.getEntrypointChunk().getAllReferencedChunks()) {\n for (const file of chunk.files) {\n if (isTraceable(file)) {\n const filePath = nodePath.join(outputPath, file)\n chunksToTrace.add(filePath)\n entryFiles.add(filePath)\n }\n }\n for (const file of chunk.auxiliaryFiles) {\n if (isTraceable(file)) {\n const filePath = nodePath.join(outputPath, file)\n chunksToTrace.add(filePath)\n entryFiles.add(filePath)\n }\n }\n }\n entryFilesMap.set(entrypoint, entryFiles)\n entryNameFilesMap.set(entrypoint.name || '', [...entryFiles])\n }\n\n // startTrace existed and callable\n this.buildTraceContext.chunksTrace = {\n action: {\n action: 'annotate',\n input: [...chunksToTrace],\n contextDirectory: this.tracingRoot,\n processCwd: this.rootDir,\n },\n outputPath,\n entryNameFilesMap: Object.fromEntries(entryNameFilesMap),\n }\n\n // server compiler outputs to `server/chunks` so we traverse up\n // one, but edge-server does not so don't for that one\n const outputPrefix = this.compilerType === 'server' ? '../' : ''\n\n for (const [entrypoint, entryFiles] of entryFilesMap) {\n const traceOutputName = `${outputPrefix}${entrypoint.name}.js.nft.json`\n const traceOutputPath = nodePath.dirname(\n nodePath.join(outputPath, traceOutputName)\n )\n\n // don't include the entry itself in the trace\n entryFiles.delete(\n nodePath.join(outputPath, `${outputPrefix}${entrypoint.name}.js`)\n )\n\n if (entrypoint.name.startsWith('app/') && this.appDir) {\n const appDirRelativeEntryPath =\n this.buildTraceContext.entriesTrace?.absolutePathByEntryName[\n entrypoint.name\n ]?.replace(this.appDir, '')\n\n const entryIsStaticMetadataRoute =\n appDirRelativeEntryPath &&\n isStaticMetadataRoute(appDirRelativeEntryPath)\n\n // Include the client reference manifest in the trace, but not for\n // static metadata routes, for which we don't generate those.\n if (!entryIsStaticMetadataRoute) {\n entryFiles.add(\n nodePath.join(\n outputPath,\n outputPrefix,\n entrypoint.name.replace(/%5F/g, '_') +\n '_' +\n CLIENT_REFERENCE_MANIFEST +\n '.js'\n )\n )\n }\n }\n\n const finalFiles: string[] = []\n\n await Promise.all(\n [\n ...new Set([\n ...entryFiles,\n ...(this.entryTraces.get(entrypoint.name)?.keys() || []),\n ]),\n ].map(async (file) => {\n const fileInfo = this.entryTraces.get(entrypoint.name)?.get(file)\n\n const relativeFile = nodePath\n .relative(traceOutputPath, file)\n .replace(/\\\\/g, '/')\n\n if (file) {\n if (!fileInfo?.bundled) {\n finalFiles.push(relativeFile)\n }\n }\n })\n )\n\n compilation.emitAsset(\n traceOutputName,\n new sources.RawSource(\n JSON.stringify({\n version: TRACE_OUTPUT_VERSION,\n files: finalFiles,\n })\n ) as unknown as webpack.sources.RawSource\n )\n }\n })\n }\n\n tapfinishModules(\n compilation: webpack.Compilation,\n traceEntrypointsPluginSpan: Span,\n doResolve: (\n request: string,\n parent: string,\n job: import('@vercel/nft/out/node-file-trace').Job,\n isEsmRequested: boolean\n ) => Promise<string>,\n readlink: any,\n stat: any\n ) {\n compilation.hooks.finishModules.tapAsync(\n PLUGIN_NAME,\n async (_stats: any, callback: any) => {\n const finishModulesSpan =\n traceEntrypointsPluginSpan.traceChild('finish-modules')\n await finishModulesSpan\n .traceAsyncFn(async () => {\n // we create entry -> module maps so that we can\n // look them up faster instead of having to iterate\n // over the compilation modules list\n const entryNameMap = new Map<string, string>()\n const entryModMap = new Map<string, any>()\n const additionalEntries = new Map<string, Map<string, any>>()\n const absolutePathByEntryName = new Map<string, string>()\n\n const depModMap = new Map<string, any>()\n\n await finishModulesSpan\n .traceChild('get-entries')\n .traceAsyncFn(async () => {\n for (const [name, entry] of compilation.entries.entries()) {\n const normalizedName = name?.replace(/\\\\/g, '/')\n\n const isPage = normalizedName.startsWith('pages/')\n const isApp =\n this.appDirEnabled && normalizedName.startsWith('app/')\n\n if (isApp || isPage) {\n for (const dep of entry.dependencies) {\n if (!dep) continue\n const entryMod = getModuleFromDependency(compilation, dep)\n\n // Handle case where entry is a loader coming from Next.js.\n // For example edge-loader or app-loader.\n if (entryMod && entryMod.resource === '') {\n const moduleBuildInfo = getModuleBuildInfo(entryMod)\n // All loaders that are used to create entries have a `route` property on the buildInfo.\n if (moduleBuildInfo.route) {\n const absolutePath = getPageFilePath({\n absolutePagePath:\n moduleBuildInfo.route.absolutePagePath,\n rootDir: this.rootDir,\n appDir: this.appDir,\n pagesDir: this.pagesDir,\n })\n\n // Ensures we don't handle non-pages.\n if (\n (this.pagesDir &&\n absolutePath.startsWith(this.pagesDir)) ||\n (this.appDir &&\n absolutePath.startsWith(this.appDir))\n ) {\n entryModMap.set(absolutePath, entryMod)\n entryNameMap.set(absolutePath, name)\n absolutePathByEntryName.set(name, absolutePath)\n }\n }\n\n // If there was no `route` property, we can assume that it was something custom instead.\n // In order to trace these we add them to the additionalEntries map.\n if (entryMod.request) {\n let curMap = additionalEntries.get(name)\n\n if (!curMap) {\n curMap = new Map()\n additionalEntries.set(name, curMap)\n }\n depModMap.set(entryMod.request, entryMod)\n curMap.set(entryMod.resource, entryMod)\n }\n }\n\n if (entryMod && entryMod.resource) {\n entryNameMap.set(entryMod.resource, name)\n entryModMap.set(entryMod.resource, entryMod)\n\n let curMap = additionalEntries.get(name)\n\n if (!curMap) {\n curMap = new Map()\n additionalEntries.set(name, curMap)\n }\n depModMap.set(entryMod.resource, entryMod)\n curMap.set(entryMod.resource, entryMod)\n }\n }\n }\n }\n })\n\n const readFile = async (\n path: string\n ): Promise<Buffer | string | null> => {\n const mod = depModMap.get(path) || entryModMap.get(path)\n\n // map the transpiled source when available to avoid\n // parse errors in node-file-trace\n let source: Buffer | string = mod?.originalSource?.()?.buffer()\n return source || ''\n }\n\n const entryPaths = Array.from(entryModMap.keys())\n\n const collectDependencies = async (mod: any, parent: string) => {\n if (!mod || !mod.dependencies) return\n\n for (const dep of mod.dependencies) {\n const depMod = getModuleFromDependency(compilation, dep)\n\n if (depMod?.resource && !depModMap.get(depMod.resource)) {\n depModMap.set(depMod.resource, depMod)\n await collectDependencies(depMod, parent)\n }\n }\n }\n const entriesToTrace = [...entryPaths]\n\n for (const entry of entryPaths) {\n await collectDependencies(entryModMap.get(entry), entry)\n const entryName = entryNameMap.get(entry)!\n const curExtraEntries = additionalEntries.get(entryName)\n\n if (curExtraEntries) {\n entriesToTrace.push(...curExtraEntries.keys())\n }\n }\n\n const contextDirectory = this.tracingRoot\n const chunks = [...entriesToTrace]\n\n this.buildTraceContext.entriesTrace = {\n action: {\n action: 'print',\n input: chunks,\n contextDirectory,\n processCwd: this.rootDir,\n },\n appDir: this.rootDir,\n depModArray: Array.from(depModMap.keys()),\n entryNameMap: Object.fromEntries(entryNameMap),\n absolutePathByEntryName: Object.fromEntries(\n absolutePathByEntryName\n ),\n outputPath: compilation.outputOptions.path!,\n }\n\n let fileList: Set<string>\n let reasons: NodeFileTraceReasons\n const ignores = [\n ...TRACE_IGNORES,\n ...this.traceIgnores,\n '**/node_modules/**',\n ]\n\n // pre-compile the ignore matcher to avoid repeating on every ignoreFn call\n const isIgnoreMatcher = picomatch(ignores, {\n contains: true,\n dot: true,\n })\n const ignoreFn = (path: string) => {\n return isIgnoreMatcher(path)\n }\n\n await finishModulesSpan\n .traceChild('node-file-trace-plugin', {\n traceEntryCount: entriesToTrace.length + '',\n })\n .traceAsyncFn(async () => {\n const result = await nodeFileTrace(entriesToTrace, {\n base: this.tracingRoot,\n processCwd: this.rootDir,\n readFile,\n readlink,\n stat,\n resolve: doResolve\n ? async (id, parent, job, isCjs) => {\n return doResolve(id, parent, job, !isCjs)\n }\n : undefined,\n ignore: ignoreFn,\n mixedModules: true,\n })\n // @ts-ignore\n fileList = result.fileList\n result.esmFileList.forEach((file) => fileList.add(file))\n reasons = result.reasons\n })\n\n await finishModulesSpan\n .traceChild('collect-traced-files')\n .traceAsyncFn(() => {\n const parentFilesMap = getFilesMapFromReasons(\n fileList,\n reasons,\n (file) => {\n // if a file was imported and a loader handled it\n // we don't include it in the trace e.g.\n // static image imports, CSS imports\n file = nodePath.join(this.tracingRoot, file)\n const depMod = depModMap.get(file)\n const isAsset = reasons\n .get(nodePath.relative(this.tracingRoot, file))\n ?.type.includes('asset')\n\n return (\n !isAsset &&\n Array.isArray(depMod?.loaders) &&\n depMod.loaders.length > 0\n )\n }\n )\n\n for (const entry of entryPaths) {\n const entryName = entryNameMap.get(entry)!\n const normalizedEntry = nodePath.relative(\n this.tracingRoot,\n entry\n )\n const curExtraEntries = additionalEntries.get(entryName)\n const finalDeps = new Map<string, { bundled: boolean }>()\n\n // ensure we include entry source file as well for\n // hash comparison\n finalDeps.set(entry, {\n bundled: true,\n })\n\n for (const [dep, info] of parentFilesMap\n .get(normalizedEntry)\n ?.entries() || []) {\n finalDeps.set(nodePath.join(this.tracingRoot, dep), {\n bundled: info.ignored,\n })\n }\n\n if (curExtraEntries) {\n for (const extraEntry of curExtraEntries.keys()) {\n const normalizedExtraEntry = nodePath.relative(\n this.tracingRoot,\n extraEntry\n )\n finalDeps.set(extraEntry, { bundled: false })\n\n for (const [dep, info] of parentFilesMap\n .get(normalizedExtraEntry)\n ?.entries() || []) {\n finalDeps.set(nodePath.join(this.tracingRoot, dep), {\n bundled: info.ignored,\n })\n }\n }\n }\n this.entryTraces.set(entryName, finalDeps)\n }\n })\n })\n .then(\n () => callback(),\n (err) => callback(err)\n )\n }\n )\n }\n\n apply(compiler: webpack.Compiler) {\n compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {\n const compilationSpan =\n getCompilationSpan(compilation) || getCompilationSpan(compiler)!\n const traceEntrypointsPluginSpan = compilationSpan.traceChild(\n 'next-trace-entrypoint-plugin'\n )\n\n compilation.hooks.processAssets.tapAsync(\n {\n name: PLUGIN_NAME,\n stage: webpack.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE,\n },\n (_assets: any, callback: any) => {\n this.createTraceAssets(compilation, traceEntrypointsPluginSpan)\n .then(() => callback())\n .catch((err) => callback(err))\n }\n )\n\n // rspack doesn't support all API below so only create trace assets\n if (process.env.NEXT_RSPACK) {\n return\n }\n\n const readlink = async (path: string): Promise<string | null> => {\n try {\n return await new Promise((resolve, reject) => {\n ;(\n compilation.inputFileSystem\n .readlink as typeof import('fs').readlink\n )(path, (err, link) => {\n if (err) return reject(err)\n resolve(link)\n })\n })\n } catch (e) {\n if (\n isError(e) &&\n (e.code === 'EINVAL' || e.code === 'ENOENT' || e.code === 'UNKNOWN')\n ) {\n return null\n }\n throw e\n }\n }\n const stat = async (path: string): Promise<import('fs').Stats | null> => {\n try {\n return await new Promise((resolve, reject) => {\n ;(compilation.inputFileSystem.stat as typeof import('fs').stat)(\n path,\n (err, stats) => {\n if (err) return reject(err)\n resolve(stats)\n }\n )\n })\n } catch (e) {\n if (isError(e) && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) {\n return null\n }\n throw e\n }\n }\n\n traceEntrypointsPluginSpan.traceFn(() => {\n compilation.hooks.processAssets.tapAsync(\n {\n name: PLUGIN_NAME,\n stage: webpack.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE,\n },\n (_, callback: any) => {\n this.createTraceAssets(compilation, traceEntrypointsPluginSpan)\n .then(() => callback())\n .catch((err) => callback(err))\n }\n )\n\n let resolver = compilation.resolverFactory.get('normal')\n\n function getPkgName(name: string) {\n const segments = name.split('/')\n if (name[0] === '@' && segments.length > 1)\n return segments.length > 1 ? segments.slice(0, 2).join('/') : null\n return segments.length ? segments[0] : null\n }\n\n const getResolve = (\n options: Parameters<typeof resolver.withOptions>[0]\n ) => {\n const curResolver = resolver.withOptions(options)\n\n return (\n parent: string,\n request: string,\n job: import('@vercel/nft/out/node-file-trace').Job\n ) =>\n new Promise<[string, boolean]>((resolve, reject) => {\n const context = nodePath.dirname(parent)\n\n curResolver.resolve(\n {},\n context,\n request,\n {\n fileDependencies: compilation.fileDependencies,\n missingDependencies: compilation.missingDependencies,\n contextDependencies: compilation.contextDependencies,\n },\n async (err: any, result?, resContext?) => {\n if (err) return reject(err)\n\n if (!result) {\n return reject(new Error('module not found'))\n }\n\n // webpack resolver doesn't strip loader query info\n // from the result so use path instead\n if (result.includes('?') || result.includes('!')) {\n result = resContext?.path || result\n }\n\n try {\n // we need to collect all parent package.json's used\n // as webpack's resolve doesn't expose this and parent\n // package.json could be needed for resolving e.g. stylis\n // stylis/package.json -> stylis/dist/umd/package.json\n if (result.includes('node_modules')) {\n let requestPath = result\n .replace(/\\\\/g, '/')\n .replace(/\\0/g, '')\n\n if (\n !nodePath.isAbsolute(request) &&\n request.includes('/') &&\n resContext?.descriptionFileRoot\n ) {\n requestPath = (\n resContext.descriptionFileRoot +\n request.slice(getPkgName(request)?.length || 0) +\n nodePath.sep +\n 'package.json'\n )\n .replace(/\\\\/g, '/')\n .replace(/\\0/g, '')\n }\n\n const rootSeparatorIndex = requestPath.indexOf('/')\n let separatorIndex: number\n while (\n (separatorIndex = requestPath.lastIndexOf('/')) >\n rootSeparatorIndex\n ) {\n requestPath = requestPath.slice(0, separatorIndex)\n const curPackageJsonPath = `${requestPath}/package.json`\n if (await job.isFile(curPackageJsonPath)) {\n await job.emitFile(\n await job.realpath(curPackageJsonPath),\n 'resolve',\n parent\n )\n }\n }\n }\n } catch (_err) {\n // we failed to resolve the package.json boundary,\n // we don't block emitting the initial asset from this\n }\n resolve([result, options.dependencyType === 'esm'])\n }\n )\n })\n }\n\n const CJS_RESOLVE_OPTIONS = {\n ...NODE_RESOLVE_OPTIONS,\n fullySpecified: undefined,\n modules: undefined,\n extensions: undefined,\n }\n const BASE_CJS_RESOLVE_OPTIONS = {\n ...CJS_RESOLVE_OPTIONS,\n alias: false,\n }\n const ESM_RESOLVE_OPTIONS = {\n ...NODE_ESM_RESOLVE_OPTIONS,\n fullySpecified: undefined,\n modules: undefined,\n extensions: undefined,\n }\n const BASE_ESM_RESOLVE_OPTIONS = {\n ...ESM_RESOLVE_OPTIONS,\n alias: false,\n }\n\n const doResolve = async (\n request: string,\n parent: string,\n job: import('@vercel/nft/out/node-file-trace').Job,\n isEsmRequested: boolean\n ): Promise<string> => {\n const context = nodePath.dirname(parent)\n // When in esm externals mode, and using import, we resolve with\n // ESM resolving options.\n const { res } = await resolveExternal(\n this.rootDir,\n this.esmExternals,\n context,\n request,\n isEsmRequested,\n (options) => (_: string, resRequest: string) => {\n return getResolve(options)(parent, resRequest, job)\n },\n undefined,\n undefined,\n ESM_RESOLVE_OPTIONS,\n CJS_RESOLVE_OPTIONS,\n BASE_ESM_RESOLVE_OPTIONS,\n BASE_CJS_RESOLVE_OPTIONS\n )\n\n if (!res) {\n throw new Error(`failed to resolve ${request} from ${parent}`)\n }\n return res.replace(/\\0/g, '')\n }\n\n this.tapfinishModules(\n compilation,\n traceEntrypointsPluginSpan,\n doResolve,\n readlink,\n stat\n )\n })\n })\n }\n}\n"],"names":["nodePath","isError","nodeFileTrace","CLIENT_REFERENCE_MANIFEST","TRACE_OUTPUT_VERSION","webpack","sources","NODE_ESM_RESOLVE_OPTIONS","NODE_RESOLVE_OPTIONS","picomatch","getModuleBuildInfo","getPageFilePath","resolveExternal","isStaticMetadataRoute","getCompilationSpan","PLUGIN_NAME","TRACE_IGNORES","NOT_TRACEABLE","getModuleFromDependency","compilation","dep","moduleGraph","getModule","getFilesMapFromReasons","fileList","reasons","ignoreFn","parentFilesMap","Map","propagateToParents","parents","file","seen","Set","parent","has","add","parentFiles","get","set","ignored","Boolean","parentReason","reason","isInitial","type","length","includes","size","TraceEntryPointsPlugin","constructor","rootDir","appDir","pagesDir","compilerType","appDirEnabled","traceIgnores","esmExternals","outputFileTracingRoot","buildTraceContext","entryTraces","tracingRoot","createTraceAssets","span","outputPath","outputOptions","path","traceChild","traceAsyncFn","entryFilesMap","chunksToTrace","entryNameFilesMap","isTraceable","some","suffix","endsWith","entrypoint","entrypoints","values","entryFiles","chunk","process","env","NEXT_RSPACK","chunks","getEntrypointChunk","getAllReferencedChunks","files","filePath","join","auxiliaryFiles","name","chunksTrace","action","input","contextDirectory","processCwd","Object","fromEntries","outputPrefix","traceOutputName","traceOutputPath","dirname","delete","startsWith","appDirRelativeEntryPath","entriesTrace","absolutePathByEntryName","replace","entryIsStaticMetadataRoute","finalFiles","Promise","all","keys","map","fileInfo","relativeFile","relative","bundled","push","emitAsset","RawSource","JSON","stringify","version","tapfinishModules","traceEntrypointsPluginSpan","doResolve","readlink","stat","hooks","finishModules","tapAsync","_stats","callback","finishModulesSpan","entryNameMap","entryModMap","additionalEntries","depModMap","entry","entries","normalizedName","isPage","isApp","dependencies","entryMod","resource","moduleBuildInfo","route","absolutePath","absolutePagePath","request","curMap","readFile","mod","source","originalSource","buffer","entryPaths","Array","from","collectDependencies","depMod","entriesToTrace","entryName","curExtraEntries","depModArray","ignores","isIgnoreMatcher","contains","dot","traceEntryCount","result","base","resolve","id","job","isCjs","undefined","ignore","mixedModules","esmFileList","forEach","isAsset","isArray","loaders","normalizedEntry","finalDeps","info","extraEntry","normalizedExtraEntry","then","err","apply","compiler","tap","compilationSpan","processAssets","stage","Compilation","PROCESS_ASSETS_STAGE_SUMMARIZE","_assets","catch","reject","inputFileSystem","link","e","code","stats","traceFn","_","resolver","resolverFactory","getPkgName","segments","split","slice","getResolve","options","curResolver","withOptions","context","fileDependencies","missingDependencies","contextDependencies","resContext","Error","requestPath","isAbsolute","descriptionFileRoot","sep","rootSeparatorIndex","indexOf","separatorIndex","lastIndexOf","curPackageJsonPath","isFile","emitFile","realpath","_err","dependencyType","CJS_RESOLVE_OPTIONS","fullySpecified","modules","extensions","BASE_CJS_RESOLVE_OPTIONS","alias","ESM_RESOLVE_OPTIONS","BASE_ESM_RESOLVE_OPTIONS","isEsmRequested","res","resRequest"],"mappings":"AAAA,OAAOA,cAAc,OAAM;AAE3B,OAAOC,aAAa,wBAAuB;AAC3C,SAASC,aAAa,QAAQ,iCAAgC;AAE9D,SACEC,yBAAyB,EACzBC,oBAAoB,QAEf,gCAA+B;AACtC,SAASC,OAAO,EAAEC,OAAO,QAAQ,qCAAoC;AACrE,SACEC,wBAAwB,EACxBC,oBAAoB,QACf,uBAAsB;AAE7B,OAAOC,eAAe,+BAA8B;AACpD,SAASC,kBAAkB,QAAQ,mCAAkC;AACrE,SAASC,eAAe,QAAQ,gBAAe;AAC/C,SAASC,eAAe,QAAQ,yBAAwB;AACxD,SAASC,qBAAqB,QAAQ,0CAAyC;AAC/E,SAASC,kBAAkB,QAAQ,WAAU;AAE7C,MAAMC,cAAc;AACpB,O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B,gBAAgB,CACnB1G,aACA2G,4BACAC,WACAC,UACAC;YAEJ;QACF;IACF;AACF"}
@@ -1,4 +1,6 @@
1
1
  import { getAppLoader } from '../entries';
2
+ import { spans as webpackCompilationSpans } from './plugins/profiling-plugin';
3
+ import { compilationSpans as rspackCompilationSpans } from './plugins/rspack-profiling-plugin';
2
4
  export function traverseModules(compilation, callback, filterChunkGroup) {
3
5
  compilation.chunkGroups.forEach((chunkGroup)=>{
4
6
  if (filterChunkGroup && !filterChunkGroup(chunkGroup)) {
@@ -66,5 +68,9 @@ export function getModuleReferencesInOrder(module, moduleGraph) {
66
68
  connections.sort((a, b)=>a.index - b.index);
67
69
  return connections.map((c)=>c.connection);
68
70
  }
71
+ export function getCompilationSpan(compilation) {
72
+ const compilationSpans = process.env.NEXT_RSPACK ? rspackCompilationSpans : webpackCompilationSpans;
73
+ return compilationSpans.get(compilation);
74
+ }
69
75
 
70
76
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/build/webpack/utils.ts"],"sourcesContent":["import type {\n Compilation,\n Chunk,\n ChunkGroup,\n NormalModule,\n Module,\n ModuleGraph,\n} from 'webpack'\nimport type { ModuleGraphConnection } from 'webpack'\nimport { getAppLoader } from '../entries'\n\nexport function traverseModules(\n compilation: Compilation,\n callback: (\n mod: any,\n chunk: Chunk,\n chunkGroup: (typeof compilation.chunkGroups)[0],\n modId: string | null\n ) => any,\n filterChunkGroup?: (chunkGroup: ChunkGroup) => boolean\n) {\n compilation.chunkGroups.forEach((chunkGroup) => {\n if (filterChunkGroup && !filterChunkGroup(chunkGroup)) {\n return\n }\n chunkGroup.chunks.forEach((chunk: Chunk) => {\n const chunkModules = compilation.chunkGraph.getChunkModulesIterable(\n chunk\n // TODO: Update type so that it doesn't have to be cast.\n ) as Iterable<NormalModule>\n for (const mod of chunkModules) {\n const modId = compilation.chunkGraph.getModuleId(mod)?.toString()\n if (modId) callback(mod, chunk, chunkGroup, modId)\n const anyModule = mod as any\n if (anyModule.modules) {\n for (const subMod of anyModule.modules)\n if (modId) callback(subMod, chunk, chunkGroup, modId)\n }\n }\n })\n })\n}\n\n// Loop over all the entry modules.\nexport function forEachEntryModule(\n compilation: any,\n callback: ({ name, entryModule }: { name: string; entryModule: any }) => void\n) {\n for (const [name, entry] of compilation.entries.entries()) {\n // Skip for entries under pages/\n if (name.startsWith('pages/')) {\n continue\n }\n\n // Check if the page entry is a server component or not.\n const entryDependency: NormalModule | undefined = entry.dependencies?.[0]\n // Ensure only next-app-loader entries are handled.\n if (!entryDependency || !entryDependency.request) continue\n\n const request = entryDependency.request\n\n if (\n !request.startsWith('next-edge-ssr-loader?') &&\n !request.startsWith('next-edge-app-route-loader?') &&\n !request.startsWith(`${getAppLoader()}?`)\n )\n continue\n\n let entryModule: NormalModule =\n compilation.moduleGraph.getResolvedModule(entryDependency)\n\n if (\n request.startsWith('next-edge-ssr-loader?') ||\n request.startsWith('next-edge-app-route-loader?')\n ) {\n entryModule.dependencies.forEach((dependency) => {\n const modRequest: string | undefined = (dependency as any).request\n if (modRequest?.includes(getAppLoader())) {\n entryModule = compilation.moduleGraph.getResolvedModule(dependency)\n }\n })\n }\n\n callback({ name, entryModule })\n }\n}\n\nexport function formatBarrelOptimizedResource(\n resource: string,\n matchResource: string\n) {\n return `${resource}@${matchResource}`\n}\n\nexport function getModuleReferencesInOrder(\n module: Module,\n moduleGraph: ModuleGraph\n): ModuleGraphConnection[] {\n if (\n 'getOutgoingConnectionsInOrder' in moduleGraph &&\n typeof moduleGraph.getOutgoingConnectionsInOrder === 'function'\n ) {\n return moduleGraph.getOutgoingConnectionsInOrder(module)\n }\n const connections = []\n for (const connection of moduleGraph.getOutgoingConnections(module)) {\n if (connection.dependency && connection.module) {\n connections.push({\n connection,\n index: moduleGraph.getParentBlockIndex(connection.dependency),\n })\n }\n }\n connections.sort((a, b) => a.index - b.index)\n return connections.map((c) => c.connection)\n}\n"],"names":["getAppLoader","traverseModules","compilation","callback","filterChunkGroup","chunkGroups","forEach","chunkGroup","chunks","chunk","chunkModules","chunkGraph","getChunkModulesIterable","mod","modId","getModuleId","toString","anyModule","modules","subMod","forEachEntryModule","name","entry","entries","startsWith","entryDependency","dependencies","request","entryModule","moduleGraph","getResolvedModule","dependency","modRequest","includes","formatBarrelOptimizedResource","resource","matchResource","getModuleReferencesInOrder","module","getOutgoingConnectionsInOrder","connections","connection","getOutgoingConnections","push","index","getParentBlockIndex","sort","a","b","map","c"],"mappings":"AASA,SAASA,YAAY,QAAQ,aAAY;AAEzC,OAAO,SAASC,gBACdC,WAAwB,EACxBC,QAKQ,EACRC,gBAAsD;IAEtDF,YAAYG,WAAW,CAACC,OAAO,CAAC,CAACC;QAC/B,IAAIH,oBAAoB,CAACA,iBAAiBG,aAAa;YACrD;QACF;QACAA,WAAWC,MAAM,CAACF,OAAO,CAAC,CAACG;YACzB,MAAMC,eAAeR,YAAYS,UAAU,CAACC,uBAAuB,CACjEH;YAGF,KAAK,MAAMI,OAAOH,aAAc;oBAChBR;gBAAd,MAAMY,SAAQZ,sCAAAA,YAAYS,UAAU,CAACI,WAAW,CAACF,yBAAnCX,oCAAyCc,QAAQ;gBAC/D,IAAIF,OAAOX,SAASU,KAAKJ,OAAOF,YAAYO;gBAC5C,MAAMG,YAAYJ;gBAClB,IAAII,UAAUC,OAAO,EAAE;oBACrB,KAAK,MAAMC,UAAUF,UAAUC,OAAO,CACpC,IAAIJ,OAAOX,SAASgB,QAAQV,OAAOF,YAAYO;gBACnD;YACF;QACF;IACF;AACF;AAEA,mCAAmC;AACnC,OAAO,SAASM,mBACdlB,WAAgB,EAChBC,QAA6E;IAE7E,KAAK,MAAM,CAACkB,MAAMC,MAAM,IAAIpB,YAAYqB,OAAO,CAACA,OAAO,GAAI;YAOPD;QANlD,gCAAgC;QAChC,IAAID,KAAKG,UAAU,CAAC,WAAW;YAC7B;QACF;QAEA,wDAAwD;QACxD,MAAMC,mBAA4CH,sBAAAA,MAAMI,YAAY,qBAAlBJ,mBA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AC,CAACC,IAAMA,EAAET,UAAU;AAC5C"}
1
+ {"version":3,"sources":["../../../src/build/webpack/utils.ts"],"sourcesContent":["import type {\n Compilation,\n Chunk,\n ChunkGroup,\n NormalModule,\n Module,\n ModuleGraph,\n Compiler,\n} from 'webpack'\nimport type { ModuleGraphConnection } from 'webpack'\nimport { getAppLoader } from '../entries'\nimport { spans as webpackCompilationSpans } from './plugins/profiling-plugin'\nimport { compilationSpans as rspackCompilationSpans } from './plugins/rspack-profiling-plugin'\nimport type { Span } from '../../trace'\n\nexport function traverseModules(\n compilation: Compilation,\n callback: (\n mod: any,\n chunk: Chunk,\n chunkGroup: (typeof compilation.chunkGroups)[0],\n modId: string | null\n ) => any,\n filterChunkGroup?: (chunkGroup: ChunkGroup) => boolean\n) {\n compilation.chunkGroups.forEach((chunkGroup) => {\n if (filterChunkGroup && !filterChunkGroup(chunkGroup)) {\n return\n }\n chunkGroup.chunks.forEach((chunk: Chunk) => {\n const chunkModules = compilation.chunkGraph.getChunkModulesIterable(\n chunk\n // TODO: Update type so that it doesn't have to be cast.\n ) as Iterable<NormalModule>\n for (const mod of chunkModules) {\n const modId = compilation.chunkGraph.getModuleId(mod)?.toString()\n if (modId) callback(mod, chunk, chunkGroup, modId)\n const anyModule = mod as any\n if (anyModule.modules) {\n for (const subMod of anyModule.modules)\n if (modId) callback(subMod, chunk, chunkGroup, modId)\n }\n }\n })\n })\n}\n\n// Loop over all the entry modules.\nexport function forEachEntryModule(\n compilation: any,\n callback: ({ name, entryModule }: { name: string; entryModule: any }) => void\n) {\n for (const [name, entry] of compilation.entries.entries()) {\n // Skip for entries under pages/\n if (name.startsWith('pages/')) {\n continue\n }\n\n // Check if the page entry is a server component or not.\n const entryDependency: NormalModule | undefined = entry.dependencies?.[0]\n // Ensure only next-app-loader entries are handled.\n if (!entryDependency || !entryDependency.request) continue\n\n const request = entryDependency.request\n\n if (\n !request.startsWith('next-edge-ssr-loader?') &&\n !request.startsWith('next-edge-app-route-loader?') &&\n !request.startsWith(`${getAppLoader()}?`)\n )\n continue\n\n let entryModule: NormalModule =\n compilation.moduleGraph.getResolvedModule(entryDependency)\n\n if (\n request.startsWith('next-edge-ssr-loader?') ||\n request.startsWith('next-edge-app-route-loader?')\n ) {\n entryModule.dependencies.forEach((dependency) => {\n const modRequest: string | undefined = (dependency as any).request\n if (modRequest?.includes(getAppLoader())) {\n entryModule = compilation.moduleGraph.getResolvedModule(dependency)\n }\n })\n }\n\n callback({ name, entryModule })\n }\n}\n\nexport function formatBarrelOptimizedResource(\n resource: string,\n matchResource: string\n) {\n return `${resource}@${matchResource}`\n}\n\nexport function getModuleReferencesInOrder(\n module: Module,\n moduleGraph: ModuleGraph\n): ModuleGraphConnection[] {\n if (\n 'getOutgoingConnectionsInOrder' in moduleGraph &&\n typeof moduleGraph.getOutgoingConnectionsInOrder === 'function'\n ) {\n return moduleGraph.getOutgoingConnectionsInOrder(module)\n }\n const connections = []\n for (const connection of moduleGraph.getOutgoingConnections(module)) {\n if (connection.dependency && connection.module) {\n connections.push({\n connection,\n index: moduleGraph.getParentBlockIndex(connection.dependency),\n })\n }\n }\n connections.sort((a, b) => a.index - b.index)\n return connections.map((c) => c.connection)\n}\n\nexport function getCompilationSpan(\n compilation: Compiler | Compilation\n): Span | undefined {\n const compilationSpans = process.env.NEXT_RSPACK\n ? rspackCompilationSpans\n : webpackCompilationSpans\n\n return compilationSpans.get(compilation)\n}\n"],"names":["getAppLoader","spans","webpackCompilationSpans","compilationSpans","rspackCompilationSpans","traverseModules","compilation","callback","filterChunkGroup","chunkGroups","forEach","chunkGroup","chunks","chunk","chunkModules","chunkGraph","getChunkModulesIterable","mod","modId","getModuleId","toString","anyModule","modules","subMod","forEachEntryModule","name","entry","entries","startsWith","entryDependency","dependencies","request","entryModule","moduleGraph","getResolvedModule","dependency","modRequest","includes","formatBarrelOptimizedResource","resource","matchResource","getModuleReferencesInOrder","module","getOutgoingConnectionsInOrder","connections","connection","getOutgoingConnections","push","index","getParentBlockIndex","sort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AiBwD,GAAG,CAACrD;AAC9B"}
@@ -558,7 +558,6 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
558
558
  const transpilePackagesRegex = new RegExp(`[/\\\\]node_modules[/\\\\](${finalTranspilePackages == null ? void 0 : finalTranspilePackages.map((p)=>p.replace(/\//g, '[/\\\\]')).join('|')})[/\\\\]`);
559
559
  const handleExternals = makeExternalHandler({
560
560
  config,
561
- optOutBundlingPackages,
562
561
  optOutBundlingPackageRegex,
563
562
  transpiledPackages: finalTranspilePackages,
564
563
  dir
@@ -1460,7 +1459,6 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
1460
1459
  esmExternals: config.experimental.esmExternals,
1461
1460
  outputFileTracingRoot: config.outputFileTracingRoot,
1462
1461
  appDirEnabled: hasAppDir,
1463
- optOutBundlingPackages,
1464
1462
  traceIgnores: [],
1465
1463
  compilerType
1466
1464
  }),
@@ -1525,7 +1523,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
1525
1523
  isClient && new CopyFilePlugin({
1526
1524
  // file path to build output of `@next/polyfill-nomodule`
1527
1525
  filePath: require.resolve('./polyfills/polyfill-nomodule'),
1528
- cacheKey: "15.2.1-canary.1",
1526
+ cacheKey: "15.2.1-canary.2",
1529
1527
  name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
1530
1528
  minimize: false,
1531
1529
  info: {
@@ -1702,7 +1700,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
1702
1700
  // - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
1703
1701
  // - Next.js version
1704
1702
  // - next.config.js keys that affect compilation
1705
- version: `${__dirname}|${"15.2.1-canary.1"}|${configVars}`,
1703
+ version: `${__dirname}|${"15.2.1-canary.2"}|${configVars}`,
1706
1704
  cacheDirectory: path.join(distDir, 'cache', 'webpack'),
1707
1705
  // For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
1708
1706
  // So we disable compression here and allow the build runner to take care of compressing the cache as a whole.