next 15.3.0-canary.5 → 15.3.0-canary.8

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.
Files changed (135) hide show
  1. package/dist/bin/next +3 -2
  2. package/dist/bin/next.map +1 -1
  3. package/dist/build/collect-build-traces.js +1 -1
  4. package/dist/build/collect-build-traces.js.map +1 -1
  5. package/dist/build/create-compiler-aliases.js +9 -0
  6. package/dist/build/create-compiler-aliases.js.map +1 -1
  7. package/dist/build/index.d.ts +1 -1
  8. package/dist/build/index.js +24 -11
  9. package/dist/build/index.js.map +1 -1
  10. package/dist/build/swc/index.js +1 -1
  11. package/dist/build/webpack/plugins/define-env-plugin.js +1 -0
  12. package/dist/build/webpack/plugins/define-env-plugin.js.map +1 -1
  13. package/dist/build/webpack-config.js +4 -6
  14. package/dist/build/webpack-config.js.map +1 -1
  15. package/dist/cli/next-build.d.ts +1 -1
  16. package/dist/cli/next-build.js.map +1 -1
  17. package/dist/client/app-bootstrap.js +1 -1
  18. package/dist/client/app-index.js +1 -0
  19. package/dist/client/app-index.js.map +1 -1
  20. package/dist/client/app-next-dev.d.ts +1 -0
  21. package/dist/client/app-next-dev.js +1 -0
  22. package/dist/client/app-next-dev.js.map +1 -1
  23. package/dist/client/app-next-turbopack.d.ts +1 -1
  24. package/dist/client/app-next-turbopack.js +1 -0
  25. package/dist/client/app-next-turbopack.js.map +1 -1
  26. package/dist/client/app-next.d.ts +1 -0
  27. package/dist/client/app-next.js +1 -0
  28. package/dist/client/app-next.js.map +1 -1
  29. package/dist/client/components/react-dev-overlay/ui/components/code-frame/code-frame.d.ts +1 -1
  30. package/dist/client/components/react-dev-overlay/ui/components/code-frame/code-frame.js +30 -36
  31. package/dist/client/components/react-dev-overlay/ui/components/code-frame/code-frame.js.map +1 -1
  32. package/dist/client/components/react-dev-overlay/ui/components/code-frame/parse-code-frame.d.ts +8 -0
  33. package/dist/client/components/react-dev-overlay/ui/components/code-frame/parse-code-frame.js +90 -0
  34. package/dist/client/components/react-dev-overlay/ui/components/code-frame/parse-code-frame.js.map +1 -0
  35. package/dist/client/components/react-dev-overlay/ui/components/errors/dev-tools-indicator/dev-tools-info/user-preferences.js +2 -2
  36. package/dist/client/components/react-dev-overlay/ui/components/errors/dev-tools-indicator/dev-tools-info/user-preferences.js.map +1 -1
  37. package/dist/client/components/react-dev-overlay/ui/container/runtime-error/component-stack-pseudo-html.d.ts +1 -1
  38. package/dist/client/components/react-dev-overlay/ui/container/runtime-error/component-stack-pseudo-html.js +1 -1
  39. package/dist/client/components/react-dev-overlay/ui/container/runtime-error/component-stack-pseudo-html.js.map +1 -1
  40. package/dist/client/components/react-dev-overlay/ui/container/runtime-error/index.d.ts +1 -1
  41. package/dist/client/index.d.ts +1 -0
  42. package/dist/client/index.js +2 -1
  43. package/dist/client/index.js.map +1 -1
  44. package/dist/client/next-turbopack.d.ts +1 -1
  45. package/dist/client/next-turbopack.js +1 -1
  46. package/dist/client/next-turbopack.js.map +1 -1
  47. package/dist/client/next.d.ts +1 -0
  48. package/dist/client/next.js +1 -0
  49. package/dist/client/next.js.map +1 -1
  50. package/dist/client/page-bootstrap.d.ts +1 -0
  51. package/dist/client/page-bootstrap.js +1 -0
  52. package/dist/client/page-bootstrap.js.map +1 -1
  53. package/dist/compiled/next-server/app-page-experimental.runtime.dev.js +3 -3
  54. package/dist/compiled/next-server/app-page-experimental.runtime.dev.js.map +1 -1
  55. package/dist/compiled/next-server/app-page.runtime.dev.js +3 -3
  56. package/dist/compiled/next-server/app-page.runtime.dev.js.map +1 -1
  57. package/dist/compiled/next-server/server.runtime.prod.js +4 -4
  58. package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
  59. package/dist/esm/build/collect-build-traces.js +1 -1
  60. package/dist/esm/build/collect-build-traces.js.map +1 -1
  61. package/dist/esm/build/create-compiler-aliases.js +9 -0
  62. package/dist/esm/build/create-compiler-aliases.js.map +1 -1
  63. package/dist/esm/build/index.js +24 -11
  64. package/dist/esm/build/index.js.map +1 -1
  65. package/dist/esm/build/swc/index.js +1 -1
  66. package/dist/esm/build/webpack/plugins/define-env-plugin.js +1 -0
  67. package/dist/esm/build/webpack/plugins/define-env-plugin.js.map +1 -1
  68. package/dist/esm/build/webpack-config.js +5 -7
  69. package/dist/esm/build/webpack-config.js.map +1 -1
  70. package/dist/esm/client/app-bootstrap.js +1 -1
  71. package/dist/esm/client/app-index.js +1 -0
  72. package/dist/esm/client/app-index.js.map +1 -1
  73. package/dist/esm/client/app-next-dev.js +1 -0
  74. package/dist/esm/client/app-next-dev.js.map +1 -1
  75. package/dist/esm/client/app-next-turbopack.js +1 -0
  76. package/dist/esm/client/app-next-turbopack.js.map +1 -1
  77. package/dist/esm/client/app-next.js +1 -0
  78. package/dist/esm/client/app-next.js.map +1 -1
  79. package/dist/esm/client/components/react-dev-overlay/ui/components/code-frame/code-frame.js +30 -35
  80. package/dist/esm/client/components/react-dev-overlay/ui/components/code-frame/code-frame.js.map +1 -1
  81. package/dist/esm/client/components/react-dev-overlay/ui/components/code-frame/parse-code-frame.js +58 -0
  82. package/dist/esm/client/components/react-dev-overlay/ui/components/code-frame/parse-code-frame.js.map +1 -0
  83. package/dist/esm/client/components/react-dev-overlay/ui/components/errors/dev-tools-indicator/dev-tools-info/user-preferences.js +2 -2
  84. package/dist/esm/client/components/react-dev-overlay/ui/components/errors/dev-tools-indicator/dev-tools-info/user-preferences.js.map +1 -1
  85. package/dist/esm/client/components/react-dev-overlay/ui/container/runtime-error/component-stack-pseudo-html.js +1 -1
  86. package/dist/esm/client/components/react-dev-overlay/ui/container/runtime-error/component-stack-pseudo-html.js.map +1 -1
  87. package/dist/esm/client/index.js +2 -1
  88. package/dist/esm/client/index.js.map +1 -1
  89. package/dist/esm/client/next-turbopack.js +1 -0
  90. package/dist/esm/client/next-turbopack.js.map +1 -1
  91. package/dist/esm/client/next.js +1 -0
  92. package/dist/esm/client/next.js.map +1 -1
  93. package/dist/esm/client/page-bootstrap.js +1 -0
  94. package/dist/esm/client/page-bootstrap.js.map +1 -1
  95. package/dist/esm/lib/require-instrumentation-client.js +10 -0
  96. package/dist/esm/lib/require-instrumentation-client.js.map +1 -0
  97. package/dist/esm/server/base-server.js +2 -1
  98. package/dist/esm/server/base-server.js.map +1 -1
  99. package/dist/esm/server/config-schema.js +2 -2
  100. package/dist/esm/server/config-schema.js.map +1 -1
  101. package/dist/esm/server/config-shared.js +0 -1
  102. package/dist/esm/server/config-shared.js.map +1 -1
  103. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  104. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  105. package/dist/esm/server/lib/app-info-log.js +1 -1
  106. package/dist/esm/server/lib/decode-query-path-parameter.js +16 -0
  107. package/dist/esm/server/lib/decode-query-path-parameter.js.map +1 -0
  108. package/dist/esm/server/lib/start-server.js +1 -1
  109. package/dist/esm/server/typescript/index.js +7 -4
  110. package/dist/esm/server/typescript/index.js.map +1 -1
  111. package/dist/esm/shared/lib/canary-only.js +1 -1
  112. package/dist/lib/require-instrumentation-client.d.ts +6 -0
  113. package/dist/lib/require-instrumentation-client.js +11 -0
  114. package/dist/lib/require-instrumentation-client.js.map +1 -0
  115. package/dist/server/base-server.js +2 -1
  116. package/dist/server/base-server.js.map +1 -1
  117. package/dist/server/config-schema.js +2 -2
  118. package/dist/server/config-schema.js.map +1 -1
  119. package/dist/server/config-shared.d.ts +8 -1
  120. package/dist/server/config-shared.js +0 -1
  121. package/dist/server/config-shared.js.map +1 -1
  122. package/dist/server/dev/hot-reloader-turbopack.js +1 -1
  123. package/dist/server/dev/hot-reloader-webpack.js +1 -1
  124. package/dist/server/lib/app-info-log.js +1 -1
  125. package/dist/server/lib/decode-query-path-parameter.d.ts +7 -0
  126. package/dist/server/lib/decode-query-path-parameter.js +26 -0
  127. package/dist/server/lib/decode-query-path-parameter.js.map +1 -0
  128. package/dist/server/lib/start-server.js +1 -1
  129. package/dist/server/typescript/index.js +7 -4
  130. package/dist/server/typescript/index.js.map +1 -1
  131. package/dist/shared/lib/canary-only.js +1 -1
  132. package/dist/telemetry/anonymous-meta.js +1 -1
  133. package/dist/telemetry/events/session-stopped.js +2 -2
  134. package/dist/telemetry/events/version.js +2 -2
  135. package/package.json +15 -15
package/dist/bin/next CHANGED
@@ -79,10 +79,11 @@ const program = new NextRootCommand();
79
79
  program.name('next').description('The Next.js CLI allows you to develop, build, start your application, and more.').configureHelp({
80
80
  formatHelp: (cmd, helper)=>(0, _formatclihelpoutput.formatCliHelpOutput)(cmd, helper),
81
81
  subcommandTerm: (cmd)=>`${cmd.name()} ${cmd.usage()}`
82
- }).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.3.0-canary.5"}`, '-v, --version', 'Outputs the Next.js version.');
82
+ }).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.3.0-canary.8"}`, '-v, --version', 'Outputs the Next.js version.');
83
83
  program.command('build').description('Creates an optimized production build of your application. The output displays information about each route.').argument('[directory]', `A directory on which to build the application. ${(0, _picocolors.italic)('If no directory is provided, the current directory will be used.')}`).option('-d, --debug', 'Enables a more verbose build output.').option('--no-lint', 'Disables linting.').option('--no-mangling', 'Disables mangling.').option('--profile', 'Enables production profiling for React.').option('--experimental-app-only', 'Builds only App Router routes.').addOption(new _commander.Option('--experimental-turbo').hideHelp()).addOption(new _commander.Option('--experimental-build-mode [mode]', 'Uses an experimental build mode.').choices([
84
84
  'compile',
85
- 'generate'
85
+ 'generate',
86
+ 'generate-env'
86
87
  ]).default('default')).option('--experimental-debug-memory-usage', 'Enables memory profiling features to debug memory consumption.').option('--experimental-upload-trace, <traceUrl>', 'Reports a subset of the debugging trace to a remote HTTP URL. Includes sensitive data.').action((directory, options)=>// ensure process exits after build completes so open handles/connections
87
88
  // don't cause process to hang
88
89
  import('../cli/next-build.js').then((mod)=>mod.nextBuild(options, directory).then(()=>process.exit(0)))).usage('[directory] [options]');
package/dist/bin/next.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/bin/next.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport '../server/require-hook'\n\nimport { Argument, Command, Option } from 'next/dist/compiled/commander'\n\nimport { warn } from '../build/output/log'\nimport semver from 'next/dist/compiled/semver'\nimport { bold, cyan, italic } from '../lib/picocolors'\nimport { formatCliHelpOutput } from '../lib/format-cli-help-output'\nimport { NON_STANDARD_NODE_ENV } from '../lib/constants'\nimport { parseValidPositiveInteger } from '../server/lib/utils'\nimport {\n SUPPORTED_TEST_RUNNERS_LIST,\n type NextTestOptions,\n} from '../cli/next-test.js'\nimport type { NextTelemetryOptions } from '../cli/next-telemetry.js'\nimport type { NextStartOptions } from '../cli/next-start.js'\nimport type { NextLintOptions } from '../cli/next-lint.js'\nimport type { NextInfoOptions } from '../cli/next-info.js'\nimport type { NextDevOptions } from '../cli/next-dev.js'\nimport type { NextBuildOptions } from '../cli/next-build.js'\n\nif (process.env.NEXT_RSPACK) {\n // silent rspack's schema check\n process.env.RSPACK_CONFIG_VALIDATE = 'loose-silent'\n}\n\nif (\n !semver.satisfies(\n process.versions.node,\n process.env.__NEXT_REQUIRED_NODE_VERSION_RANGE!,\n { includePrerelease: true }\n )\n) {\n console.error(\n `You are using Node.js ${process.versions.node}. For Next.js, Node.js version \"${process.env.__NEXT_REQUIRED_NODE_VERSION_RANGE}\" is required.`\n )\n process.exit(1)\n}\n\n// Start performance profiling after Node.js version is checked\nperformance.mark('next-start')\n\nfor (const dependency of ['react', 'react-dom']) {\n try {\n // When 'npm link' is used it checks the clone location. Not the project.\n require.resolve(dependency)\n } catch (err) {\n console.warn(\n `The module '${dependency}' was not found. Next.js requires that you include it in 'dependencies' of your 'package.json'. To add it, run 'npm install ${dependency}'`\n )\n }\n}\n\nclass NextRootCommand extends Command {\n createCommand(name: string) {\n const command = new Command(name)\n\n command.addOption(new Option('--inspect').hideHelp())\n\n command.hook('preAction', (event) => {\n const commandName = event.name()\n const defaultEnv = commandName === 'dev' ? 'development' : 'production'\n const standardEnv = ['production', 'development', 'test']\n\n if (process.env.NODE_ENV) {\n const isNotStandard = !standardEnv.includes(process.env.NODE_ENV)\n const shouldWarnCommands =\n process.env.NODE_ENV === 'development'\n ? ['start', 'build']\n : process.env.NODE_ENV === 'production'\n ? ['dev']\n : []\n\n if (isNotStandard || shouldWarnCommands.includes(commandName)) {\n warn(NON_STANDARD_NODE_ENV)\n }\n }\n\n ;(process.env as any).NODE_ENV = process.env.NODE_ENV || defaultEnv\n ;(process.env as any).NEXT_RUNTIME = 'nodejs'\n\n if (event.getOptionValue('inspect') === true) {\n console.error(\n `\\`--inspect\\` flag is deprecated. Use env variable NODE_OPTIONS instead: NODE_OPTIONS='--inspect' next ${commandName}`\n )\n process.exit(1)\n }\n })\n\n return command\n }\n}\n\nconst program = new NextRootCommand()\n\nprogram\n .name('next')\n .description(\n 'The Next.js CLI allows you to develop, build, start your application, and more.'\n )\n .configureHelp({\n formatHelp: (cmd, helper) => formatCliHelpOutput(cmd, helper),\n subcommandTerm: (cmd) => `${cmd.name()} ${cmd.usage()}`,\n })\n .helpCommand(false)\n .helpOption('-h, --help', 'Displays this message.')\n .version(\n `Next.js v${process.env.__NEXT_VERSION}`,\n '-v, --version',\n 'Outputs the Next.js version.'\n )\n\nprogram\n .command('build')\n .description(\n 'Creates an optimized production build of your application. The output displays information about each route.'\n )\n .argument(\n '[directory]',\n `A directory on which to build the application. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .option('-d, --debug', 'Enables a more verbose build output.')\n\n .option('--no-lint', 'Disables linting.')\n .option('--no-mangling', 'Disables mangling.')\n .option('--profile', 'Enables production profiling for React.')\n .option('--experimental-app-only', 'Builds only App Router routes.')\n .addOption(new Option('--experimental-turbo').hideHelp())\n .addOption(\n new Option(\n '--experimental-build-mode [mode]',\n 'Uses an experimental build mode.'\n )\n .choices(['compile', 'generate'])\n .default('default')\n )\n .option(\n '--experimental-debug-memory-usage',\n 'Enables memory profiling features to debug memory consumption.'\n )\n .option(\n '--experimental-upload-trace, <traceUrl>',\n 'Reports a subset of the debugging trace to a remote HTTP URL. Includes sensitive data.'\n )\n .action((directory: string, options: NextBuildOptions) =>\n // ensure process exits after build completes so open handles/connections\n // don't cause process to hang\n import('../cli/next-build.js').then((mod) =>\n mod.nextBuild(options, directory).then(() => process.exit(0))\n )\n )\n .usage('[directory] [options]')\n\nprogram\n .command('dev', { isDefault: true })\n .description(\n 'Starts Next.js in development mode with hot-code reloading, error reporting, and more.'\n )\n .argument(\n '[directory]',\n `A directory on which to build the application. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .option('--turbo', 'Starts development mode using Turbopack.')\n .option('--turbopack', 'Starts development mode using Turbopack.')\n .addOption(\n new Option(\n '-p, --port <port>',\n 'Specify a port number on which to start the application.'\n )\n .argParser(parseValidPositiveInteger)\n .default(3000)\n .env('PORT')\n )\n .option(\n '-H, --hostname <hostname>',\n 'Specify a hostname on which to start the application (default: 0.0.0.0).'\n )\n .option(\n '--disable-source-maps',\n \"Don't start the Dev server with `--enable-source-maps`.\",\n false\n )\n .option(\n '--experimental-https',\n 'Starts the server with HTTPS and generates a self-signed certificate.'\n )\n .option('--experimental-https-key, <path>', 'Path to a HTTPS key file.')\n .option(\n '--experimental-https-cert, <path>',\n 'Path to a HTTPS certificate file.'\n )\n .option(\n '--experimental-https-ca, <path>',\n 'Path to a HTTPS certificate authority file.'\n )\n .option(\n '--experimental-upload-trace, <traceUrl>',\n 'Reports a subset of the debugging trace to a remote HTTP URL. Includes sensitive data.'\n )\n .action(\n (directory: string, options: NextDevOptions, { _optionValueSources }) => {\n const portSource = _optionValueSources.port\n import('../cli/next-dev.js').then((mod) =>\n mod.nextDev(options, portSource, directory)\n )\n }\n )\n .usage('[directory] [options]')\n\nprogram\n .command('export', { hidden: true })\n .action(() => import('../cli/next-export.js').then((mod) => mod.nextExport()))\n .helpOption(false)\n\nprogram\n .command('info')\n .description(\n 'Prints relevant details about the current system which can be used to report Next.js bugs.'\n )\n .addHelpText(\n 'after',\n `\\nLearn more: ${cyan('https://nextjs.org/docs/api-reference/cli#info')}`\n )\n .option('--verbose', 'Collects additional information for debugging.')\n .action((options: NextInfoOptions) =>\n import('../cli/next-info.js').then((mod) => mod.nextInfo(options))\n )\n\nprogram\n .command('lint')\n .description(\n 'Runs ESLint for all files in the `/src`, `/app`, `/pages`, `/components`, and `/lib` directories. It also provides a guided setup to install any required dependencies if ESLint is not already configured in your application.'\n )\n .argument(\n '[directory]',\n `A base directory on which to lint the application. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .option(\n '-d, --dir, <dirs...>',\n 'Include directory, or directories, to run ESLint.'\n )\n .option('--file, <files...>', 'Include file, or files, to run ESLint.')\n .addOption(\n new Option(\n '--ext, [exts...]',\n 'Specify JavaScript file extensions.'\n ).default(['.js', '.mjs', '.cjs', '.jsx', '.ts', '.mts', '.cts', '.tsx'])\n )\n .option(\n '-c, --config, <config>',\n 'Uses this configuration file, overriding all other configuration options.'\n )\n .option(\n '--resolve-plugins-relative-to, <rprt>',\n 'Specify a directory where plugins should be resolved from.'\n )\n .option(\n '--strict',\n 'Creates a `.eslintrc.json` file using the Next.js strict configuration.'\n )\n .option(\n '--rulesdir, <rulesdir...>',\n 'Uses additional rules from this directory(s).'\n )\n .option('--fix', 'Automatically fix linting issues.')\n .option(\n '--fix-type <fixType>',\n 'Specify the types of fixes to apply (e.g., problem, suggestion, layout).'\n )\n .option('--ignore-path <path>', 'Specify a file to ignore.')\n .option('--no-ignore', 'Disables the `--ignore-path` option.')\n .option('--quiet', 'Reports errors only.')\n .addOption(\n new Option(\n '--max-warnings [maxWarnings]',\n 'Specify the number of warnings before triggering a non-zero exit code.'\n )\n .argParser(parseValidPositiveInteger)\n .default(-1)\n )\n .option(\n '-o, --output-file, <outputFile>',\n 'Specify a file to write report to.'\n )\n .option('-f, --format, <format>', 'Uses a specific output format.')\n .option(\n '--no-inline-config',\n 'Prevents comments from changing config or rules.'\n )\n .addOption(\n new Option(\n '--report-unused-disable-directives-severity <level>',\n 'Specify severity level for unused eslint-disable directives.'\n ).choices(['error', 'off', 'warn'])\n )\n .option('--no-cache', 'Disables caching.')\n .option('--cache-location, <cacheLocation>', 'Specify a location for cache.')\n .addOption(\n new Option(\n '--cache-strategy, [cacheStrategy]',\n 'Specify a strategy to use for detecting changed files in the cache.'\n ).default('metadata')\n )\n .option(\n '--error-on-unmatched-pattern',\n 'Reports errors when any file patterns are unmatched.'\n )\n .action((directory: string, options: NextLintOptions) =>\n import('../cli/next-lint.js').then((mod) =>\n mod.nextLint(options, directory)\n )\n )\n .usage('[directory] [options]')\n\nprogram\n .command('start')\n .description(\n 'Starts Next.js in production mode. The application should be compiled with `next build` first.'\n )\n .argument(\n '[directory]',\n `A directory on which to start the application. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .addOption(\n new Option(\n '-p, --port <port>',\n 'Specify a port number on which to start the application.'\n )\n .argParser(parseValidPositiveInteger)\n .default(3000)\n .env('PORT')\n )\n .option(\n '-H, --hostname <hostname>',\n 'Specify a hostname on which to start the application (default: 0.0.0.0).'\n )\n .addOption(\n new Option(\n '--keepAliveTimeout <keepAliveTimeout>',\n 'Specify the maximum amount of milliseconds to wait before closing inactive connections.'\n ).argParser(parseValidPositiveInteger)\n )\n .action((directory: string, options: NextStartOptions) =>\n import('../cli/next-start.js').then((mod) =>\n mod.nextStart(options, directory)\n )\n )\n .usage('[directory] [options]')\n\nprogram\n .command('telemetry')\n .description(\n `Allows you to enable or disable Next.js' ${bold(\n 'completely anonymous'\n )} telemetry collection.`\n )\n .addArgument(new Argument('[arg]').choices(['disable', 'enable', 'status']))\n .addHelpText('after', `\\nLearn more: ${cyan('https://nextjs.org/telemetry')}`)\n .addOption(\n new Option('--enable', `Enables Next.js' telemetry collection.`).conflicts(\n 'disable'\n )\n )\n .option('--disable', `Disables Next.js' telemetry collection.`)\n .action((arg: string, options: NextTelemetryOptions) =>\n import('../cli/next-telemetry.js').then((mod) =>\n mod.nextTelemetry(options, arg)\n )\n )\n\nprogram\n .command('experimental-test')\n .description(\n `Execute \\`next/experimental/testmode\\` tests using a specified test runner. The test runner defaults to 'playwright' if the \\`experimental.defaultTestRunner\\` configuration option or the \\`--test-runner\\` option are not set.`\n )\n .argument(\n '[directory]',\n `A Next.js project directory to execute the test runner on. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .argument(\n '[test-runner-args...]',\n 'Any additional arguments or options to pass down to the test runner `test` command.'\n )\n .option(\n '--test-runner [test-runner]',\n `Any supported test runner. Options: ${bold(\n SUPPORTED_TEST_RUNNERS_LIST.join(', ')\n )}. ${italic(\n \"If no test runner is provided, the Next.js config option `experimental.defaultTestRunner`, or 'playwright' will be used.\"\n )}`\n )\n .allowUnknownOption()\n .action(\n (directory: string, testRunnerArgs: string[], options: NextTestOptions) => {\n return import('../cli/next-test.js').then((mod) => {\n mod.nextTest(directory, testRunnerArgs, options)\n })\n }\n )\n .usage('[directory] [options]')\n\nconst internal = program\n .command('internal')\n .description(\n 'Internal debugging commands. Use with caution. Not covered by semver.'\n )\n\ninternal\n .command('turbo-trace-server')\n .argument('[file]', 'Trace file to serve.')\n .action((file: string) => {\n return import('../cli/internal/turbo-trace-server.js').then((mod) =>\n mod.startTurboTraceServerCli(file)\n )\n })\n\nprogram.parse(process.argv)\n"],"names":["process","env","NEXT_RSPACK","RSPACK_CONFIG_VALIDATE","semver","satisfies","versions","node","__NEXT_REQUIRED_NODE_VERSION_RANGE","includePrerelease","console","error","exit","performance","mark","dependency","require","resolve","err","warn","NextRootCommand","Command","createCommand","name","command","addOption","Option","hideHelp","hook","event","commandName","defaultEnv","standardEnv","NODE_ENV","isNotStandard","includes","shouldWarnCommands","NON_STANDARD_NODE_ENV","NEXT_RUNTIME","getOptionValue","program","description","configureHelp","formatHelp","cmd","helper","formatCliHelpOutput","subcommandTerm","usage","helpCommand","helpOption","version","__NEXT_VERSION","argument","italic","option","choices","default","action","directory","options","then","mod","nextBuild","isDefault","argParser","parseValidPositiveInteger","_optionValueSources","portSource","port","nextDev","hidden","nextExport","addHelpText","cyan","nextInfo","nextLint","nextStart","bold","addArgument","Argument","conflicts","arg","nextTelemetry","SUPPORTED_TEST_RUNNERS_LIST","join","allowUnknownOption","testRunnerArgs","nextTest","internal","file","startTurboTraceServerCli","parse","argv"],"mappings":";;;;;QAEO;2BAEmC;qBAErB;+DACF;4BACgB;qCACC;2BACE;uBACI;0BAInC;;;;;;AAQP,IAAIA,QAAQC,GAAG,CAACC,WAAW,EAAE;IAC3B,+BAA+B;IAC/BF,QAAQC,GAAG,CAACE,sBAAsB,GAAG;AACvC;AAEA,IACE,CAACC,eAAM,CAACC,SAAS,CACfL,QAAQM,QAAQ,CAACC,IAAI,EACrBP,QAAQC,GAAG,CAACO,kCAAkC,EAC9C;IAAEC,mBAAmB;AAAK,IAE5B;IACAC,QAAQC,KAAK,CACX,CAAC,sBAAsB,EAAEX,QAAQM,QAAQ,CAACC,IAAI,CAAC,gCAAgC,EAAEP,QAAQC,GAAG,CAACO,kCAAkC,CAAC,cAAc,CAAC;IAEjJR,QAAQY,IAAI,CAAC;AACf;AAEA,+DAA+D;AAC/DC,YAAYC,IAAI,CAAC;AAEjB,KAAK,MAAMC,cAAc;IAAC;IAAS;CAAY,CAAE;IAC/C,IAAI;QACF,yEAAyE;QACzEC,QAAQC,OAAO,CAACF;IAClB,EAAE,OAAOG,KAAK;QACZR,QAAQS,IAAI,CACV,CAAC,YAAY,EAAEJ,WAAW,4HAA4H,EAAEA,WAAW,CAAC,CAAC;IAEzK;AACF;AAEA,MAAMK,wBAAwBC,kBAAO;IACnCC,cAAcC,IAAY,EAAE;QAC1B,MAAMC,UAAU,IAAIH,kBAAO,CAACE;QAE5BC,QAAQC,SAAS,CAAC,IAAIC,iBAAM,CAAC,aAAaC,QAAQ;QAElDH,QAAQI,IAAI,CAAC,aAAa,CAACC;YACzB,MAAMC,cAAcD,MAAMN,IAAI;YAC9B,MAAMQ,aAAaD,gBAAgB,QAAQ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AAC,CAACC,MACvCA,IAAIqB,aAAa,CAACvB,SAASsB;AAIjC1C,QACGhB,OAAO,CAAC,qBACRiB,WAAW,CACV,CAAC,gOAAgO,CAAC,EAEnOY,QAAQ,CACP,eACA,CAAC,2DAA2D,EAAEC,IAAAA,kBAAM,EAClE,qEACC,EAEJD,QAAQ,CACP,yBACA,uFAEDE,MAAM,CACL,+BACA,CAAC,oCAAoC,EAAEuB,IAAAA,gBAAI,EACzCM,qCAA2B,CAACC,IAAI,CAAC,OACjC,EAAE,EAAE/B,IAAAA,kBAAM,EACV,6HACC,EAEJgC,kBAAkB,GAClB5B,MAAM,CACL,CAACC,WAAmB4B,gBAA0B3B;IAC5C,OAAO,MAAM,CAAC,uBAAuBC,IAAI,CAAC,CAACC;QACzCA,IAAI0B,QAAQ,CAAC7B,WAAW4B,gBAAgB3B;IAC1C;AACF,GAEDZ,KAAK,CAAC;AAET,MAAMyC,WAAWjD,QACdhB,OAAO,CAAC,YACRiB,WAAW,CACV;AAGJgD,SACGjE,OAAO,CAAC,sBACR6B,QAAQ,CAAC,UAAU,wBACnBK,MAAM,CAAC,CAACgC;IACP,OAAO,MAAM,CAAC,yCAAyC7B,IAAI,CAAC,CAACC,MAC3DA,IAAI6B,wBAAwB,CAACD;AAEjC;AAEFlD,QAAQoD,KAAK,CAAC5F,QAAQ6F,IAAI"}
1
+ {"version":3,"sources":["../../src/bin/next.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport '../server/require-hook'\n\nimport { Argument, Command, Option } from 'next/dist/compiled/commander'\n\nimport { warn } from '../build/output/log'\nimport semver from 'next/dist/compiled/semver'\nimport { bold, cyan, italic } from '../lib/picocolors'\nimport { formatCliHelpOutput } from '../lib/format-cli-help-output'\nimport { NON_STANDARD_NODE_ENV } from '../lib/constants'\nimport { parseValidPositiveInteger } from '../server/lib/utils'\nimport {\n SUPPORTED_TEST_RUNNERS_LIST,\n type NextTestOptions,\n} from '../cli/next-test.js'\nimport type { NextTelemetryOptions } from '../cli/next-telemetry.js'\nimport type { NextStartOptions } from '../cli/next-start.js'\nimport type { NextLintOptions } from '../cli/next-lint.js'\nimport type { NextInfoOptions } from '../cli/next-info.js'\nimport type { NextDevOptions } from '../cli/next-dev.js'\nimport type { NextBuildOptions } from '../cli/next-build.js'\n\nif (process.env.NEXT_RSPACK) {\n // silent rspack's schema check\n process.env.RSPACK_CONFIG_VALIDATE = 'loose-silent'\n}\n\nif (\n !semver.satisfies(\n process.versions.node,\n process.env.__NEXT_REQUIRED_NODE_VERSION_RANGE!,\n { includePrerelease: true }\n )\n) {\n console.error(\n `You are using Node.js ${process.versions.node}. For Next.js, Node.js version \"${process.env.__NEXT_REQUIRED_NODE_VERSION_RANGE}\" is required.`\n )\n process.exit(1)\n}\n\n// Start performance profiling after Node.js version is checked\nperformance.mark('next-start')\n\nfor (const dependency of ['react', 'react-dom']) {\n try {\n // When 'npm link' is used it checks the clone location. Not the project.\n require.resolve(dependency)\n } catch (err) {\n console.warn(\n `The module '${dependency}' was not found. Next.js requires that you include it in 'dependencies' of your 'package.json'. To add it, run 'npm install ${dependency}'`\n )\n }\n}\n\nclass NextRootCommand extends Command {\n createCommand(name: string) {\n const command = new Command(name)\n\n command.addOption(new Option('--inspect').hideHelp())\n\n command.hook('preAction', (event) => {\n const commandName = event.name()\n const defaultEnv = commandName === 'dev' ? 'development' : 'production'\n const standardEnv = ['production', 'development', 'test']\n\n if (process.env.NODE_ENV) {\n const isNotStandard = !standardEnv.includes(process.env.NODE_ENV)\n const shouldWarnCommands =\n process.env.NODE_ENV === 'development'\n ? ['start', 'build']\n : process.env.NODE_ENV === 'production'\n ? ['dev']\n : []\n\n if (isNotStandard || shouldWarnCommands.includes(commandName)) {\n warn(NON_STANDARD_NODE_ENV)\n }\n }\n\n ;(process.env as any).NODE_ENV = process.env.NODE_ENV || defaultEnv\n ;(process.env as any).NEXT_RUNTIME = 'nodejs'\n\n if (event.getOptionValue('inspect') === true) {\n console.error(\n `\\`--inspect\\` flag is deprecated. Use env variable NODE_OPTIONS instead: NODE_OPTIONS='--inspect' next ${commandName}`\n )\n process.exit(1)\n }\n })\n\n return command\n }\n}\n\nconst program = new NextRootCommand()\n\nprogram\n .name('next')\n .description(\n 'The Next.js CLI allows you to develop, build, start your application, and more.'\n )\n .configureHelp({\n formatHelp: (cmd, helper) => formatCliHelpOutput(cmd, helper),\n subcommandTerm: (cmd) => `${cmd.name()} ${cmd.usage()}`,\n })\n .helpCommand(false)\n .helpOption('-h, --help', 'Displays this message.')\n .version(\n `Next.js v${process.env.__NEXT_VERSION}`,\n '-v, --version',\n 'Outputs the Next.js version.'\n )\n\nprogram\n .command('build')\n .description(\n 'Creates an optimized production build of your application. The output displays information about each route.'\n )\n .argument(\n '[directory]',\n `A directory on which to build the application. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .option('-d, --debug', 'Enables a more verbose build output.')\n\n .option('--no-lint', 'Disables linting.')\n .option('--no-mangling', 'Disables mangling.')\n .option('--profile', 'Enables production profiling for React.')\n .option('--experimental-app-only', 'Builds only App Router routes.')\n .addOption(new Option('--experimental-turbo').hideHelp())\n .addOption(\n new Option(\n '--experimental-build-mode [mode]',\n 'Uses an experimental build mode.'\n )\n .choices(['compile', 'generate', 'generate-env'])\n .default('default')\n )\n .option(\n '--experimental-debug-memory-usage',\n 'Enables memory profiling features to debug memory consumption.'\n )\n .option(\n '--experimental-upload-trace, <traceUrl>',\n 'Reports a subset of the debugging trace to a remote HTTP URL. Includes sensitive data.'\n )\n .action((directory: string, options: NextBuildOptions) =>\n // ensure process exits after build completes so open handles/connections\n // don't cause process to hang\n import('../cli/next-build.js').then((mod) =>\n mod.nextBuild(options, directory).then(() => process.exit(0))\n )\n )\n .usage('[directory] [options]')\n\nprogram\n .command('dev', { isDefault: true })\n .description(\n 'Starts Next.js in development mode with hot-code reloading, error reporting, and more.'\n )\n .argument(\n '[directory]',\n `A directory on which to build the application. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .option('--turbo', 'Starts development mode using Turbopack.')\n .option('--turbopack', 'Starts development mode using Turbopack.')\n .addOption(\n new Option(\n '-p, --port <port>',\n 'Specify a port number on which to start the application.'\n )\n .argParser(parseValidPositiveInteger)\n .default(3000)\n .env('PORT')\n )\n .option(\n '-H, --hostname <hostname>',\n 'Specify a hostname on which to start the application (default: 0.0.0.0).'\n )\n .option(\n '--disable-source-maps',\n \"Don't start the Dev server with `--enable-source-maps`.\",\n false\n )\n .option(\n '--experimental-https',\n 'Starts the server with HTTPS and generates a self-signed certificate.'\n )\n .option('--experimental-https-key, <path>', 'Path to a HTTPS key file.')\n .option(\n '--experimental-https-cert, <path>',\n 'Path to a HTTPS certificate file.'\n )\n .option(\n '--experimental-https-ca, <path>',\n 'Path to a HTTPS certificate authority file.'\n )\n .option(\n '--experimental-upload-trace, <traceUrl>',\n 'Reports a subset of the debugging trace to a remote HTTP URL. Includes sensitive data.'\n )\n .action(\n (directory: string, options: NextDevOptions, { _optionValueSources }) => {\n const portSource = _optionValueSources.port\n import('../cli/next-dev.js').then((mod) =>\n mod.nextDev(options, portSource, directory)\n )\n }\n )\n .usage('[directory] [options]')\n\nprogram\n .command('export', { hidden: true })\n .action(() => import('../cli/next-export.js').then((mod) => mod.nextExport()))\n .helpOption(false)\n\nprogram\n .command('info')\n .description(\n 'Prints relevant details about the current system which can be used to report Next.js bugs.'\n )\n .addHelpText(\n 'after',\n `\\nLearn more: ${cyan('https://nextjs.org/docs/api-reference/cli#info')}`\n )\n .option('--verbose', 'Collects additional information for debugging.')\n .action((options: NextInfoOptions) =>\n import('../cli/next-info.js').then((mod) => mod.nextInfo(options))\n )\n\nprogram\n .command('lint')\n .description(\n 'Runs ESLint for all files in the `/src`, `/app`, `/pages`, `/components`, and `/lib` directories. It also provides a guided setup to install any required dependencies if ESLint is not already configured in your application.'\n )\n .argument(\n '[directory]',\n `A base directory on which to lint the application. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .option(\n '-d, --dir, <dirs...>',\n 'Include directory, or directories, to run ESLint.'\n )\n .option('--file, <files...>', 'Include file, or files, to run ESLint.')\n .addOption(\n new Option(\n '--ext, [exts...]',\n 'Specify JavaScript file extensions.'\n ).default(['.js', '.mjs', '.cjs', '.jsx', '.ts', '.mts', '.cts', '.tsx'])\n )\n .option(\n '-c, --config, <config>',\n 'Uses this configuration file, overriding all other configuration options.'\n )\n .option(\n '--resolve-plugins-relative-to, <rprt>',\n 'Specify a directory where plugins should be resolved from.'\n )\n .option(\n '--strict',\n 'Creates a `.eslintrc.json` file using the Next.js strict configuration.'\n )\n .option(\n '--rulesdir, <rulesdir...>',\n 'Uses additional rules from this directory(s).'\n )\n .option('--fix', 'Automatically fix linting issues.')\n .option(\n '--fix-type <fixType>',\n 'Specify the types of fixes to apply (e.g., problem, suggestion, layout).'\n )\n .option('--ignore-path <path>', 'Specify a file to ignore.')\n .option('--no-ignore', 'Disables the `--ignore-path` option.')\n .option('--quiet', 'Reports errors only.')\n .addOption(\n new Option(\n '--max-warnings [maxWarnings]',\n 'Specify the number of warnings before triggering a non-zero exit code.'\n )\n .argParser(parseValidPositiveInteger)\n .default(-1)\n )\n .option(\n '-o, --output-file, <outputFile>',\n 'Specify a file to write report to.'\n )\n .option('-f, --format, <format>', 'Uses a specific output format.')\n .option(\n '--no-inline-config',\n 'Prevents comments from changing config or rules.'\n )\n .addOption(\n new Option(\n '--report-unused-disable-directives-severity <level>',\n 'Specify severity level for unused eslint-disable directives.'\n ).choices(['error', 'off', 'warn'])\n )\n .option('--no-cache', 'Disables caching.')\n .option('--cache-location, <cacheLocation>', 'Specify a location for cache.')\n .addOption(\n new Option(\n '--cache-strategy, [cacheStrategy]',\n 'Specify a strategy to use for detecting changed files in the cache.'\n ).default('metadata')\n )\n .option(\n '--error-on-unmatched-pattern',\n 'Reports errors when any file patterns are unmatched.'\n )\n .action((directory: string, options: NextLintOptions) =>\n import('../cli/next-lint.js').then((mod) =>\n mod.nextLint(options, directory)\n )\n )\n .usage('[directory] [options]')\n\nprogram\n .command('start')\n .description(\n 'Starts Next.js in production mode. The application should be compiled with `next build` first.'\n )\n .argument(\n '[directory]',\n `A directory on which to start the application. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .addOption(\n new Option(\n '-p, --port <port>',\n 'Specify a port number on which to start the application.'\n )\n .argParser(parseValidPositiveInteger)\n .default(3000)\n .env('PORT')\n )\n .option(\n '-H, --hostname <hostname>',\n 'Specify a hostname on which to start the application (default: 0.0.0.0).'\n )\n .addOption(\n new Option(\n '--keepAliveTimeout <keepAliveTimeout>',\n 'Specify the maximum amount of milliseconds to wait before closing inactive connections.'\n ).argParser(parseValidPositiveInteger)\n )\n .action((directory: string, options: NextStartOptions) =>\n import('../cli/next-start.js').then((mod) =>\n mod.nextStart(options, directory)\n )\n )\n .usage('[directory] [options]')\n\nprogram\n .command('telemetry')\n .description(\n `Allows you to enable or disable Next.js' ${bold(\n 'completely anonymous'\n )} telemetry collection.`\n )\n .addArgument(new Argument('[arg]').choices(['disable', 'enable', 'status']))\n .addHelpText('after', `\\nLearn more: ${cyan('https://nextjs.org/telemetry')}`)\n .addOption(\n new Option('--enable', `Enables Next.js' telemetry collection.`).conflicts(\n 'disable'\n )\n )\n .option('--disable', `Disables Next.js' telemetry collection.`)\n .action((arg: string, options: NextTelemetryOptions) =>\n import('../cli/next-telemetry.js').then((mod) =>\n mod.nextTelemetry(options, arg)\n )\n )\n\nprogram\n .command('experimental-test')\n .description(\n `Execute \\`next/experimental/testmode\\` tests using a specified test runner. The test runner defaults to 'playwright' if the \\`experimental.defaultTestRunner\\` configuration option or the \\`--test-runner\\` option are not set.`\n )\n .argument(\n '[directory]',\n `A Next.js project directory to execute the test runner on. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .argument(\n '[test-runner-args...]',\n 'Any additional arguments or options to pass down to the test runner `test` command.'\n )\n .option(\n '--test-runner [test-runner]',\n `Any supported test runner. Options: ${bold(\n SUPPORTED_TEST_RUNNERS_LIST.join(', ')\n )}. ${italic(\n \"If no test runner is provided, the Next.js config option `experimental.defaultTestRunner`, or 'playwright' will be used.\"\n )}`\n )\n .allowUnknownOption()\n .action(\n (directory: string, testRunnerArgs: string[], options: NextTestOptions) => {\n return import('../cli/next-test.js').then((mod) => {\n mod.nextTest(directory, testRunnerArgs, options)\n })\n }\n )\n .usage('[directory] [options]')\n\nconst internal = program\n .command('internal')\n .description(\n 'Internal debugging commands. Use with caution. Not covered by semver.'\n )\n\ninternal\n .command('turbo-trace-server')\n .argument('[file]', 'Trace file to serve.')\n .action((file: string) => {\n return import('../cli/internal/turbo-trace-server.js').then((mod) =>\n mod.startTurboTraceServerCli(file)\n )\n })\n\nprogram.parse(process.argv)\n"],"names":["process","env","NEXT_RSPACK","RSPACK_CONFIG_VALIDATE","semver","satisfies","versions","node","__NEXT_REQUIRED_NODE_VERSION_RANGE","includePrerelease","console","error","exit","performance","mark","dependency","require","resolve","err","warn","NextRootCommand","Command","createCommand","name","command","addOption","Option","hideHelp","hook","event","commandName","defaultEnv","standardEnv","NODE_ENV","isNotStandard","includes","shouldWarnCommands","NON_STANDARD_NODE_ENV","NEXT_RUNTIME","getOptionValue","program","description","configureHelp","formatHelp","cmd","helper","formatCliHelpOutput","subcommandTerm","usage","helpCommand","helpOption","version","__NEXT_VERSION","argument","italic","option","choices","default","action","directory","options","then","mod","nextBuild","isDefault","argParser","parseValidPositiveInteger","_optionValueSources","portSource","port","nextDev","hidden","nextExport","addHelpText","cyan","nextInfo","nextLint","nextStart","bold","addArgument","Argument","conflicts","arg","nextTelemetry","SUPPORTED_TEST_RUNNERS_LIST","join","allowUnknownOption","testRunnerArgs","nextTest","internal","file","startTurboTraceServerCli","parse","argv"],"mappings":";;;;;QAEO;2BAEmC;qBAErB;+DACF;4BACgB;qCACC;2BACE;uBACI;0BAInC;;;;;;AAQP,IAAIA,QAAQC,GAAG,CAACC,WAAW,EAAE;IAC3B,+BAA+B;IAC/BF,QAAQC,GAAG,CAACE,sBAAsB,GAA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B,GAClB5B,MAAM,CACL,CAACC,WAAmB4B,gBAA0B3B;IAC5C,OAAO,MAAM,CAAC,uBAAuBC,IAAI,CAAC,CAACC;QACzCA,IAAI0B,QAAQ,CAAC7B,WAAW4B,gBAAgB3B;IAC1C;AACF,GAEDZ,KAAK,CAAC;AAET,MAAMyC,WAAWjD,QACdhB,OAAO,CAAC,YACRiB,WAAW,CACV;AAGJgD,SACGjE,OAAO,CAAC,sBACR6B,QAAQ,CAAC,UAAU,wBACnBK,MAAM,CAAC,CAACgC;IACP,OAAO,MAAM,CAAC,yCAAyC7B,IAAI,CAAC,CAACC,MAC3DA,IAAI6B,wBAAwB,CAACD;AAEjC;AAEFlD,QAAQoD,KAAK,CAAC5F,QAAQ6F,IAAI"}
@@ -172,7 +172,7 @@ async function collectBuildTraces({ dir, config, distDir, edgeRuntimeRoutes, sta
172
172
  ...isStandalone ? [] : [
173
173
  '**/next/dist/compiled/jest-worker/**/*'
174
174
  ],
175
- '**/next/dist/compiled/webpack/(bundle4|bundle5).js',
175
+ '**/next/dist/compiled/webpack/*',
176
176
  '**/node_modules/webpack5/**/*',
177
177
  '**/next/dist/server/lib/route-resolver*',
178
178
  'next/dist/compiled/semver/semver/**/*.js',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/build/collect-build-traces.ts"],"sourcesContent":["import { Span } from '../trace'\nimport type { NextConfigComplete } from '../server/config-shared'\n\nimport {\n TRACE_IGNORES,\n type BuildTraceContext,\n getFilesMapFromReasons,\n} from './webpack/plugins/next-trace-entrypoints-plugin'\n\nimport path from 'path'\nimport fs from 'fs/promises'\nimport { nonNullable } from '../lib/non-nullable'\nimport * as ciEnvironment from '../server/ci-info'\nimport debugOriginal from 'next/dist/compiled/debug'\nimport picomatch from 'next/dist/compiled/picomatch'\nimport { defaultOverrides } from '../server/require-hook'\nimport { nodeFileTrace } from 'next/dist/compiled/@vercel/nft'\nimport { normalizePagePath } from '../shared/lib/page-path/normalize-page-path'\nimport { normalizeAppPath } from '../shared/lib/router/utils/app-paths'\nimport isError from '../lib/is-error'\nimport type { NodeFileTraceReasons } from '@vercel/nft'\nimport type { RoutesUsingEdgeRuntime } from './utils'\n\nconst debug = debugOriginal('next:build:build-traces')\n\nfunction shouldIgnore(\n file: string,\n serverIgnoreFn: (file: string) => boolean,\n reasons: NodeFileTraceReasons,\n cachedIgnoreFiles: Map<string, boolean>,\n children: Set<string> = new Set()\n) {\n if (cachedIgnoreFiles.has(file)) {\n return cachedIgnoreFiles.get(file)\n }\n\n if (serverIgnoreFn(file)) {\n cachedIgnoreFiles.set(file, true)\n return true\n }\n children.add(file)\n\n const reason = reasons.get(file)\n if (!reason || reason.parents.size === 0 || reason.type.includes('initial')) {\n cachedIgnoreFiles.set(file, false)\n return false\n }\n\n // if all parents are ignored the child file\n // should be ignored as well\n let allParentsIgnored = true\n\n for (const parent of reason.parents.values()) {\n if (!children.has(parent)) {\n children.add(parent)\n if (\n !shouldIgnore(\n parent,\n serverIgnoreFn,\n reasons,\n cachedIgnoreFiles,\n children\n )\n ) {\n allParentsIgnored = false\n break\n }\n }\n }\n\n cachedIgnoreFiles.set(file, allParentsIgnored)\n return allParentsIgnored\n}\n\nexport async function collectBuildTraces({\n dir,\n config,\n distDir,\n edgeRuntimeRoutes,\n staticPages,\n nextBuildSpan = new Span({ name: 'build' }),\n hasSsrAmpPages,\n buildTraceContext,\n outputFileTracingRoot,\n}: {\n dir: string\n distDir: string\n staticPages: string[]\n hasSsrAmpPages: boolean\n outputFileTracingRoot: string\n // pageInfos is serialized when this function runs in a worker.\n edgeRuntimeRoutes: RoutesUsingEdgeRuntime\n nextBuildSpan?: Span\n config: NextConfigComplete\n buildTraceContext?: BuildTraceContext\n}) {\n const startTime = Date.now()\n debug('starting build traces')\n\n const { outputFileTracingIncludes = {}, outputFileTracingExcludes = {} } =\n config\n const excludeGlobKeys = Object.keys(outputFileTracingExcludes)\n const includeGlobKeys = Object.keys(outputFileTracingIncludes)\n\n await nextBuildSpan\n .traceChild('node-file-trace-build', {\n isTurbotrace: 'false', // TODO(arlyon): remove this\n })\n .traceAsyncFn(async () => {\n const nextServerTraceOutput = path.join(\n distDir,\n 'next-server.js.nft.json'\n )\n const nextMinimalTraceOutput = path.join(\n distDir,\n 'next-minimal-server.js.nft.json'\n )\n const root = outputFileTracingRoot\n\n // Under standalone mode, we need to trace the extra IPC server and\n // worker files.\n const isStandalone = config.output === 'standalone'\n const sharedEntriesSet = Object.keys(defaultOverrides).map((value) =>\n require.resolve(value, {\n paths: [require.resolve('next/dist/server/require-hook')],\n })\n )\n\n const { cacheHandler } = config\n const { cacheHandlers } = config.experimental\n\n // ensure we trace any dependencies needed for custom\n // incremental cache handler\n if (cacheHandler) {\n sharedEntriesSet.push(\n require.resolve(\n path.isAbsolute(cacheHandler)\n ? cacheHandler\n : path.join(dir, cacheHandler)\n )\n )\n }\n\n if (cacheHandlers) {\n for (const handlerPath of Object.values(cacheHandlers)) {\n if (handlerPath) {\n sharedEntriesSet.push(\n require.resolve(\n path.isAbsolute(handlerPath)\n ? handlerPath\n : path.join(dir, handlerPath)\n )\n )\n }\n }\n }\n\n const serverEntries = [\n ...sharedEntriesSet,\n ...(isStandalone\n ? [\n require.resolve('next/dist/server/lib/start-server'),\n require.resolve('next/dist/server/next'),\n require.resolve('next/dist/server/require-hook'),\n ]\n : []),\n require.resolve('next/dist/server/next-server'),\n ].filter(Boolean) as string[]\n\n const minimalServerEntries = [\n ...sharedEntriesSet,\n require.resolve('next/dist/compiled/next-server/server.runtime.prod'),\n ].filter(Boolean)\n\n const additionalIgnores = new Set<string>()\n\n for (const glob of excludeGlobKeys) {\n if (picomatch(glob)('next-server')) {\n outputFileTracingExcludes[glob].forEach((exclude) => {\n additionalIgnores.add(exclude)\n })\n }\n }\n\n const makeIgnoreFn = (ignores: string[]) => {\n // pre compile the ignore globs\n const isMatch = picomatch(ignores, {\n contains: true,\n dot: true,\n })\n\n return (pathname: string) => {\n if (path.isAbsolute(pathname) && !pathname.startsWith(root)) {\n return true\n }\n\n return isMatch(pathname)\n }\n }\n\n const sharedIgnores = [\n '**/next/dist/compiled/next-server/**/*.dev.js',\n ...(isStandalone ? [] : ['**/next/dist/compiled/jest-worker/**/*']),\n '**/next/dist/compiled/webpack/(bundle4|bundle5).js',\n '**/node_modules/webpack5/**/*',\n '**/next/dist/server/lib/route-resolver*',\n 'next/dist/compiled/semver/semver/**/*.js',\n\n ...(ciEnvironment.hasNextSupport\n ? [\n // only ignore image-optimizer code when\n // this is being handled outside of next-server\n '**/next/dist/server/image-optimizer.js',\n ]\n : []),\n\n ...(!hasSsrAmpPages\n ? ['**/next/dist/compiled/@ampproject/toolbox-optimizer/**/*']\n : []),\n\n ...(isStandalone ? [] : TRACE_IGNORES),\n ...additionalIgnores,\n ]\n\n const sharedIgnoresFn = makeIgnoreFn(sharedIgnores)\n\n const serverIgnores = [\n ...sharedIgnores,\n '**/node_modules/react{,-dom,-dom-server-turbopack}/**/*.development.js',\n '**/*.d.ts',\n '**/*.map',\n '**/next/dist/pages/**/*',\n ...(ciEnvironment.hasNextSupport\n ? ['**/node_modules/sharp/**/*', '**/@img/sharp-libvips*/**/*']\n : []),\n ].filter(nonNullable)\n const serverIgnoreFn = makeIgnoreFn(serverIgnores)\n\n const minimalServerIgnores = [\n ...serverIgnores,\n '**/next/dist/compiled/edge-runtime/**/*',\n '**/next/dist/server/web/sandbox/**/*',\n '**/next/dist/server/post-process.js',\n ]\n const minimalServerIgnoreFn = makeIgnoreFn(minimalServerIgnores)\n\n const routesIgnores = [\n ...sharedIgnores,\n // server chunks are provided via next-trace-entrypoints-plugin plugin\n // as otherwise all chunks are traced here and included for all pages\n // whether they are needed or not\n '**/.next/server/chunks/**',\n '**/next/dist/server/optimize-amp.js',\n '**/next/dist/server/post-process.js',\n ].filter(nonNullable)\n\n const routeIgnoreFn = makeIgnoreFn(routesIgnores)\n\n const serverTracedFiles = new Set<string>()\n const minimalServerTracedFiles = new Set<string>()\n\n function addToTracedFiles(base: string, file: string, dest: Set<string>) {\n dest.add(\n path.relative(distDir, path.join(base, file)).replace(/\\\\/g, '/')\n )\n }\n\n if (isStandalone) {\n addToTracedFiles(\n '',\n require.resolve('next/dist/compiled/jest-worker/processChild'),\n serverTracedFiles\n )\n addToTracedFiles(\n '',\n require.resolve('next/dist/compiled/jest-worker/threadChild'),\n serverTracedFiles\n )\n }\n\n {\n const chunksToTrace: string[] = [\n ...(buildTraceContext?.chunksTrace?.action.input || []),\n ...serverEntries,\n ...minimalServerEntries,\n ]\n const result = await nodeFileTrace(chunksToTrace, {\n base: outputFileTracingRoot,\n processCwd: dir,\n mixedModules: true,\n async readFile(p) {\n try {\n return await fs.readFile(p, 'utf8')\n } catch (e) {\n if (isError(e) && (e.code === 'ENOENT' || e.code === 'EISDIR')) {\n // since tracing runs in parallel with static generation server\n // files might be removed from that step so tolerate ENOENT\n // errors gracefully\n return ''\n }\n throw e\n }\n },\n async readlink(p) {\n try {\n return await fs.readlink(p)\n } catch (e) {\n if (\n isError(e) &&\n (e.code === 'EINVAL' ||\n e.code === 'ENOENT' ||\n e.code === 'UNKNOWN')\n ) {\n return null\n }\n throw e\n }\n },\n async stat(p) {\n try {\n return await fs.stat(p)\n } catch (e) {\n if (isError(e) && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) {\n return null\n }\n throw e\n }\n },\n // handle shared ignores at top-level as it\n // avoids over-tracing when we don't need to\n // and speeds up total trace time\n ignore(p) {\n if (sharedIgnoresFn(p)) {\n return true\n }\n\n // if a chunk is attempting to be traced that isn't\n // in our initial list we need to ignore it to prevent\n // over tracing as webpack needs to be the source of\n // truth for which chunks should be included for each entry\n if (\n p.includes('.next/server/chunks') &&\n !chunksToTrace.includes(path.join(outputFileTracingRoot, p))\n ) {\n return true\n }\n return false\n },\n })\n const reasons = result.reasons\n const fileList = result.fileList\n for (const file of result.esmFileList) {\n fileList.add(file)\n }\n\n const parentFilesMap = getFilesMapFromReasons(fileList, reasons)\n const cachedLookupIgnore = new Map<string, boolean>()\n const cachedLookupIgnoreMinimal = new Map<string, boolean>()\n\n for (const [entries, tracedFiles] of [\n [serverEntries, serverTracedFiles],\n [minimalServerEntries, minimalServerTracedFiles],\n ] as Array<[string[], Set<string>]>) {\n for (const file of entries) {\n const curFiles = [\n ...(parentFilesMap\n .get(path.relative(outputFileTracingRoot, file))\n ?.keys() || []),\n ]\n tracedFiles.add(path.relative(distDir, file).replace(/\\\\/g, '/'))\n\n for (const curFile of curFiles || []) {\n const filePath = path.join(outputFileTracingRoot, curFile)\n\n if (\n !shouldIgnore(\n curFile,\n tracedFiles === minimalServerTracedFiles\n ? minimalServerIgnoreFn\n : serverIgnoreFn,\n reasons,\n tracedFiles === minimalServerTracedFiles\n ? cachedLookupIgnoreMinimal\n : cachedLookupIgnore\n )\n ) {\n tracedFiles.add(\n path.relative(distDir, filePath).replace(/\\\\/g, '/')\n )\n }\n }\n }\n }\n\n const { entryNameFilesMap } = buildTraceContext?.chunksTrace || {}\n\n const cachedLookupIgnoreRoutes = new Map<string, boolean>()\n\n await Promise.all(\n [\n ...(entryNameFilesMap\n ? Object.entries(entryNameFilesMap)\n : new Map()),\n ].map(async ([entryName, entryNameFiles]) => {\n const isApp = entryName.startsWith('app/')\n const isPages = entryName.startsWith('pages/')\n let route = entryName\n if (isApp) {\n route = normalizeAppPath(route.substring('app'.length))\n }\n if (isPages) {\n route = normalizePagePath(route.substring('pages'.length))\n }\n\n // we don't need to trace for automatically statically optimized\n // pages as they don't have server bundles, note there is\n // the caveat with flying shuttle mode as it needs this for\n // detecting changed entries\n if (staticPages.includes(route)) {\n return\n }\n const entryOutputPath = path.join(\n distDir,\n 'server',\n `${entryName}.js`\n )\n const traceOutputPath = `${entryOutputPath}.nft.json`\n const existingTrace = JSON.parse(\n await fs.readFile(traceOutputPath, 'utf8')\n ) as {\n version: number\n files: string[]\n fileHashes: Record<string, string>\n }\n const traceOutputDir = path.dirname(traceOutputPath)\n const curTracedFiles = new Set<string>()\n\n for (const file of [...entryNameFiles, entryOutputPath]) {\n const curFiles = [\n ...(parentFilesMap\n .get(path.relative(outputFileTracingRoot, file))\n ?.keys() || []),\n ]\n for (const curFile of curFiles || []) {\n if (\n !shouldIgnore(\n curFile,\n routeIgnoreFn,\n reasons,\n cachedLookupIgnoreRoutes\n )\n ) {\n const filePath = path.join(outputFileTracingRoot, curFile)\n const outputFile = path\n .relative(traceOutputDir, filePath)\n .replace(/\\\\/g, '/')\n curTracedFiles.add(outputFile)\n }\n }\n }\n\n for (const file of existingTrace.files || []) {\n curTracedFiles.add(file)\n }\n\n await fs.writeFile(\n traceOutputPath,\n JSON.stringify({\n ...existingTrace,\n files: [...curTracedFiles].sort(),\n })\n )\n })\n )\n }\n\n const moduleTypes = ['app-page', 'pages']\n\n for (const type of moduleTypes) {\n const modulePath = require.resolve(\n `next/dist/server/route-modules/${type}/module.compiled`\n )\n const relativeModulePath = path.relative(root, modulePath)\n\n const contextDir = path.join(\n path.dirname(modulePath),\n 'vendored',\n 'contexts'\n )\n\n for (const item of await fs.readdir(contextDir)) {\n const itemPath = path.relative(root, path.join(contextDir, item))\n if (!serverIgnoreFn(itemPath)) {\n addToTracedFiles(root, itemPath, serverTracedFiles)\n addToTracedFiles(root, itemPath, minimalServerTracedFiles)\n }\n }\n addToTracedFiles(root, relativeModulePath, serverTracedFiles)\n addToTracedFiles(root, relativeModulePath, minimalServerTracedFiles)\n }\n\n await Promise.all([\n fs.writeFile(\n nextServerTraceOutput,\n JSON.stringify({\n version: 1,\n files: Array.from(serverTracedFiles),\n } as {\n version: number\n files: string[]\n })\n ),\n fs.writeFile(\n nextMinimalTraceOutput,\n JSON.stringify({\n version: 1,\n files: Array.from(minimalServerTracedFiles),\n } as {\n version: number\n files: string[]\n })\n ),\n ])\n })\n\n // apply outputFileTracingIncludes/outputFileTracingExcludes after runTurbotrace\n const includeExcludeSpan = nextBuildSpan.traceChild('apply-include-excludes')\n await includeExcludeSpan.traceAsyncFn(async () => {\n const globOrig =\n require('next/dist/compiled/glob') as typeof import('next/dist/compiled/glob')\n const glob = (pattern: string): Promise<string[]> => {\n return new Promise((resolve, reject) => {\n globOrig(\n pattern,\n { cwd: dir, nodir: true, dot: true },\n (err, files) => {\n if (err) {\n return reject(err)\n }\n resolve(files)\n }\n )\n })\n }\n\n const { entryNameFilesMap } = buildTraceContext?.chunksTrace || {}\n\n await Promise.all(\n [\n ...(entryNameFilesMap ? Object.entries(entryNameFilesMap) : new Map()),\n ].map(async ([entryName]) => {\n const isApp = entryName.startsWith('app/')\n const isPages = entryName.startsWith('pages/')\n let route = entryName\n if (isApp) {\n route = normalizeAppPath(entryName)\n }\n if (isPages) {\n route = normalizePagePath(entryName)\n }\n\n if (staticPages.includes(route)) {\n return\n }\n\n // edge routes have no trace files\n if (edgeRuntimeRoutes.hasOwnProperty(route)) {\n return\n }\n\n const combinedIncludes = new Set<string>()\n const combinedExcludes = new Set<string>()\n for (const curGlob of includeGlobKeys) {\n const isMatch = picomatch(curGlob, { dot: true, contains: true })\n if (isMatch(route)) {\n for (const include of outputFileTracingIncludes[curGlob]) {\n combinedIncludes.add(include.replace(/\\\\/g, '/'))\n }\n }\n }\n\n for (const curGlob of excludeGlobKeys) {\n const isMatch = picomatch(curGlob, { dot: true, contains: true })\n if (isMatch(route)) {\n for (const exclude of outputFileTracingExcludes[curGlob]) {\n combinedExcludes.add(exclude)\n }\n }\n }\n\n if (!combinedIncludes?.size && !combinedExcludes?.size) {\n return\n }\n\n const traceFile = path.join(\n distDir,\n `server`,\n `${entryName}.js.nft.json`\n )\n const pageDir = path.dirname(traceFile)\n const traceContent = JSON.parse(await fs.readFile(traceFile, 'utf8'))\n const includes: string[] = []\n const resolvedTraceIncludes = new Map<string, string[]>()\n\n if (combinedIncludes?.size) {\n await Promise.all(\n [...combinedIncludes].map(async (includeGlob) => {\n const results = await glob(includeGlob)\n const resolvedInclude = resolvedTraceIncludes.get(\n includeGlob\n ) || [\n ...results.map((file) => {\n return path.relative(pageDir, path.join(dir, file))\n }),\n ]\n includes.push(...resolvedInclude)\n resolvedTraceIncludes.set(includeGlob, resolvedInclude)\n })\n )\n }\n const combined = new Set([...traceContent.files, ...includes])\n\n if (combinedExcludes?.size) {\n const resolvedGlobs = [...combinedExcludes].map((exclude) =>\n path.join(dir, exclude)\n )\n\n // pre compile before forEach\n const isMatch = picomatch(resolvedGlobs, {\n dot: true,\n contains: true,\n })\n\n combined.forEach((file) => {\n if (isMatch(path.join(pageDir, file))) {\n combined.delete(file)\n }\n })\n }\n\n // overwrite trace file with custom includes/excludes\n await fs.writeFile(\n traceFile,\n JSON.stringify({\n version: traceContent.version,\n files: [...combined],\n })\n )\n })\n )\n })\n\n debug(`finished build tracing ${Date.now() - startTime}ms`)\n}\n"],"names":["collectBuildTraces","debug","debugOriginal","shouldIgnore","file","serverIgnoreFn","reasons","cachedIgnoreFiles","children","Set","has","get","set","add","reason","parents","size","type","includes","allParentsIgnored","parent","values","dir","config","distDir","edgeRuntimeRoutes","staticPages","nextBuildSpan","Span","name","hasSsrAmpPages","buildTraceContext","outputFileTracingRoot","startTime","Date","now","outputFileTracingIncludes","outputFileTracingExcludes","excludeGlobKeys","Object","keys","includeGlobKeys","traceChild","isTurbotrace","traceAsyncFn","nextServerTraceOutput","path","join","nextMinimalTraceOutput","root","isStandalone","output","sharedEntriesSet","defaultOverrides","map","value","require","resolve","paths","cacheHandler","cacheHandlers","experimental","push","isAbsolute","handlerPath","serverEntries","filter","Boolean","minimalServerEntries","additionalIgnores","glob","picomatch","forEach","exclude","makeIgnoreFn","ignores","isMatch","contains","dot","pathname","startsWith","sharedIgnores","ciEnvironment","hasNextSupport","TRACE_IGNORES","sharedIgnoresFn","serverIgnores","nonNullable","minimalServerIgnores","minimalServerIgnoreFn","routesIgnores","routeIgnoreFn","serverTracedFiles","minimalServerTracedFiles","addToTracedFiles","base","dest","relative","replace","chunksToTrace","chunksTrace","action","input","result","nodeFileTrace","processCwd","mixedModules","readFile","p","fs","e","isError","code","readlink","stat","ignore","fileList","esmFileList","parentFilesMap","getFilesMapFromReasons","cachedLookupIgnore","Map","cachedLookupIgnoreMinimal","entries","tracedFiles","curFiles","curFile","filePath","entryNameFilesMap","cachedLookupIgnoreRoutes","Promise","all","entryName","entryNameFiles","isApp","isPages","route","normalizeAppPath","substring","length","normalizePagePath","entryOutputPath","traceOutputPath","existingTrace","JSON","parse","traceOutputDir","dirname","curTracedFiles","outputFile","files","writeFile","stringify","sort","moduleTypes","modulePath","relativeModulePath","contextDir","item","readdir","itemPath","version","Array","from","includeExcludeSpan","globOrig","pattern","reject","cwd","nodir","err","hasOwnProperty","combinedIncludes","combinedExcludes","curGlob","include","traceFile","pageDir","traceContent","resolvedTraceIncludes","includeGlob","results","resolvedInclude","combined","resolvedGlobs","delete"],"mappings":";;;;+BA0EsBA;;;eAAAA;;;uBA1ED;4CAOd;6DAEU;iEACF;6BACa;gEACG;8DACL;kEACJ;6BACW;qBACH;mCACI;0BACD;gEACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIpB,MAAMC,QAAQC,IAAAA,cAAa,EAAC;AAE5B,SAASC,aACPC,IAAY,EACZC,cAAyC,EACzCC,OAA6B,EAC7BC,iBAAuC,EACvCC,WAAwB,IAAIC,KAAK;IAEjC,IAAIF,kBAAkBG,GAAG,CAACN,OAAO;QAC/B,OAAOG,kBAAkBI,GAAG,CAACP;IAC/B;IAEA,IAAIC,eAAeD,OAAO;QACxBG,kBAAkBK,GAAG,CAACR,MAAM;QAC5B,OAAO;IACT;IACAI,SAASK,GAAG,CAACT;IAEb,MAAMU,SAASR,QAAQK,GAAG,CAACP;IAC3B,IAAI,CAACU,UAAUA,OAAOC,OAAO,CAACC,IAAI,KAAK,KAAKF,OAAOG,IAAI,CAACC,QAAQ,CAAC,YAAY;QAC3EX,kBAAkBK,GAAG,CAACR,MAAM;QAC5B,OAAO;IACT;IAEA,4CAA4C;IAC5C,4BAA4B;IAC5B,IAAIe,oBAAoB;IAExB,KAAK,MAAMC,UAAUN,OAAOC,OAAO,CAACM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9K,IAAI;mBAAIyK,aAAa5B,KAAK;mBAAKpI;aAAS;YAE7D,IAAI2J,oCAAAA,iBAAkB7J,IAAI,EAAE;gBAC1B,MAAMwK,gBAAgB;uBAAIX;iBAAiB,CAACvH,GAAG,CAAC,CAACmB,UAC/C3B,aAAI,CAACC,IAAI,CAACzB,KAAKmD;gBAGjB,6BAA6B;gBAC7B,MAAMG,UAAUL,IAAAA,kBAAS,EAACiH,eAAe;oBACvC1G,KAAK;oBACLD,UAAU;gBACZ;gBAEA0G,SAAS/G,OAAO,CAAC,CAACpE;oBAChB,IAAIwE,QAAQ9B,aAAI,CAACC,IAAI,CAACkI,SAAS7K,QAAQ;wBACrCmL,SAASE,MAAM,CAACrL;oBAClB;gBACF;YACF;YAEA,qDAAqD;YACrD,MAAMyG,iBAAE,CAAC0C,SAAS,CAChByB,WACAhC,KAAKQ,SAAS,CAAC;gBACbS,SAASiB,aAAajB,OAAO;gBAC7BX,OAAO;uBAAIiC;iBAAS;YACtB;QAEJ;IAEJ;IAEAtL,MAAM,CAAC,uBAAuB,EAAEiC,KAAKC,GAAG,KAAKF,UAAU,EAAE,CAAC;AAC5D"}
1
+ {"version":3,"sources":["../../src/build/collect-build-traces.ts"],"sourcesContent":["import { Span } from '../trace'\nimport type { NextConfigComplete } from '../server/config-shared'\n\nimport {\n TRACE_IGNORES,\n type BuildTraceContext,\n getFilesMapFromReasons,\n} from './webpack/plugins/next-trace-entrypoints-plugin'\n\nimport path from 'path'\nimport fs from 'fs/promises'\nimport { nonNullable } from '../lib/non-nullable'\nimport * as ciEnvironment from '../server/ci-info'\nimport debugOriginal from 'next/dist/compiled/debug'\nimport picomatch from 'next/dist/compiled/picomatch'\nimport { defaultOverrides } from '../server/require-hook'\nimport { nodeFileTrace } from 'next/dist/compiled/@vercel/nft'\nimport { normalizePagePath } from '../shared/lib/page-path/normalize-page-path'\nimport { normalizeAppPath } from '../shared/lib/router/utils/app-paths'\nimport isError from '../lib/is-error'\nimport type { NodeFileTraceReasons } from '@vercel/nft'\nimport type { RoutesUsingEdgeRuntime } from './utils'\n\nconst debug = debugOriginal('next:build:build-traces')\n\nfunction shouldIgnore(\n file: string,\n serverIgnoreFn: (file: string) => boolean,\n reasons: NodeFileTraceReasons,\n cachedIgnoreFiles: Map<string, boolean>,\n children: Set<string> = new Set()\n) {\n if (cachedIgnoreFiles.has(file)) {\n return cachedIgnoreFiles.get(file)\n }\n\n if (serverIgnoreFn(file)) {\n cachedIgnoreFiles.set(file, true)\n return true\n }\n children.add(file)\n\n const reason = reasons.get(file)\n if (!reason || reason.parents.size === 0 || reason.type.includes('initial')) {\n cachedIgnoreFiles.set(file, false)\n return false\n }\n\n // if all parents are ignored the child file\n // should be ignored as well\n let allParentsIgnored = true\n\n for (const parent of reason.parents.values()) {\n if (!children.has(parent)) {\n children.add(parent)\n if (\n !shouldIgnore(\n parent,\n serverIgnoreFn,\n reasons,\n cachedIgnoreFiles,\n children\n )\n ) {\n allParentsIgnored = false\n break\n }\n }\n }\n\n cachedIgnoreFiles.set(file, allParentsIgnored)\n return allParentsIgnored\n}\n\nexport async function collectBuildTraces({\n dir,\n config,\n distDir,\n edgeRuntimeRoutes,\n staticPages,\n nextBuildSpan = new Span({ name: 'build' }),\n hasSsrAmpPages,\n buildTraceContext,\n outputFileTracingRoot,\n}: {\n dir: string\n distDir: string\n staticPages: string[]\n hasSsrAmpPages: boolean\n outputFileTracingRoot: string\n // pageInfos is serialized when this function runs in a worker.\n edgeRuntimeRoutes: RoutesUsingEdgeRuntime\n nextBuildSpan?: Span\n config: NextConfigComplete\n buildTraceContext?: BuildTraceContext\n}) {\n const startTime = Date.now()\n debug('starting build traces')\n\n const { outputFileTracingIncludes = {}, outputFileTracingExcludes = {} } =\n config\n const excludeGlobKeys = Object.keys(outputFileTracingExcludes)\n const includeGlobKeys = Object.keys(outputFileTracingIncludes)\n\n await nextBuildSpan\n .traceChild('node-file-trace-build', {\n isTurbotrace: 'false', // TODO(arlyon): remove this\n })\n .traceAsyncFn(async () => {\n const nextServerTraceOutput = path.join(\n distDir,\n 'next-server.js.nft.json'\n )\n const nextMinimalTraceOutput = path.join(\n distDir,\n 'next-minimal-server.js.nft.json'\n )\n const root = outputFileTracingRoot\n\n // Under standalone mode, we need to trace the extra IPC server and\n // worker files.\n const isStandalone = config.output === 'standalone'\n const sharedEntriesSet = Object.keys(defaultOverrides).map((value) =>\n require.resolve(value, {\n paths: [require.resolve('next/dist/server/require-hook')],\n })\n )\n\n const { cacheHandler } = config\n const { cacheHandlers } = config.experimental\n\n // ensure we trace any dependencies needed for custom\n // incremental cache handler\n if (cacheHandler) {\n sharedEntriesSet.push(\n require.resolve(\n path.isAbsolute(cacheHandler)\n ? cacheHandler\n : path.join(dir, cacheHandler)\n )\n )\n }\n\n if (cacheHandlers) {\n for (const handlerPath of Object.values(cacheHandlers)) {\n if (handlerPath) {\n sharedEntriesSet.push(\n require.resolve(\n path.isAbsolute(handlerPath)\n ? handlerPath\n : path.join(dir, handlerPath)\n )\n )\n }\n }\n }\n\n const serverEntries = [\n ...sharedEntriesSet,\n ...(isStandalone\n ? [\n require.resolve('next/dist/server/lib/start-server'),\n require.resolve('next/dist/server/next'),\n require.resolve('next/dist/server/require-hook'),\n ]\n : []),\n require.resolve('next/dist/server/next-server'),\n ].filter(Boolean) as string[]\n\n const minimalServerEntries = [\n ...sharedEntriesSet,\n require.resolve('next/dist/compiled/next-server/server.runtime.prod'),\n ].filter(Boolean)\n\n const additionalIgnores = new Set<string>()\n\n for (const glob of excludeGlobKeys) {\n if (picomatch(glob)('next-server')) {\n outputFileTracingExcludes[glob].forEach((exclude) => {\n additionalIgnores.add(exclude)\n })\n }\n }\n\n const makeIgnoreFn = (ignores: string[]) => {\n // pre compile the ignore globs\n const isMatch = picomatch(ignores, {\n contains: true,\n dot: true,\n })\n\n return (pathname: string) => {\n if (path.isAbsolute(pathname) && !pathname.startsWith(root)) {\n return true\n }\n\n return isMatch(pathname)\n }\n }\n\n const sharedIgnores = [\n '**/next/dist/compiled/next-server/**/*.dev.js',\n ...(isStandalone ? [] : ['**/next/dist/compiled/jest-worker/**/*']),\n '**/next/dist/compiled/webpack/*',\n '**/node_modules/webpack5/**/*',\n '**/next/dist/server/lib/route-resolver*',\n 'next/dist/compiled/semver/semver/**/*.js',\n\n ...(ciEnvironment.hasNextSupport\n ? [\n // only ignore image-optimizer code when\n // this is being handled outside of next-server\n '**/next/dist/server/image-optimizer.js',\n ]\n : []),\n\n ...(!hasSsrAmpPages\n ? ['**/next/dist/compiled/@ampproject/toolbox-optimizer/**/*']\n : []),\n\n ...(isStandalone ? [] : TRACE_IGNORES),\n ...additionalIgnores,\n ]\n\n const sharedIgnoresFn = makeIgnoreFn(sharedIgnores)\n\n const serverIgnores = [\n ...sharedIgnores,\n '**/node_modules/react{,-dom,-dom-server-turbopack}/**/*.development.js',\n '**/*.d.ts',\n '**/*.map',\n '**/next/dist/pages/**/*',\n ...(ciEnvironment.hasNextSupport\n ? ['**/node_modules/sharp/**/*', '**/@img/sharp-libvips*/**/*']\n : []),\n ].filter(nonNullable)\n const serverIgnoreFn = makeIgnoreFn(serverIgnores)\n\n const minimalServerIgnores = [\n ...serverIgnores,\n '**/next/dist/compiled/edge-runtime/**/*',\n '**/next/dist/server/web/sandbox/**/*',\n '**/next/dist/server/post-process.js',\n ]\n const minimalServerIgnoreFn = makeIgnoreFn(minimalServerIgnores)\n\n const routesIgnores = [\n ...sharedIgnores,\n // server chunks are provided via next-trace-entrypoints-plugin plugin\n // as otherwise all chunks are traced here and included for all pages\n // whether they are needed or not\n '**/.next/server/chunks/**',\n '**/next/dist/server/optimize-amp.js',\n '**/next/dist/server/post-process.js',\n ].filter(nonNullable)\n\n const routeIgnoreFn = makeIgnoreFn(routesIgnores)\n\n const serverTracedFiles = new Set<string>()\n const minimalServerTracedFiles = new Set<string>()\n\n function addToTracedFiles(base: string, file: string, dest: Set<string>) {\n dest.add(\n path.relative(distDir, path.join(base, file)).replace(/\\\\/g, '/')\n )\n }\n\n if (isStandalone) {\n addToTracedFiles(\n '',\n require.resolve('next/dist/compiled/jest-worker/processChild'),\n serverTracedFiles\n )\n addToTracedFiles(\n '',\n require.resolve('next/dist/compiled/jest-worker/threadChild'),\n serverTracedFiles\n )\n }\n\n {\n const chunksToTrace: string[] = [\n ...(buildTraceContext?.chunksTrace?.action.input || []),\n ...serverEntries,\n ...minimalServerEntries,\n ]\n const result = await nodeFileTrace(chunksToTrace, {\n base: outputFileTracingRoot,\n processCwd: dir,\n mixedModules: true,\n async readFile(p) {\n try {\n return await fs.readFile(p, 'utf8')\n } catch (e) {\n if (isError(e) && (e.code === 'ENOENT' || e.code === 'EISDIR')) {\n // since tracing runs in parallel with static generation server\n // files might be removed from that step so tolerate ENOENT\n // errors gracefully\n return ''\n }\n throw e\n }\n },\n async readlink(p) {\n try {\n return await fs.readlink(p)\n } catch (e) {\n if (\n isError(e) &&\n (e.code === 'EINVAL' ||\n e.code === 'ENOENT' ||\n e.code === 'UNKNOWN')\n ) {\n return null\n }\n throw e\n }\n },\n async stat(p) {\n try {\n return await fs.stat(p)\n } catch (e) {\n if (isError(e) && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) {\n return null\n }\n throw e\n }\n },\n // handle shared ignores at top-level as it\n // avoids over-tracing when we don't need to\n // and speeds up total trace time\n ignore(p) {\n if (sharedIgnoresFn(p)) {\n return true\n }\n\n // if a chunk is attempting to be traced that isn't\n // in our initial list we need to ignore it to prevent\n // over tracing as webpack needs to be the source of\n // truth for which chunks should be included for each entry\n if (\n p.includes('.next/server/chunks') &&\n !chunksToTrace.includes(path.join(outputFileTracingRoot, p))\n ) {\n return true\n }\n return false\n },\n })\n const reasons = result.reasons\n const fileList = result.fileList\n for (const file of result.esmFileList) {\n fileList.add(file)\n }\n\n const parentFilesMap = getFilesMapFromReasons(fileList, reasons)\n const cachedLookupIgnore = new Map<string, boolean>()\n const cachedLookupIgnoreMinimal = new Map<string, boolean>()\n\n for (const [entries, tracedFiles] of [\n [serverEntries, serverTracedFiles],\n [minimalServerEntries, minimalServerTracedFiles],\n ] as Array<[string[], Set<string>]>) {\n for (const file of entries) {\n const curFiles = [\n ...(parentFilesMap\n .get(path.relative(outputFileTracingRoot, file))\n ?.keys() || []),\n ]\n tracedFiles.add(path.relative(distDir, file).replace(/\\\\/g, '/'))\n\n for (const curFile of curFiles || []) {\n const filePath = path.join(outputFileTracingRoot, curFile)\n\n if (\n !shouldIgnore(\n curFile,\n tracedFiles === minimalServerTracedFiles\n ? minimalServerIgnoreFn\n : serverIgnoreFn,\n reasons,\n tracedFiles === minimalServerTracedFiles\n ? cachedLookupIgnoreMinimal\n : cachedLookupIgnore\n )\n ) {\n tracedFiles.add(\n path.relative(distDir, filePath).replace(/\\\\/g, '/')\n )\n }\n }\n }\n }\n\n const { entryNameFilesMap } = buildTraceContext?.chunksTrace || {}\n\n const cachedLookupIgnoreRoutes = new Map<string, boolean>()\n\n await Promise.all(\n [\n ...(entryNameFilesMap\n ? Object.entries(entryNameFilesMap)\n : new Map()),\n ].map(async ([entryName, entryNameFiles]) => {\n const isApp = entryName.startsWith('app/')\n const isPages = entryName.startsWith('pages/')\n let route = entryName\n if (isApp) {\n route = normalizeAppPath(route.substring('app'.length))\n }\n if (isPages) {\n route = normalizePagePath(route.substring('pages'.length))\n }\n\n // we don't need to trace for automatically statically optimized\n // pages as they don't have server bundles, note there is\n // the caveat with flying shuttle mode as it needs this for\n // detecting changed entries\n if (staticPages.includes(route)) {\n return\n }\n const entryOutputPath = path.join(\n distDir,\n 'server',\n `${entryName}.js`\n )\n const traceOutputPath = `${entryOutputPath}.nft.json`\n const existingTrace = JSON.parse(\n await fs.readFile(traceOutputPath, 'utf8')\n ) as {\n version: number\n files: string[]\n fileHashes: Record<string, string>\n }\n const traceOutputDir = path.dirname(traceOutputPath)\n const curTracedFiles = new Set<string>()\n\n for (const file of [...entryNameFiles, entryOutputPath]) {\n const curFiles = [\n ...(parentFilesMap\n .get(path.relative(outputFileTracingRoot, file))\n ?.keys() || []),\n ]\n for (const curFile of curFiles || []) {\n if (\n !shouldIgnore(\n curFile,\n routeIgnoreFn,\n reasons,\n cachedLookupIgnoreRoutes\n )\n ) {\n const filePath = path.join(outputFileTracingRoot, curFile)\n const outputFile = path\n .relative(traceOutputDir, filePath)\n .replace(/\\\\/g, '/')\n curTracedFiles.add(outputFile)\n }\n }\n }\n\n for (const file of existingTrace.files || []) {\n curTracedFiles.add(file)\n }\n\n await fs.writeFile(\n traceOutputPath,\n JSON.stringify({\n ...existingTrace,\n files: [...curTracedFiles].sort(),\n })\n )\n })\n )\n }\n\n const moduleTypes = ['app-page', 'pages']\n\n for (const type of moduleTypes) {\n const modulePath = require.resolve(\n `next/dist/server/route-modules/${type}/module.compiled`\n )\n const relativeModulePath = path.relative(root, modulePath)\n\n const contextDir = path.join(\n path.dirname(modulePath),\n 'vendored',\n 'contexts'\n )\n\n for (const item of await fs.readdir(contextDir)) {\n const itemPath = path.relative(root, path.join(contextDir, item))\n if (!serverIgnoreFn(itemPath)) {\n addToTracedFiles(root, itemPath, serverTracedFiles)\n addToTracedFiles(root, itemPath, minimalServerTracedFiles)\n }\n }\n addToTracedFiles(root, relativeModulePath, serverTracedFiles)\n addToTracedFiles(root, relativeModulePath, minimalServerTracedFiles)\n }\n\n await Promise.all([\n fs.writeFile(\n nextServerTraceOutput,\n JSON.stringify({\n version: 1,\n files: Array.from(serverTracedFiles),\n } as {\n version: number\n files: string[]\n })\n ),\n fs.writeFile(\n nextMinimalTraceOutput,\n JSON.stringify({\n version: 1,\n files: Array.from(minimalServerTracedFiles),\n } as {\n version: number\n files: string[]\n })\n ),\n ])\n })\n\n // apply outputFileTracingIncludes/outputFileTracingExcludes after runTurbotrace\n const includeExcludeSpan = nextBuildSpan.traceChild('apply-include-excludes')\n await includeExcludeSpan.traceAsyncFn(async () => {\n const globOrig =\n require('next/dist/compiled/glob') as typeof import('next/dist/compiled/glob')\n const glob = (pattern: string): Promise<string[]> => {\n return new Promise((resolve, reject) => {\n globOrig(\n pattern,\n { cwd: dir, nodir: true, dot: true },\n (err, files) => {\n if (err) {\n return reject(err)\n }\n resolve(files)\n }\n )\n })\n }\n\n const { entryNameFilesMap } = buildTraceContext?.chunksTrace || {}\n\n await Promise.all(\n [\n ...(entryNameFilesMap ? Object.entries(entryNameFilesMap) : new Map()),\n ].map(async ([entryName]) => {\n const isApp = entryName.startsWith('app/')\n const isPages = entryName.startsWith('pages/')\n let route = entryName\n if (isApp) {\n route = normalizeAppPath(entryName)\n }\n if (isPages) {\n route = normalizePagePath(entryName)\n }\n\n if (staticPages.includes(route)) {\n return\n }\n\n // edge routes have no trace files\n if (edgeRuntimeRoutes.hasOwnProperty(route)) {\n return\n }\n\n const combinedIncludes = new Set<string>()\n const combinedExcludes = new Set<string>()\n for (const curGlob of includeGlobKeys) {\n const isMatch = picomatch(curGlob, { dot: true, contains: true })\n if (isMatch(route)) {\n for (const include of outputFileTracingIncludes[curGlob]) {\n combinedIncludes.add(include.replace(/\\\\/g, '/'))\n }\n }\n }\n\n for (const curGlob of excludeGlobKeys) {\n const isMatch = picomatch(curGlob, { dot: true, contains: true })\n if (isMatch(route)) {\n for (const exclude of outputFileTracingExcludes[curGlob]) {\n combinedExcludes.add(exclude)\n }\n }\n }\n\n if (!combinedIncludes?.size && !combinedExcludes?.size) {\n return\n }\n\n const traceFile = path.join(\n distDir,\n `server`,\n `${entryName}.js.nft.json`\n )\n const pageDir = path.dirname(traceFile)\n const traceContent = JSON.parse(await fs.readFile(traceFile, 'utf8'))\n const includes: string[] = []\n const resolvedTraceIncludes = new Map<string, string[]>()\n\n if (combinedIncludes?.size) {\n await Promise.all(\n [...combinedIncludes].map(async (includeGlob) => {\n const results = await glob(includeGlob)\n const resolvedInclude = resolvedTraceIncludes.get(\n includeGlob\n ) || [\n ...results.map((file) => {\n return path.relative(pageDir, path.join(dir, file))\n }),\n ]\n includes.push(...resolvedInclude)\n resolvedTraceIncludes.set(includeGlob, resolvedInclude)\n })\n )\n }\n const combined = new Set([...traceContent.files, ...includes])\n\n if (combinedExcludes?.size) {\n const resolvedGlobs = [...combinedExcludes].map((exclude) =>\n path.join(dir, exclude)\n )\n\n // pre compile before forEach\n const isMatch = picomatch(resolvedGlobs, {\n dot: true,\n contains: true,\n })\n\n combined.forEach((file) => {\n if (isMatch(path.join(pageDir, file))) {\n combined.delete(file)\n }\n })\n }\n\n // overwrite trace file with custom includes/excludes\n await fs.writeFile(\n traceFile,\n JSON.stringify({\n version: traceContent.version,\n files: [...combined],\n })\n )\n })\n )\n })\n\n debug(`finished build tracing ${Date.now() - startTime}ms`)\n}\n"],"names":["collectBuildTraces","debug","debugOriginal","shouldIgnore","file","serverIgnoreFn","reasons","cachedIgnoreFiles","children","Set","has","get","set","add","reason","parents","size","type","includes","allParentsIgnored","parent","values","dir","config","distDir","edgeRuntimeRoutes","staticPages","nextBuildSpan","Span","name","hasSsrAmpPages","buildTraceContext","outputFileTracingRoot","startTime","Date","now","outputFileTracingIncludes","outputFileTracingExcludes","excludeGlobKeys","Object","keys","includeGlobKeys","traceChild","isTurbotrace","traceAsyncFn","nextServerTraceOutput","path","join","nextMinimalTraceOutput","root","isStandalone","output","sharedEntriesSet","defaultOverrides","map","value","require","resolve","paths","cacheHandler","cacheHandlers","experimental","push","isAbsolute","handlerPath","serverEntries","filter","Boolean","minimalServerEntries","additionalIgnores","glob","picomatch","forEach","exclude","makeIgnoreFn","ignores","isMatch","contains","dot","pathname","startsWith","sharedIgnores","ciEnvironment","hasNextSupport","TRACE_IGNORES","sharedIgnoresFn","serverIgnores","nonNullable","minimalServerIgnores","minimalServerIgnoreFn","routesIgnores","routeIgnoreFn","serverTracedFiles","minimalServerTracedFiles","addToTracedFiles","base","dest","relative","replace","chunksToTrace","chunksTrace","action","input","result","nodeFileTrace","processCwd","mixedModules","readFile","p","fs","e","isError","code","readlink","stat","ignore","fileList","esmFileList","parentFilesMap","getFilesMapFromReasons","cachedLookupIgnore","Map","cachedLookupIgnoreMinimal","entries","tracedFiles","curFiles","curFile","filePath","entryNameFilesMap","cachedLookupIgnoreRoutes","Promise","all","entryName","entryNameFiles","isApp","isPages","route","normalizeAppPath","substring","length","normalizePagePath","entryOutputPath","traceOutputPath","existingTrace","JSON","parse","traceOutputDir","dirname","curTracedFiles","outputFile","files","writeFile","stringify","sort","moduleTypes","modulePath","relativeModulePath","contextDir","item","readdir","itemPath","version","Array","from","includeExcludeSpan","globOrig","pattern","reject","cwd","nodir","err","hasOwnProperty","combinedIncludes","combinedExcludes","curGlob","include","traceFile","pageDir","traceContent","resolvedTraceIncludes","includeGlob","results","resolvedInclude","combined","resolvedGlobs","delete"],"mappings":";;;;+BA0EsBA;;;eAAAA;;;uBA1ED;4CAOd;6DAEU;iEACF;6BACa;gEACG;8DACL;kEACJ;6BACW;qBACH;mCACI;0BACD;gEACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIpB,MAAMC,QAAQC,IAAAA,cAAa,EAAC;AAE5B,SAASC,aACPC,IAAY,EACZC,cAAyC,EACzCC,OAA6B,EAC7BC,iBAAuC,EACvCC,WAAwB,IAAIC,KAAK;IAEjC,IAAIF,kBAAkBG,GAAG,CAACN,OAAO;QAC/B,OAAOG,kBAAkBI,GAAG,CAACP;IAC/B;IAEA,IAAIC,eAAeD,OAAO;QACxBG,kBAAkBK,GAAG,CAACR,MAAM;QAC5B,OAAO;IACT;IACAI,SAASK,GAAG,CAACT;IAEb,MAAMU,SAASR,QAAQK,GAAG,CAACP;IAC3B,IAAI,CAACU,UAAUA,OAAOC,OAAO,CAACC,IAAI,KAAK,KAAKF,OAAOG,IAAI,CAACC,QAAQ,CAAC,YAAY;QAC3EX,kBAAkBK,GAAG,CAACR,MAAM;QAC5B,OAAO;IACT;IAEA,4CAA4C;IAC5C,4BAA4B;IAC5B,IAAIe,oBAAoB;IAExB,KAAK,MAAMC,UAAUN,OAAOC,OAAO,CAACM,MAAM,GAAI;QAC5C,IAAI,CAACb,SAASE,GAAG,CAACU,SAAS;YACzBZ,SAAS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AAA,iBAAkB7J,IAAI,EAAE;gBAC1B,MAAMwK,gBAAgB;uBAAIX;iBAAiB,CAACvH,GAAG,CAAC,CAACmB,UAC/C3B,aAAI,CAACC,IAAI,CAACzB,KAAKmD;gBAGjB,6BAA6B;gBAC7B,MAAMG,UAAUL,IAAAA,kBAAS,EAACiH,eAAe;oBACvC1G,KAAK;oBACLD,UAAU;gBACZ;gBAEA0G,SAAS/G,OAAO,CAAC,CAACpE;oBAChB,IAAIwE,QAAQ9B,aAAI,CAACC,IAAI,CAACkI,SAAS7K,QAAQ;wBACrCmL,SAASE,MAAM,CAACrL;oBAClB;gBACF;YACF;YAEA,qDAAqD;YACrD,MAAMyG,iBAAE,CAAC0C,SAAS,CAChByB,WACAhC,KAAKQ,SAAS,CAAC;gBACbS,SAASiB,aAAajB,OAAO;gBAC7BX,OAAO;uBAAIiC;iBAAS;YACtB;QAEJ;IAEJ;IAEAtL,MAAM,CAAC,uBAAuB,EAAEiC,KAAKC,GAAG,KAAKF,UAAU,EAAE,CAAC;AAC5D"}
@@ -160,6 +160,15 @@ function createWebpackAliases({ distDir, isClient, isEdgeServer, isNodeServer, d
160
160
  [_constants.APP_DIR_ALIAS]: appDir
161
161
  } : {},
162
162
  [_constants.ROOT_DIR_ALIAS]: dir,
163
+ ...isClient ? {
164
+ 'private-next-instrumentation-client': [
165
+ _path.default.join(dir, 'src', 'instrumentation-client'),
166
+ _path.default.join(dir, 'instrumentation-client'),
167
+ 'private-next-empty-module'
168
+ ],
169
+ // disable typechecker, webpack5 allows aliases to be set to false to create a no-op module
170
+ 'private-next-empty-module': false
171
+ } : {},
163
172
  [_constants.DOT_NEXT_ALIAS]: distDir,
164
173
  ...isClient || isEdgeServer ? getOptimizedModuleAliases() : {},
165
174
  ...reactProductionProfiling ? getReactProfilingInProduction() : {},
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/build/create-compiler-aliases.ts"],"sourcesContent":["import path from 'path'\nimport * as React from 'react'\nimport {\n DOT_NEXT_ALIAS,\n PAGES_DIR_ALIAS,\n ROOT_DIR_ALIAS,\n APP_DIR_ALIAS,\n RSC_ACTION_PROXY_ALIAS,\n RSC_ACTION_CLIENT_WRAPPER_ALIAS,\n RSC_ACTION_VALIDATE_ALIAS,\n RSC_ACTION_ENCRYPTION_ALIAS,\n RSC_CACHE_WRAPPER_ALIAS,\n type WebpackLayerName,\n} from '../lib/constants'\nimport type { NextConfigComplete } from '../server/config-shared'\nimport { defaultOverrides } from '../server/require-hook'\nimport { hasExternalOtelApiPackage } from './webpack-config'\nimport { NEXT_PROJECT_ROOT } from './next-dir-paths'\nimport { WEBPACK_LAYERS } from '../lib/constants'\nimport { isWebpackServerOnlyLayer } from './utils'\n\ninterface CompilerAliases {\n [alias: string]: string | string[]\n}\n\nconst isReact19 = typeof React.use === 'function'\n\nexport function createWebpackAliases({\n distDir,\n isClient,\n isEdgeServer,\n isNodeServer,\n dev,\n config,\n pagesDir,\n appDir,\n dir,\n reactProductionProfiling,\n hasRewrites,\n}: {\n distDir: string\n isClient: boolean\n isEdgeServer: boolean\n isNodeServer: boolean\n dev: boolean\n config: NextConfigComplete\n pagesDir: string | undefined\n appDir: string | undefined\n dir: string\n reactProductionProfiling: boolean\n hasRewrites: boolean\n}): CompilerAliases {\n const pageExtensions = config.pageExtensions\n const clientResolveRewrites = require.resolve(\n '../shared/lib/router/utils/resolve-rewrites'\n )\n const customAppAliases: CompilerAliases = {}\n const customDocumentAliases: CompilerAliases = {}\n\n // tell webpack where to look for _app and _document\n // using aliases to allow falling back to the default\n // version when removed or not present\n if (dev) {\n const nextDistPath = 'next/dist/' + (isEdgeServer ? 'esm/' : '')\n customAppAliases[`${PAGES_DIR_ALIAS}/_app`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_app.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_app.js`,\n ]\n customAppAliases[`${PAGES_DIR_ALIAS}/_error`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_error.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_error.js`,\n ]\n customDocumentAliases[`${PAGES_DIR_ALIAS}/_document`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_document.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_document.js`,\n ]\n }\n\n return {\n '@vercel/og$': 'next/dist/server/og/image-response',\n\n // Avoid bundling both entrypoints in React 19 when we just need one.\n // Also avoids bundler warnings in React 18 where react-dom/server.edge doesn't exist.\n 'next/dist/server/ReactDOMServerPages': isReact19\n ? 'react-dom/server.edge'\n : 'react-dom/server.browser',\n\n // Alias next/dist imports to next/dist/esm assets,\n // let this alias hit before `next` alias.\n ...(isEdgeServer\n ? {\n 'next/dist/api': 'next/dist/esm/api',\n 'next/dist/build': 'next/dist/esm/build',\n 'next/dist/client': 'next/dist/esm/client',\n 'next/dist/shared': 'next/dist/esm/shared',\n 'next/dist/pages': 'next/dist/esm/pages',\n 'next/dist/lib': 'next/dist/esm/lib',\n 'next/dist/server': 'next/dist/esm/server',\n\n ...createNextApiEsmAliases(),\n }\n : undefined),\n\n // For RSC server bundle\n ...(!hasExternalOtelApiPackage() && {\n '@opentelemetry/api': 'next/dist/compiled/@opentelemetry/api',\n }),\n\n ...(config.images.loaderFile\n ? {\n 'next/dist/shared/lib/image-loader': config.images.loaderFile,\n ...(isEdgeServer && {\n 'next/dist/esm/shared/lib/image-loader': config.images.loaderFile,\n }),\n }\n : undefined),\n\n 'styled-jsx/style$': defaultOverrides['styled-jsx/style'],\n 'styled-jsx$': defaultOverrides['styled-jsx'],\n\n ...customAppAliases,\n ...customDocumentAliases,\n\n ...(pagesDir ? { [PAGES_DIR_ALIAS]: pagesDir } : {}),\n ...(appDir ? { [APP_DIR_ALIAS]: appDir } : {}),\n [ROOT_DIR_ALIAS]: dir,\n [DOT_NEXT_ALIAS]: distDir,\n ...(isClient || isEdgeServer ? getOptimizedModuleAliases() : {}),\n ...(reactProductionProfiling ? getReactProfilingInProduction() : {}),\n\n // For Node server, we need to re-alias the package imports to prefer to\n // resolve to the ESM export.\n ...(isNodeServer\n ? getBarrelOptimizationAliases(\n config.experimental.optimizePackageImports || []\n )\n : {}),\n\n [RSC_ACTION_VALIDATE_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/action-validate',\n\n [RSC_ACTION_CLIENT_WRAPPER_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/action-client-wrapper',\n\n [RSC_ACTION_PROXY_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/server-reference',\n\n [RSC_ACTION_ENCRYPTION_ALIAS]: 'next/dist/server/app-render/encryption',\n\n [RSC_CACHE_WRAPPER_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/cache-wrapper',\n\n ...(isClient || isEdgeServer\n ? {\n [clientResolveRewrites]: hasRewrites\n ? clientResolveRewrites\n : // With webpack 5 an alias can be pointed to false to noop\n false,\n }\n : {}),\n\n '@swc/helpers/_': path.join(\n path.dirname(require.resolve('@swc/helpers/package.json')),\n '_'\n ),\n\n setimmediate: 'next/dist/compiled/setimmediate',\n }\n}\n\nexport function createServerOnlyClientOnlyAliases(\n isServer: boolean\n): CompilerAliases {\n return isServer\n ? {\n 'server-only$': 'next/dist/compiled/server-only/empty',\n 'client-only$': 'next/dist/compiled/client-only/error',\n 'next/dist/compiled/server-only$':\n 'next/dist/compiled/server-only/empty',\n 'next/dist/compiled/client-only$':\n 'next/dist/compiled/client-only/error',\n }\n : {\n 'server-only$': 'next/dist/compiled/server-only/index',\n 'client-only$': 'next/dist/compiled/client-only/index',\n 'next/dist/compiled/client-only$':\n 'next/dist/compiled/client-only/index',\n 'next/dist/compiled/server-only':\n 'next/dist/compiled/server-only/index',\n }\n}\n\nexport function createNextApiEsmAliases() {\n const mapping = {\n head: 'next/dist/api/head',\n image: 'next/dist/api/image',\n constants: 'next/dist/api/constants',\n router: 'next/dist/api/router',\n dynamic: 'next/dist/api/dynamic',\n script: 'next/dist/api/script',\n link: 'next/dist/api/link',\n form: 'next/dist/api/form',\n navigation: 'next/dist/api/navigation',\n headers: 'next/dist/api/headers',\n og: 'next/dist/api/og',\n server: 'next/dist/api/server',\n // pages api\n document: 'next/dist/api/document',\n app: 'next/dist/api/app',\n }\n const aliasMap: Record<string, string> = {}\n // Handle fully specified imports like `next/image.js`\n for (const [key, value] of Object.entries(mapping)) {\n const nextApiFilePath = path.join(NEXT_PROJECT_ROOT, key)\n aliasMap[nextApiFilePath + '.js'] = value\n }\n\n return aliasMap\n}\n\nexport function createAppRouterApiAliases(isServerOnlyLayer: boolean) {\n const mapping: Record<string, string> = {\n head: 'next/dist/client/components/noop-head',\n dynamic: 'next/dist/api/app-dynamic',\n link: 'next/dist/client/app-dir/link',\n form: 'next/dist/client/app-dir/form',\n }\n\n if (isServerOnlyLayer) {\n mapping['navigation'] = 'next/dist/api/navigation.react-server'\n }\n\n const aliasMap: Record<string, string> = {}\n for (const [key, value] of Object.entries(mapping)) {\n const nextApiFilePath = path.join(NEXT_PROJECT_ROOT, key)\n aliasMap[nextApiFilePath + '.js'] = value\n }\n return aliasMap\n}\n\nexport function createRSCAliases(\n bundledReactChannel: string,\n {\n layer,\n isEdgeServer,\n reactProductionProfiling,\n }: {\n layer: WebpackLayerName\n isEdgeServer: boolean\n reactProductionProfiling: boolean\n }\n): CompilerAliases {\n const isServerOnlyLayer = isWebpackServerOnlyLayer(layer)\n // For middleware, instrumentation layers, treat them as rsc layer.\n // Since we only built the runtime package for rsc, convert everything to rsc\n // to ensure the runtime modules path existed.\n if (isServerOnlyLayer) {\n layer = WEBPACK_LAYERS.reactServerComponents\n }\n\n let alias: Record<string, string> = {\n react$: `next/dist/compiled/react${bundledReactChannel}`,\n 'react-dom$': `next/dist/compiled/react-dom${bundledReactChannel}`,\n 'react/jsx-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-runtime`,\n 'react/jsx-dev-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime`,\n 'react/compiler-runtime$': `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'react-dom/client$': `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': `next/dist/compiled/react-dom${bundledReactChannel}/server`,\n 'react-dom/server.browser$': `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n 'react-dom/static$': `next/dist/compiled/react-dom${bundledReactChannel}/static`,\n 'react-dom/static.edge$': `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n 'react-dom/static.browser$': `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': `next/dist/build/webpack/alias/react-dom-server-edge${bundledReactChannel}.js`,\n // react-server-dom-webpack alias\n 'react-server-dom-webpack/client$': `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client`,\n 'react-server-dom-webpack/client.edge$': `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.edge`,\n 'react-server-dom-webpack/server.edge$': `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.edge`,\n 'react-server-dom-webpack/server.node$': `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static.edge$': `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.edge`,\n }\n\n if (!isEdgeServer) {\n if (layer === WEBPACK_LAYERS.serverSideRendering) {\n alias = Object.assign(alias, {\n 'react/jsx-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-jsx-runtime`,\n 'react/jsx-dev-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-jsx-dev-runtime`,\n 'react/compiler-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-compiler-runtime`,\n react$: `next/dist/server/route-modules/app-page/vendored/${layer}/react`,\n 'react-dom$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-dom`,\n 'react-server-dom-webpack/client.edge$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-server-dom-webpack-client-edge`,\n })\n } else if (layer === WEBPACK_LAYERS.reactServerComponents) {\n alias = Object.assign(alias, {\n 'react/jsx-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-jsx-runtime`,\n 'react/jsx-dev-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-jsx-dev-runtime`,\n 'react/compiler-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-compiler-runtime`,\n react$: `next/dist/server/route-modules/app-page/vendored/${layer}/react`,\n 'react-dom$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-dom`,\n 'react-server-dom-webpack/server.edge$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-server-dom-webpack-server-edge`,\n 'react-server-dom-webpack/server.node$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-server-dom-webpack-server-node`,\n 'react-server-dom-webpack/static.edge$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-server-dom-webpack-static-edge`,\n })\n }\n }\n\n if (isEdgeServer) {\n if (layer === WEBPACK_LAYERS.reactServerComponents) {\n alias = Object.assign(alias, {\n react$: `next/dist/compiled/react${bundledReactChannel}/react.react-server`,\n 'next/dist/compiled/react$': `next/dist/compiled/react${bundledReactChannel}/react.react-server`,\n 'next/dist/compiled/react-experimental$': `next/dist/compiled/react-experimental/react.react-server`,\n 'react/jsx-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-runtime.react-server`,\n 'react/compiler-runtime$': `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'next/dist/compiled/react/jsx-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-runtime.react-server`,\n 'next/dist/compiled/react-experimental/jsx-runtime$': `next/dist/compiled/react-experimental/jsx-runtime.react-server`,\n 'react/jsx-dev-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime.react-server`,\n 'next/dist/compiled/react/jsx-dev-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime.react-server`,\n 'next/dist/compiled/react-experimental/jsx-dev-runtime$': `next/dist/compiled/react-experimental/jsx-dev-runtime.react-server`,\n 'react-dom$': `next/dist/compiled/react-dom${bundledReactChannel}/react-dom.react-server`,\n 'next/dist/compiled/react-dom$': `next/dist/compiled/react-dom${bundledReactChannel}/react-dom.react-server`,\n 'next/dist/compiled/react-dom-experimental$': `next/dist/compiled/react-dom-experimental/react-dom.react-server`,\n })\n }\n }\n\n if (reactProductionProfiling) {\n alias['react-dom/client$'] =\n `next/dist/compiled/react-dom${bundledReactChannel}/profiling`\n }\n\n alias[\n '@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.ts'\n ] = `next/dist/client/dev/noop-turbopack-hmr`\n\n return alias\n}\n\n// Insert aliases for Next.js stubs of fetch, object-assign, and url\n// Keep in sync with insert_optimized_module_aliases in import_map.rs\nexport function getOptimizedModuleAliases(): CompilerAliases {\n return {\n unfetch: require.resolve('next/dist/build/polyfills/fetch/index.js'),\n 'isomorphic-unfetch': require.resolve(\n 'next/dist/build/polyfills/fetch/index.js'\n ),\n 'whatwg-fetch': require.resolve(\n 'next/dist/build/polyfills/fetch/whatwg-fetch.js'\n ),\n 'object-assign': require.resolve(\n 'next/dist/build/polyfills/object-assign.js'\n ),\n 'object.assign/auto': require.resolve(\n 'next/dist/build/polyfills/object.assign/auto.js'\n ),\n 'object.assign/implementation': require.resolve(\n 'next/dist/build/polyfills/object.assign/implementation.js'\n ),\n 'object.assign/polyfill': require.resolve(\n 'next/dist/build/polyfills/object.assign/polyfill.js'\n ),\n 'object.assign/shim': require.resolve(\n 'next/dist/build/polyfills/object.assign/shim.js'\n ),\n url: require.resolve('next/dist/compiled/native-url'),\n }\n}\n\n// Alias these modules to be resolved with \"module\" if possible.\nfunction getBarrelOptimizationAliases(packages: string[]): CompilerAliases {\n const aliases: { [pkg: string]: string } = {}\n const mainFields = ['module', 'main']\n\n for (const pkg of packages) {\n try {\n const descriptionFileData = require(`${pkg}/package.json`)\n const descriptionFilePath = require.resolve(`${pkg}/package.json`)\n\n for (const field of mainFields) {\n if (descriptionFileData.hasOwnProperty(field)) {\n aliases[pkg + '$'] = path.join(\n path.dirname(descriptionFilePath),\n descriptionFileData[field]\n )\n break\n }\n }\n } catch {}\n }\n\n return aliases\n}\nfunction getReactProfilingInProduction(): CompilerAliases {\n return {\n 'react-dom/client$': 'react-dom/profiling',\n }\n}\n"],"names":["createAppRouterApiAliases","createNextApiEsmAliases","createRSCAliases","createServerOnlyClientOnlyAliases","createWebpackAliases","getOptimizedModuleAliases","isReact19","React","use","distDir","isClient","isEdgeServer","isNodeServer","dev","config","pagesDir","appDir","dir","reactProductionProfiling","hasRewrites","pageExtensions","clientResolveRewrites","require","resolve","customAppAliases","customDocumentAliases","nextDistPath","PAGES_DIR_ALIAS","reduce","prev","ext","push","path","join","undefined","hasExternalOtelApiPackage","images","loaderFile","defaultOverrides","APP_DIR_ALIAS","ROOT_DIR_ALIAS","DOT_NEXT_ALIAS","getReactProfilingInProduction","getBarrelOptimizationAliases","experimental","optimizePackageImports","RSC_ACTION_VALIDATE_ALIAS","RSC_ACTION_CLIENT_WRAPPER_ALIAS","RSC_ACTION_PROXY_ALIAS","RSC_ACTION_ENCRYPTION_ALIAS","RSC_CACHE_WRAPPER_ALIAS","dirname","setimmediate","isServer","mapping","head","image","constants","router","dynamic","script","link","form","navigation","headers","og","server","document","app","aliasMap","key","value","Object","entries","nextApiFilePath","NEXT_PROJECT_ROOT","isServerOnlyLayer","bundledReactChannel","layer","isWebpackServerOnlyLayer","WEBPACK_LAYERS","reactServerComponents","alias","react$","serverSideRendering","assign","unfetch","url","packages","aliases","mainFields","pkg","descriptionFileData","descriptionFilePath","field","hasOwnProperty"],"mappings":";;;;;;;;;;;;;;;;;;;IA2OgBA,yBAAyB;eAAzBA;;IA5BAC,uBAAuB;eAAvBA;;IAgD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F,gBAAgBD,QAAQC,OAAO,CAC7B;QAEF,iBAAiBD,QAAQC,OAAO,CAC9B;QAEF,sBAAsBD,QAAQC,OAAO,CACnC;QAEF,gCAAgCD,QAAQC,OAAO,CAC7C;QAEF,0BAA0BD,QAAQC,OAAO,CACvC;QAEF,sBAAsBD,QAAQC,OAAO,CACnC;QAEFgE,KAAKjE,QAAQC,OAAO,CAAC;IACvB;AACF;AAEA,gEAAgE;AAChE,SAASoB,6BAA6B6C,QAAkB;IACtD,MAAMC,UAAqC,CAAC;IAC5C,MAAMC,aAAa;QAAC;QAAU;KAAO;IAErC,KAAK,MAAMC,OAAOH,SAAU;QAC1B,IAAI;YACF,MAAMI,sBAAsBtE,QAAQ,GAAGqE,IAAI,aAAa,CAAC;YACzD,MAAME,sBAAsBvE,QAAQC,OAAO,CAAC,GAAGoE,IAAI,aAAa,CAAC;YAEjE,KAAK,MAAMG,SAASJ,WAAY;gBAC9B,IAAIE,oBAAoBG,cAAc,CAACD,QAAQ;oBAC7CL,OAAO,CAACE,MAAM,IAAI,GAAG3D,aAAI,CAACC,IAAI,CAC5BD,aAAI,CAACmB,OAAO,CAAC0C,sBACbD,mBAAmB,CAACE,MAAM;oBAE5B;gBACF;YACF;QACF,EAAE,OAAM,CAAC;IACX;IAEA,OAAOL;AACT;AACA,SAAS/C;IACP,OAAO;QACL,qBAAqB;IACvB;AACF"}
1
+ {"version":3,"sources":["../../src/build/create-compiler-aliases.ts"],"sourcesContent":["import path from 'path'\nimport * as React from 'react'\nimport {\n DOT_NEXT_ALIAS,\n PAGES_DIR_ALIAS,\n ROOT_DIR_ALIAS,\n APP_DIR_ALIAS,\n RSC_ACTION_PROXY_ALIAS,\n RSC_ACTION_CLIENT_WRAPPER_ALIAS,\n RSC_ACTION_VALIDATE_ALIAS,\n RSC_ACTION_ENCRYPTION_ALIAS,\n RSC_CACHE_WRAPPER_ALIAS,\n type WebpackLayerName,\n} from '../lib/constants'\nimport type { NextConfigComplete } from '../server/config-shared'\nimport { defaultOverrides } from '../server/require-hook'\nimport { hasExternalOtelApiPackage } from './webpack-config'\nimport { NEXT_PROJECT_ROOT } from './next-dir-paths'\nimport { WEBPACK_LAYERS } from '../lib/constants'\nimport { isWebpackServerOnlyLayer } from './utils'\n\ninterface CompilerAliases {\n [alias: string]: string | string[]\n}\n\nconst isReact19 = typeof React.use === 'function'\n\nexport function createWebpackAliases({\n distDir,\n isClient,\n isEdgeServer,\n isNodeServer,\n dev,\n config,\n pagesDir,\n appDir,\n dir,\n reactProductionProfiling,\n hasRewrites,\n}: {\n distDir: string\n isClient: boolean\n isEdgeServer: boolean\n isNodeServer: boolean\n dev: boolean\n config: NextConfigComplete\n pagesDir: string | undefined\n appDir: string | undefined\n dir: string\n reactProductionProfiling: boolean\n hasRewrites: boolean\n}): CompilerAliases {\n const pageExtensions = config.pageExtensions\n const clientResolveRewrites = require.resolve(\n '../shared/lib/router/utils/resolve-rewrites'\n )\n const customAppAliases: CompilerAliases = {}\n const customDocumentAliases: CompilerAliases = {}\n\n // tell webpack where to look for _app and _document\n // using aliases to allow falling back to the default\n // version when removed or not present\n if (dev) {\n const nextDistPath = 'next/dist/' + (isEdgeServer ? 'esm/' : '')\n customAppAliases[`${PAGES_DIR_ALIAS}/_app`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_app.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_app.js`,\n ]\n customAppAliases[`${PAGES_DIR_ALIAS}/_error`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_error.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_error.js`,\n ]\n customDocumentAliases[`${PAGES_DIR_ALIAS}/_document`] = [\n ...(pagesDir\n ? pageExtensions.reduce((prev, ext) => {\n prev.push(path.join(pagesDir, `_document.${ext}`))\n return prev\n }, [] as string[])\n : []),\n `${nextDistPath}pages/_document.js`,\n ]\n }\n\n return {\n '@vercel/og$': 'next/dist/server/og/image-response',\n\n // Avoid bundling both entrypoints in React 19 when we just need one.\n // Also avoids bundler warnings in React 18 where react-dom/server.edge doesn't exist.\n 'next/dist/server/ReactDOMServerPages': isReact19\n ? 'react-dom/server.edge'\n : 'react-dom/server.browser',\n\n // Alias next/dist imports to next/dist/esm assets,\n // let this alias hit before `next` alias.\n ...(isEdgeServer\n ? {\n 'next/dist/api': 'next/dist/esm/api',\n 'next/dist/build': 'next/dist/esm/build',\n 'next/dist/client': 'next/dist/esm/client',\n 'next/dist/shared': 'next/dist/esm/shared',\n 'next/dist/pages': 'next/dist/esm/pages',\n 'next/dist/lib': 'next/dist/esm/lib',\n 'next/dist/server': 'next/dist/esm/server',\n\n ...createNextApiEsmAliases(),\n }\n : undefined),\n\n // For RSC server bundle\n ...(!hasExternalOtelApiPackage() && {\n '@opentelemetry/api': 'next/dist/compiled/@opentelemetry/api',\n }),\n\n ...(config.images.loaderFile\n ? {\n 'next/dist/shared/lib/image-loader': config.images.loaderFile,\n ...(isEdgeServer && {\n 'next/dist/esm/shared/lib/image-loader': config.images.loaderFile,\n }),\n }\n : undefined),\n\n 'styled-jsx/style$': defaultOverrides['styled-jsx/style'],\n 'styled-jsx$': defaultOverrides['styled-jsx'],\n\n ...customAppAliases,\n ...customDocumentAliases,\n\n ...(pagesDir ? { [PAGES_DIR_ALIAS]: pagesDir } : {}),\n ...(appDir ? { [APP_DIR_ALIAS]: appDir } : {}),\n [ROOT_DIR_ALIAS]: dir,\n ...(isClient\n ? {\n 'private-next-instrumentation-client': [\n path.join(dir, 'src', 'instrumentation-client'),\n path.join(dir, 'instrumentation-client'),\n 'private-next-empty-module',\n ],\n\n // disable typechecker, webpack5 allows aliases to be set to false to create a no-op module\n 'private-next-empty-module': false as any,\n }\n : {}),\n\n [DOT_NEXT_ALIAS]: distDir,\n ...(isClient || isEdgeServer ? getOptimizedModuleAliases() : {}),\n ...(reactProductionProfiling ? getReactProfilingInProduction() : {}),\n\n // For Node server, we need to re-alias the package imports to prefer to\n // resolve to the ESM export.\n ...(isNodeServer\n ? getBarrelOptimizationAliases(\n config.experimental.optimizePackageImports || []\n )\n : {}),\n\n [RSC_ACTION_VALIDATE_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/action-validate',\n\n [RSC_ACTION_CLIENT_WRAPPER_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/action-client-wrapper',\n\n [RSC_ACTION_PROXY_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/server-reference',\n\n [RSC_ACTION_ENCRYPTION_ALIAS]: 'next/dist/server/app-render/encryption',\n\n [RSC_CACHE_WRAPPER_ALIAS]:\n 'next/dist/build/webpack/loaders/next-flight-loader/cache-wrapper',\n\n ...(isClient || isEdgeServer\n ? {\n [clientResolveRewrites]: hasRewrites\n ? clientResolveRewrites\n : // With webpack 5 an alias can be pointed to false to noop\n false,\n }\n : {}),\n\n '@swc/helpers/_': path.join(\n path.dirname(require.resolve('@swc/helpers/package.json')),\n '_'\n ),\n\n setimmediate: 'next/dist/compiled/setimmediate',\n }\n}\n\nexport function createServerOnlyClientOnlyAliases(\n isServer: boolean\n): CompilerAliases {\n return isServer\n ? {\n 'server-only$': 'next/dist/compiled/server-only/empty',\n 'client-only$': 'next/dist/compiled/client-only/error',\n 'next/dist/compiled/server-only$':\n 'next/dist/compiled/server-only/empty',\n 'next/dist/compiled/client-only$':\n 'next/dist/compiled/client-only/error',\n }\n : {\n 'server-only$': 'next/dist/compiled/server-only/index',\n 'client-only$': 'next/dist/compiled/client-only/index',\n 'next/dist/compiled/client-only$':\n 'next/dist/compiled/client-only/index',\n 'next/dist/compiled/server-only':\n 'next/dist/compiled/server-only/index',\n }\n}\n\nexport function createNextApiEsmAliases() {\n const mapping = {\n head: 'next/dist/api/head',\n image: 'next/dist/api/image',\n constants: 'next/dist/api/constants',\n router: 'next/dist/api/router',\n dynamic: 'next/dist/api/dynamic',\n script: 'next/dist/api/script',\n link: 'next/dist/api/link',\n form: 'next/dist/api/form',\n navigation: 'next/dist/api/navigation',\n headers: 'next/dist/api/headers',\n og: 'next/dist/api/og',\n server: 'next/dist/api/server',\n // pages api\n document: 'next/dist/api/document',\n app: 'next/dist/api/app',\n }\n const aliasMap: Record<string, string> = {}\n // Handle fully specified imports like `next/image.js`\n for (const [key, value] of Object.entries(mapping)) {\n const nextApiFilePath = path.join(NEXT_PROJECT_ROOT, key)\n aliasMap[nextApiFilePath + '.js'] = value\n }\n\n return aliasMap\n}\n\nexport function createAppRouterApiAliases(isServerOnlyLayer: boolean) {\n const mapping: Record<string, string> = {\n head: 'next/dist/client/components/noop-head',\n dynamic: 'next/dist/api/app-dynamic',\n link: 'next/dist/client/app-dir/link',\n form: 'next/dist/client/app-dir/form',\n }\n\n if (isServerOnlyLayer) {\n mapping['navigation'] = 'next/dist/api/navigation.react-server'\n }\n\n const aliasMap: Record<string, string> = {}\n for (const [key, value] of Object.entries(mapping)) {\n const nextApiFilePath = path.join(NEXT_PROJECT_ROOT, key)\n aliasMap[nextApiFilePath + '.js'] = value\n }\n return aliasMap\n}\n\nexport function createRSCAliases(\n bundledReactChannel: string,\n {\n layer,\n isEdgeServer,\n reactProductionProfiling,\n }: {\n layer: WebpackLayerName\n isEdgeServer: boolean\n reactProductionProfiling: boolean\n }\n): CompilerAliases {\n const isServerOnlyLayer = isWebpackServerOnlyLayer(layer)\n // For middleware, instrumentation layers, treat them as rsc layer.\n // Since we only built the runtime package for rsc, convert everything to rsc\n // to ensure the runtime modules path existed.\n if (isServerOnlyLayer) {\n layer = WEBPACK_LAYERS.reactServerComponents\n }\n\n let alias: Record<string, string> = {\n react$: `next/dist/compiled/react${bundledReactChannel}`,\n 'react-dom$': `next/dist/compiled/react-dom${bundledReactChannel}`,\n 'react/jsx-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-runtime`,\n 'react/jsx-dev-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime`,\n 'react/compiler-runtime$': `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'react-dom/client$': `next/dist/compiled/react-dom${bundledReactChannel}/client`,\n 'react-dom/server$': `next/dist/compiled/react-dom${bundledReactChannel}/server`,\n 'react-dom/server.browser$': `next/dist/compiled/react-dom${bundledReactChannel}/server.browser`,\n 'react-dom/static$': `next/dist/compiled/react-dom${bundledReactChannel}/static`,\n 'react-dom/static.edge$': `next/dist/compiled/react-dom${bundledReactChannel}/static.edge`,\n 'react-dom/static.browser$': `next/dist/compiled/react-dom${bundledReactChannel}/static.browser`,\n // optimizations to ignore the legacy build of react-dom/server in `server.edge` build\n 'react-dom/server.edge$': `next/dist/build/webpack/alias/react-dom-server-edge${bundledReactChannel}.js`,\n // react-server-dom-webpack alias\n 'react-server-dom-webpack/client$': `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client`,\n 'react-server-dom-webpack/client.edge$': `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/client.edge`,\n 'react-server-dom-webpack/server.edge$': `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.edge`,\n 'react-server-dom-webpack/server.node$': `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/server.node`,\n 'react-server-dom-webpack/static.edge$': `next/dist/compiled/react-server-dom-webpack${bundledReactChannel}/static.edge`,\n }\n\n if (!isEdgeServer) {\n if (layer === WEBPACK_LAYERS.serverSideRendering) {\n alias = Object.assign(alias, {\n 'react/jsx-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-jsx-runtime`,\n 'react/jsx-dev-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-jsx-dev-runtime`,\n 'react/compiler-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-compiler-runtime`,\n react$: `next/dist/server/route-modules/app-page/vendored/${layer}/react`,\n 'react-dom$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-dom`,\n 'react-server-dom-webpack/client.edge$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-server-dom-webpack-client-edge`,\n })\n } else if (layer === WEBPACK_LAYERS.reactServerComponents) {\n alias = Object.assign(alias, {\n 'react/jsx-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-jsx-runtime`,\n 'react/jsx-dev-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-jsx-dev-runtime`,\n 'react/compiler-runtime$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-compiler-runtime`,\n react$: `next/dist/server/route-modules/app-page/vendored/${layer}/react`,\n 'react-dom$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-dom`,\n 'react-server-dom-webpack/server.edge$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-server-dom-webpack-server-edge`,\n 'react-server-dom-webpack/server.node$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-server-dom-webpack-server-node`,\n 'react-server-dom-webpack/static.edge$': `next/dist/server/route-modules/app-page/vendored/${layer}/react-server-dom-webpack-static-edge`,\n })\n }\n }\n\n if (isEdgeServer) {\n if (layer === WEBPACK_LAYERS.reactServerComponents) {\n alias = Object.assign(alias, {\n react$: `next/dist/compiled/react${bundledReactChannel}/react.react-server`,\n 'next/dist/compiled/react$': `next/dist/compiled/react${bundledReactChannel}/react.react-server`,\n 'next/dist/compiled/react-experimental$': `next/dist/compiled/react-experimental/react.react-server`,\n 'react/jsx-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-runtime.react-server`,\n 'react/compiler-runtime$': `next/dist/compiled/react${bundledReactChannel}/compiler-runtime`,\n 'next/dist/compiled/react/jsx-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-runtime.react-server`,\n 'next/dist/compiled/react-experimental/jsx-runtime$': `next/dist/compiled/react-experimental/jsx-runtime.react-server`,\n 'react/jsx-dev-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime.react-server`,\n 'next/dist/compiled/react/jsx-dev-runtime$': `next/dist/compiled/react${bundledReactChannel}/jsx-dev-runtime.react-server`,\n 'next/dist/compiled/react-experimental/jsx-dev-runtime$': `next/dist/compiled/react-experimental/jsx-dev-runtime.react-server`,\n 'react-dom$': `next/dist/compiled/react-dom${bundledReactChannel}/react-dom.react-server`,\n 'next/dist/compiled/react-dom$': `next/dist/compiled/react-dom${bundledReactChannel}/react-dom.react-server`,\n 'next/dist/compiled/react-dom-experimental$': `next/dist/compiled/react-dom-experimental/react-dom.react-server`,\n })\n }\n }\n\n if (reactProductionProfiling) {\n alias['react-dom/client$'] =\n `next/dist/compiled/react-dom${bundledReactChannel}/profiling`\n }\n\n alias[\n '@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.ts'\n ] = `next/dist/client/dev/noop-turbopack-hmr`\n\n return alias\n}\n\n// Insert aliases for Next.js stubs of fetch, object-assign, and url\n// Keep in sync with insert_optimized_module_aliases in import_map.rs\nexport function getOptimizedModuleAliases(): CompilerAliases {\n return {\n unfetch: require.resolve('next/dist/build/polyfills/fetch/index.js'),\n 'isomorphic-unfetch': require.resolve(\n 'next/dist/build/polyfills/fetch/index.js'\n ),\n 'whatwg-fetch': require.resolve(\n 'next/dist/build/polyfills/fetch/whatwg-fetch.js'\n ),\n 'object-assign': require.resolve(\n 'next/dist/build/polyfills/object-assign.js'\n ),\n 'object.assign/auto': require.resolve(\n 'next/dist/build/polyfills/object.assign/auto.js'\n ),\n 'object.assign/implementation': require.resolve(\n 'next/dist/build/polyfills/object.assign/implementation.js'\n ),\n 'object.assign/polyfill': require.resolve(\n 'next/dist/build/polyfills/object.assign/polyfill.js'\n ),\n 'object.assign/shim': require.resolve(\n 'next/dist/build/polyfills/object.assign/shim.js'\n ),\n url: require.resolve('next/dist/compiled/native-url'),\n }\n}\n\n// Alias these modules to be resolved with \"module\" if possible.\nfunction getBarrelOptimizationAliases(packages: string[]): CompilerAliases {\n const aliases: { [pkg: string]: string } = {}\n const mainFields = ['module', 'main']\n\n for (const pkg of packages) {\n try {\n const descriptionFileData = require(`${pkg}/package.json`)\n const descriptionFilePath = require.resolve(`${pkg}/package.json`)\n\n for (const field of mainFields) {\n if (descriptionFileData.hasOwnProperty(field)) {\n aliases[pkg + '$'] = path.join(\n path.dirname(descriptionFilePath),\n descriptionFileData[field]\n )\n break\n }\n }\n } catch {}\n }\n\n return aliases\n}\nfunction getReactProfilingInProduction(): CompilerAliases {\n return {\n 'react-dom/client$': 'react-dom/profiling',\n }\n}\n"],"names":["createAppRouterApiAliases","createNextApiEsmAliases","createRSCAliases","createServerOnlyClientOnlyAliases","createWebpackAliases","getOptimizedModuleAliases","isReact19","React","use","distDir","isClient","isEdgeServer","isNodeServer","dev","config","pagesDir","appDir","dir","reactProductionProfiling","hasRewrites","pageExtensions","clientResolveRewrites","require","resolve","customAppAliases","customDocumentAliases","nextDistPath","PAGES_DIR_ALIAS","reduce","prev","ext","push","path","join","undefined","hasExternalOtelApiPackage","images","loaderFile","defaultOverrides","APP_DIR_ALIAS","ROOT_DIR_ALIAS","DOT_NEXT_ALIAS","getReactProfilingInProduction","getBarrelOptimizationAliases","experimental","optimizePackageImports","RSC_ACTION_VALIDATE_ALIAS","RSC_ACTION_CLIENT_WRAPPER_ALIAS","RSC_ACTION_PROXY_ALIAS","RSC_ACTION_ENCRYPTION_ALIAS","RSC_CACHE_WRAPPER_ALIAS","dirname","setimmediate","isServer","mapping","head","image","constants","router","dynamic","script","link","form","navigation","headers","og","server","document","app","aliasMap","key","value","Object","entries","nextApiFilePath","NEXT_PROJECT_ROOT","isServerOnlyLayer","bundledReactChannel","layer","isWebpackServerOnlyLayer","WEBPACK_LAYERS","reactServerComponents","alias","react$","serverSideRendering","assign","unfetch","url","packages","aliases","mainFields","pkg","descriptionFileData","descriptionFilePath","field","hasOwnProperty"],"mappings":";;;;;;;;;;;;;;;;;;;IAwPgBA,yBAAyB;eAAzBA;;IA5BAC,uBAAuB;eAAvBA;;IAgDAC,gBAAgB;eAAhBA;;IAtEAC,iCAAiC;eAAjCA;;IA3KAC,oBAAoB;eAApBA;;IAqVAC,yBAAyB;eAA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S7E;IACd,OAAO;QACLiF,SAAShE,QAAQC,OAAO,CAAC;QACzB,sBAAsBD,QAAQC,OAAO,CACnC;QAEF,gBAAgBD,QAAQC,OAAO,CAC7B;QAEF,iBAAiBD,QAAQC,OAAO,CAC9B;QAEF,sBAAsBD,QAAQC,OAAO,CACnC;QAEF,gCAAgCD,QAAQC,OAAO,CAC7C;QAEF,0BAA0BD,QAAQC,OAAO,CACvC;QAEF,sBAAsBD,QAAQC,OAAO,CACnC;QAEFgE,KAAKjE,QAAQC,OAAO,CAAC;IACvB;AACF;AAEA,gEAAgE;AAChE,SAASoB,6BAA6B6C,QAAkB;IACtD,MAAMC,UAAqC,CAAC;IAC5C,MAAMC,aAAa;QAAC;QAAU;KAAO;IAErC,KAAK,MAAMC,OAAOH,SAAU;QAC1B,IAAI;YACF,MAAMI,sBAAsBtE,QAAQ,GAAGqE,IAAI,aAAa,CAAC;YACzD,MAAME,sBAAsBvE,QAAQC,OAAO,CAAC,GAAGoE,IAAI,aAAa,CAAC;YAEjE,KAAK,MAAMG,SAASJ,WAAY;gBAC9B,IAAIE,oBAAoBG,cAAc,CAACD,QAAQ;oBAC7CL,OAAO,CAACE,MAAM,IAAI,GAAG3D,aAAI,CAACC,IAAI,CAC5BD,aAAI,CAACmB,OAAO,CAAC0C,sBACbD,mBAAmB,CAACE,MAAM;oBAE5B;gBACF;YACF;QACF,EAAE,OAAM,CAAC;IACX;IAEA,OAAOL;AACT;AACA,SAAS/C;IACP,OAAO;QACL,qBAAqB;IACvB;AACF"}
@@ -220,5 +220,5 @@ export declare function createStaticWorker(config: NextConfigComplete, progress?
220
220
  run: () => void;
221
221
  clear: () => void;
222
222
  }): StaticWorker;
223
- export default function build(dir: string, reactProductionProfiling: boolean | undefined, debugOutput: boolean | undefined, runLint: boolean | undefined, noMangling: boolean | undefined, appDirOnly: boolean | undefined, turboNextBuild: boolean | undefined, experimentalBuildMode: 'default' | 'compile' | 'generate', traceUploadUrl: string | undefined): Promise<void>;
223
+ export default function build(dir: string, reactProductionProfiling: boolean | undefined, debugOutput: boolean | undefined, runLint: boolean | undefined, noMangling: boolean | undefined, appDirOnly: boolean | undefined, turboNextBuild: boolean | undefined, experimentalBuildMode: 'default' | 'compile' | 'generate' | 'generate-env', traceUploadUrl: string | undefined): Promise<void>;
224
224
  export {};
@@ -368,7 +368,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
368
368
  const nextBuildSpan = (0, _trace.trace)('next-build', undefined, {
369
369
  buildMode: experimentalBuildMode,
370
370
  isTurboBuild: String(turboNextBuild),
371
- version: "15.3.0-canary.5"
371
+ version: "15.3.0-canary.8"
372
372
  });
373
373
  _buildcontext.NextBuildContext.nextBuildSpan = nextBuildSpan;
374
374
  _buildcontext.NextBuildContext.dir = dir;
@@ -400,6 +400,23 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
400
400
  (0, _trace.setGlobal)('distDir', distDir);
401
401
  const buildId = await getBuildId(isGenerateMode, distDir, nextBuildSpan, config);
402
402
  _buildcontext.NextBuildContext.buildId = buildId;
403
+ if (experimentalBuildMode === 'generate-env') {
404
+ if (turboNextBuild) {
405
+ _log.warn('generate-env is not needed with turbopack');
406
+ process.exit(0);
407
+ }
408
+ _log.info('Inlining static env ...');
409
+ await nextBuildSpan.traceChild('inline-static-env').traceAsyncFn(async ()=>{
410
+ await (0, _inlinestaticenv.inlineStaticEnv)({
411
+ distDir,
412
+ config
413
+ });
414
+ });
415
+ _log.info('Complete');
416
+ await (0, _trace.flushAllTraces)();
417
+ (0, _swc.teardownTraceSubscriber)();
418
+ process.exit(0);
419
+ }
403
420
  // when using compile mode static env isn't inlined so we
404
421
  // need to populate in normal runtime env
405
422
  if (isCompileMode || isGenerateMode) {
@@ -732,7 +749,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
732
749
  // Files outside of the distDir can be "type": "module"
733
750
  await writeFileUtf8(_path.default.join(distDir, 'package.json'), '{"type": "commonjs"}');
734
751
  // These are written to distDir, so they need to come after creating and cleaning distDr.
735
- await (0, _builddiagnostics.recordFrameworkVersion)("15.3.0-canary.5");
752
+ await (0, _builddiagnostics.recordFrameworkVersion)("15.3.0-canary.8");
736
753
  await (0, _builddiagnostics.updateBuildDiagnostics)({
737
754
  buildStage: 'start'
738
755
  });
@@ -1310,7 +1327,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
1310
1327
  cacheHandlers: normalizedCacheHandlers,
1311
1328
  trustHostHeader: _ciinfo.hasNextSupport,
1312
1329
  // @ts-expect-error internal field TODO: fix this, should use a separate mechanism to pass the info.
1313
- isExperimentalCompile: isCompileMode || isGenerateMode && config.experimental.generateOnlyEnv
1330
+ isExperimentalCompile: isCompileMode
1314
1331
  }
1315
1332
  },
1316
1333
  appDir: dir,
@@ -1475,20 +1492,13 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
1475
1492
  // we don't need to inline for turbopack build as
1476
1493
  // it will handle it's own caching separate of compile
1477
1494
  if (isGenerateMode && !turboNextBuild) {
1495
+ _log.info('Inlining static env ...');
1478
1496
  await nextBuildSpan.traceChild('inline-static-env').traceAsyncFn(async ()=>{
1479
1497
  await (0, _inlinestaticenv.inlineStaticEnv)({
1480
1498
  distDir,
1481
1499
  config
1482
1500
  });
1483
1501
  });
1484
- // users might only want to inline env during experimental generate
1485
- // instead of also prerendering e.g. for test mode so exit after
1486
- if (config.experimental.generateOnlyEnv) {
1487
- _log.info('Inlined static env, exiting due to experimental.generateOnlyEnv');
1488
- await (0, _trace.flushAllTraces)();
1489
- (0, _swc.teardownTraceSubscriber)();
1490
- process.exit(0);
1491
- }
1492
1502
  }
1493
1503
  const middlewareManifest = await readManifest(_path.default.join(distDir, _constants1.SERVER_DIRECTORY, _constants1.MIDDLEWARE_MANIFEST));
1494
1504
  const prerenderManifest = {
@@ -2260,6 +2270,9 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
2260
2270
  buildTracesSpinner.stopAndPersist();
2261
2271
  buildTracesSpinner = undefined;
2262
2272
  }
2273
+ if (isCompileMode) {
2274
+ _log.info(`Build ran with "compile" mode, to finalize the build run either "generate" or "generate-env" mode as well`);
2275
+ }
2263
2276
  if (config.output === 'export') {
2264
2277
  await writeFullyStaticExport(config, dir, enabledDirectories, configOutDir, nextBuildSpan);
2265
2278
  }