next 15.6.0-canary.37 → 15.6.0-canary.38

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 (53) hide show
  1. package/dist/bin/next +3 -3
  2. package/dist/bin/next.map +1 -1
  3. package/dist/build/index.d.ts +1 -2
  4. package/dist/build/index.js +25 -35
  5. package/dist/build/index.js.map +1 -1
  6. package/dist/build/swc/index.js +1 -1
  7. package/dist/build/webpack-config.js +2 -2
  8. package/dist/cli/next-build.d.ts +0 -1
  9. package/dist/cli/next-build.js +5 -3
  10. package/dist/cli/next-build.js.map +1 -1
  11. package/dist/cli/next-dev.d.ts +0 -1
  12. package/dist/cli/next-dev.js +13 -13
  13. package/dist/cli/next-dev.js.map +1 -1
  14. package/dist/client/app-bootstrap.js +1 -1
  15. package/dist/client/index.js +1 -1
  16. package/dist/compiled/next-server/pages-api.runtime.dev.js +1 -1
  17. package/dist/compiled/next-server/pages-api.runtime.dev.js.map +1 -1
  18. package/dist/compiled/next-server/pages.runtime.dev.js +1 -1
  19. package/dist/compiled/next-server/pages.runtime.dev.js.map +1 -1
  20. package/dist/esm/build/index.js +25 -35
  21. package/dist/esm/build/index.js.map +1 -1
  22. package/dist/esm/build/swc/index.js +1 -1
  23. package/dist/esm/build/webpack-config.js +2 -2
  24. package/dist/esm/client/app-bootstrap.js +1 -1
  25. package/dist/esm/client/index.js +1 -1
  26. package/dist/esm/lib/turbopack-warning.js +7 -19
  27. package/dist/esm/lib/turbopack-warning.js.map +1 -1
  28. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  29. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  30. package/dist/esm/server/lib/app-info-log.js +1 -1
  31. package/dist/esm/server/lib/start-server.js +1 -1
  32. package/dist/esm/server/next.js +1 -2
  33. package/dist/esm/server/next.js.map +1 -1
  34. package/dist/esm/shared/lib/canary-only.js +1 -1
  35. package/dist/lib/turbopack-warning.d.ts +2 -3
  36. package/dist/lib/turbopack-warning.js +6 -18
  37. package/dist/lib/turbopack-warning.js.map +1 -1
  38. package/dist/server/dev/hot-reloader-turbopack.js +1 -1
  39. package/dist/server/dev/hot-reloader-webpack.js +1 -1
  40. package/dist/server/lib/app-info-log.js +1 -1
  41. package/dist/server/lib/start-server.js +1 -1
  42. package/dist/server/next.js +1 -2
  43. package/dist/server/next.js.map +1 -1
  44. package/dist/shared/lib/canary-only.js +1 -1
  45. package/dist/telemetry/anonymous-meta.js +1 -1
  46. package/dist/telemetry/events/session-stopped.js +2 -2
  47. package/dist/telemetry/events/version.js +2 -2
  48. package/package.json +15 -15
  49. package/dist/esm/lib/bundler.js +0 -81
  50. package/dist/esm/lib/bundler.js.map +0 -1
  51. package/dist/lib/bundler.d.ts +0 -25
  52. package/dist/lib/bundler.js +0 -95
  53. package/dist/lib/bundler.js.map +0 -1
package/dist/bin/next CHANGED
@@ -79,8 +79,8 @@ 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.6.0-canary.37"}`, '-v, --version', 'Outputs the Next.js version.');
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('--debug-prerender', 'Enables debug mode for prerendering. Not for production use!').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.').option('--turbo', 'Builds using Turbopack.').option('--turbopack', 'Builds using Turbopack.').option('--webpack', 'Builds using webpack.').addOption(new _commander.Option('--experimental-build-mode [mode]', 'Uses an experimental build mode.').choices([
82
+ }).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.6.0-canary.38"}`, '-v, --version', 'Outputs the Next.js version.');
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('--debug-prerender', 'Enables debug mode for prerendering. Not for production use!').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.').option('--turbo', 'Starts development mode using Turbopack.').option('--turbopack', 'Starts development mode using Turbopack.').addOption(new _commander.Option('--experimental-build-mode [mode]', 'Uses an experimental build mode.').choices([
84
84
  'compile',
85
85
  'generate',
86
86
  'generate-env'
@@ -89,7 +89,7 @@ program.command('build').description('Creates an optimized production build of y
89
89
  import('../cli/next-build.js').then((mod)=>mod.nextBuild(options, directory).then(()=>process.exit(0)))).usage('[directory] [options]');
90
90
  program.command('dev', {
91
91
  isDefault: true
92
- }).description('Starts Next.js in development mode with hot-code reloading, error reporting, and more.').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('--turbo', 'Starts development mode using Turbopack.').option('--turbopack', 'Starts development mode using Turbopack.').option('--webpack', 'Starts development mode using webpack.').addOption(new _commander.Option('-p, --port <port>', 'Specify a port number on which to start the application.').argParser(_utils.parseValidPositiveInteger).default(3000).env('PORT')).option('-H, --hostname <hostname>', 'Specify a hostname on which to start the application (default: 0.0.0.0).').option('--disable-source-maps', "Don't start the Dev server with `--enable-source-maps`.", false).option('--experimental-https', 'Starts the server with HTTPS and generates a self-signed certificate.').option('--experimental-https-key, <path>', 'Path to a HTTPS key file.').option('--experimental-https-cert, <path>', 'Path to a HTTPS certificate file.').option('--experimental-https-ca, <path>', 'Path to a HTTPS certificate authority file.').option('--experimental-upload-trace, <traceUrl>', 'Reports a subset of the debugging trace to a remote HTTP URL. Includes sensitive data.').action((directory, options, { _optionValueSources })=>{
92
+ }).description('Starts Next.js in development mode with hot-code reloading, error reporting, and more.').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('--turbo', 'Starts development mode using Turbopack.').option('--turbopack', 'Starts development mode using Turbopack.').addOption(new _commander.Option('-p, --port <port>', 'Specify a port number on which to start the application.').argParser(_utils.parseValidPositiveInteger).default(3000).env('PORT')).option('-H, --hostname <hostname>', 'Specify a hostname on which to start the application (default: 0.0.0.0).').option('--disable-source-maps', "Don't start the Dev server with `--enable-source-maps`.", false).option('--experimental-https', 'Starts the server with HTTPS and generates a self-signed certificate.').option('--experimental-https-key, <path>', 'Path to a HTTPS key file.').option('--experimental-https-cert, <path>', 'Path to a HTTPS certificate file.').option('--experimental-https-ca, <path>', 'Path to a HTTPS certificate authority file.').option('--experimental-upload-trace, <traceUrl>', 'Reports a subset of the debugging trace to a remote HTTP URL. Includes sensitive data.').action((directory, options, { _optionValueSources })=>{
93
93
  const portSource = _optionValueSources.port;
94
94
  import('../cli/next-dev.js').then((mod)=>mod.nextDev(options, portSource, directory));
95
95
  }).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'\nimport type { NextTypegenOptions } from '../cli/next-typegen.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 .option(\n '--debug-prerender',\n 'Enables debug mode for prerendering. Not for production use!'\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 .option('--turbo', 'Builds using Turbopack.')\n .option('--turbopack', 'Builds using Turbopack.')\n .option('--webpack', 'Builds using webpack.')\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 .option('--webpack', 'Starts development mode using webpack.')\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('typegen')\n .description(\n 'Generate TypeScript definitions for routes, pages, and layouts without running a full build.'\n )\n .argument(\n '[directory]',\n `A directory on which to generate types. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .action((directory: string, options: NextTypegenOptions) =>\n // ensure process exits after typegen completes so open handles/connections\n // don't cause process to hang\n import('../cli/next-typegen.js').then((mod) =>\n mod.nextTypegen(options, directory).then(() => process.exit(0))\n )\n )\n .usage('[directory] [options]')\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('trace')\n .alias('turbo-trace-server')\n .argument('file', 'Trace file to serve.')\n .addOption(\n new Option('-p, --port <port>', 'Override the port.').argParser(\n parseValidPositiveInteger\n )\n )\n .action((file: string, options: { port: number | undefined }) => {\n return import('../cli/internal/turbo-trace-server.js').then((mod) =>\n mod.startTurboTraceServerCli(file, options.port)\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","nextTypegen","SUPPORTED_TEST_RUNNERS_LIST","join","allowUnknownOption","testRunnerArgs","nextTest","internal","alias","file","startTurboTraceServerCli","parse","argv"],"mappings":";;;;;QAEO;2BAEmC;qBAErB;+DACF;4BACgB;qCACC;2BACE;uBACI;0BAInC;;;;;;AASP,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,IA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AAC,QAAQ,wBACjB5B,SAAS,CACR,IAAIC,iBAAM,CAAC,qBAAqB,sBAAsBuC,SAAS,CAC7DC,gCAAyB,GAG5BR,MAAM,CAAC,CAACkC,MAAchC;IACrB,OAAO,MAAM,CAAC,yCAAyCC,IAAI,CAAC,CAACC,MAC3DA,IAAI+B,wBAAwB,CAACD,MAAMhC,QAAQS,IAAI;AAEnD;AAEF7B,QAAQsD,KAAK,CAAC9F,QAAQ+F,IAAI","ignoreList":[0]}
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'\nimport type { NextTypegenOptions } from '../cli/next-typegen.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 .option(\n '--debug-prerender',\n 'Enables debug mode for prerendering. Not for production use!'\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 .option('--turbo', 'Starts development mode using Turbopack.')\n .option('--turbopack', 'Starts development mode using Turbopack.')\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('typegen')\n .description(\n 'Generate TypeScript definitions for routes, pages, and layouts without running a full build.'\n )\n .argument(\n '[directory]',\n `A directory on which to generate types. ${italic(\n 'If no directory is provided, the current directory will be used.'\n )}`\n )\n .action((directory: string, options: NextTypegenOptions) =>\n // ensure process exits after typegen completes so open handles/connections\n // don't cause process to hang\n import('../cli/next-typegen.js').then((mod) =>\n mod.nextTypegen(options, directory).then(() => process.exit(0))\n )\n )\n .usage('[directory] [options]')\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('trace')\n .alias('turbo-trace-server')\n .argument('file', 'Trace file to serve.')\n .addOption(\n new Option('-p, --port <port>', 'Override the port.').argParser(\n parseValidPositiveInteger\n )\n )\n .action((file: string, options: { port: number | undefined }) => {\n return import('../cli/internal/turbo-trace-server.js').then((mod) =>\n mod.startTurboTraceServerCli(file, options.port)\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","nextTypegen","SUPPORTED_TEST_RUNNERS_LIST","join","allowUnknownOption","testRunnerArgs","nextTest","internal","alias","file","startTurboTraceServerCli","parse","argv"],"mappings":";;;;;QAEO;2BAEmC;qBAErB;+DACF;4BACgB;qCACC;2BACE;uBACI;0BAInC;;;;;;AASP,IAAIA,QAAQC,GAAG,CAACC,WAAW,EAAE;IAC3B,+BAA+B;IAC/BF,QAAQC,GAAG,CAACE,sBAAsB,GAAG;AACvC;AAEA,IACE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oC,KAAK,CAAC;AAETR,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,EACzCO,qCAA2B,CAACC,IAAI,CAAC,OACjC,EAAE,EAAEhC,IAAAA,kBAAM,EACV,6HACC,EAEJiC,kBAAkB,GAClB7B,MAAM,CACL,CAACC,WAAmB6B,gBAA0B5B;IAC5C,OAAO,MAAM,CAAC,uBAAuBC,IAAI,CAAC,CAACC;QACzCA,IAAI2B,QAAQ,CAAC9B,WAAW6B,gBAAgB5B;IAC1C;AACF,GAEDZ,KAAK,CAAC;AAET,MAAM0C,WAAWlD,QACdhB,OAAO,CAAC,YACRiB,WAAW,CACV;AAGJiD,SACGlE,OAAO,CAAC,SACRmE,KAAK,CAAC,sBACNtC,QAAQ,CAAC,QAAQ,wBACjB5B,SAAS,CACR,IAAIC,iBAAM,CAAC,qBAAqB,sBAAsBuC,SAAS,CAC7DC,gCAAyB,GAG5BR,MAAM,CAAC,CAACkC,MAAchC;IACrB,OAAO,MAAM,CAAC,yCAAyCC,IAAI,CAAC,CAACC,MAC3DA,IAAI+B,wBAAwB,CAACD,MAAMhC,QAAQS,IAAI;AAEnD;AAEF7B,QAAQsD,KAAK,CAAC9F,QAAQ+F,IAAI","ignoreList":[0]}
@@ -4,7 +4,6 @@ import '../lib/setup-exception-listeners';
4
4
  import { Worker } from '../lib/worker';
5
5
  import { RSC_PREFETCH_SUFFIX, RSC_SUFFIX, RSC_SEGMENTS_DIR_SUFFIX, RSC_SEGMENT_SUFFIX } from '../lib/constants';
6
6
  import type { Header, Redirect, Rewrite, RouteHas } from '../lib/load-custom-routes';
7
- import { Bundler } from '../lib/bundler';
8
7
  import type { __ApiPreviewProps } from '../server/api-utils';
9
8
  import type { FallbackRouteParam } from './static-paths/types';
10
9
  import { NEXT_ROUTER_PREFETCH_HEADER, RSC_HEADER, RSC_CONTENT_TYPE_HEADER, NEXT_DID_POSTPONE_HEADER, NEXT_ROUTER_SEGMENT_PREFETCH_HEADER, NEXT_REWRITTEN_PATH_HEADER, NEXT_REWRITTEN_QUERY_HEADER } from '../client/components/app-router-headers';
@@ -275,5 +274,5 @@ export declare function createStaticWorker(config: NextConfigComplete, options:
275
274
  clear: () => void;
276
275
  };
277
276
  }): StaticWorker;
278
- export default function build(dir: string, reactProductionProfiling: boolean | undefined, debugOutput: boolean | undefined, debugPrerender: boolean | undefined, runLint: boolean | undefined, noMangling: boolean | undefined, appDirOnly: boolean | undefined, bundler: Bundler | undefined, experimentalBuildMode: 'default' | 'compile' | 'generate' | 'generate-env', traceUploadUrl: string | undefined): Promise<void>;
277
+ export default function build(dir: string, reactProductionProfiling: boolean | undefined, debugOutput: boolean | undefined, debugPrerender: boolean | undefined, runLint: boolean | undefined, noMangling: boolean | undefined, appDirOnly: boolean | undefined, isTurbopack: boolean | undefined, experimentalBuildMode: 'default' | 'compile' | 'generate' | 'generate-env', traceUploadUrl: string | undefined): Promise<void>;
279
278
  export {};
@@ -42,7 +42,6 @@ const _verifypartytownsetup = require("../lib/verify-partytown-setup");
42
42
  const _constants1 = require("../shared/lib/constants");
43
43
  const _entryconstants = require("../shared/lib/entry-constants");
44
44
  const _utils = require("../shared/lib/router/utils");
45
- const _bundler = require("../lib/bundler");
46
45
  const _config = /*#__PURE__*/ _interop_require_default(require("../server/config"));
47
46
  const _normalizepagepath = require("../shared/lib/page-path/normalize-page-path");
48
47
  const _require = require("../server/require");
@@ -362,7 +361,7 @@ async function getBuildId(isGenerateMode, distDir, nextBuildSpan, config) {
362
361
  }
363
362
  return await nextBuildSpan.traceChild('generate-buildid').traceAsyncFn(()=>(0, _generatebuildid.generateBuildId)(config.generateBuildId, _indexcjs.nanoid));
364
363
  }
365
- async function build(dir, reactProductionProfiling = false, debugOutput = false, debugPrerender = false, runLint = true, noMangling = false, appDirOnly = false, bundler = _bundler.Bundler.Turbopack, experimentalBuildMode, traceUploadUrl) {
364
+ async function build(dir, reactProductionProfiling = false, debugOutput = false, debugPrerender = false, runLint = true, noMangling = false, appDirOnly = false, isTurbopack = false, experimentalBuildMode, traceUploadUrl) {
366
365
  const isCompileMode = experimentalBuildMode === 'compile';
367
366
  const isGenerateMode = experimentalBuildMode === 'generate';
368
367
  _buildcontext.NextBuildContext.isCompileMode = isCompileMode;
@@ -371,7 +370,8 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
371
370
  try {
372
371
  const nextBuildSpan = (0, _trace.trace)('next-build', undefined, {
373
372
  buildMode: experimentalBuildMode,
374
- version: "15.6.0-canary.37"
373
+ isTurboBuild: String(isTurbopack),
374
+ version: "15.6.0-canary.38"
375
375
  });
376
376
  _buildcontext.NextBuildContext.nextBuildSpan = nextBuildSpan;
377
377
  _buildcontext.NextBuildContext.dir = dir;
@@ -392,9 +392,6 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
392
392
  debugPrerender
393
393
  }), turborepoAccessTraceResult));
394
394
  loadedConfig = config;
395
- // Reading the config can modify environment variables that influence the bundler selection.
396
- bundler = (0, _bundler.finalizeBundlerFromConfig)(bundler);
397
- nextBuildSpan.setAttribute('bundler', getBundlerForTelemetry(bundler));
398
395
  process.env.NEXT_DEPLOYMENT_ID = config.deploymentId || '';
399
396
  _buildcontext.NextBuildContext.config = config;
400
397
  let configOutDir = 'out';
@@ -409,7 +406,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
409
406
  const buildId = await getBuildId(isGenerateMode, distDir, nextBuildSpan, config);
410
407
  _buildcontext.NextBuildContext.buildId = buildId;
411
408
  if (experimentalBuildMode === 'generate-env') {
412
- if (bundler === _bundler.Bundler.Turbopack) {
409
+ if (isTurbopack) {
413
410
  _log.warn('generate-env is not needed with turbopack');
414
411
  process.exit(0);
415
412
  }
@@ -703,7 +700,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
703
700
  await (0, _routetypesutils.writeValidatorFile)(routeTypesManifest, validatorFilePath);
704
701
  });
705
702
  // Turbopack already handles conflicting app and page routes.
706
- if (bundler !== _bundler.Bundler.Turbopack) {
703
+ if (!isTurbopack) {
707
704
  const numConflictingAppPaths = conflictingAppPagePaths.length;
708
705
  if (mappedAppPages && numConflictingAppPaths > 0) {
709
706
  _log.error(`Conflicting app and page file${numConflictingAppPaths === 1 ? ' was' : 's were'} found, please remove the conflicting files to continue:`);
@@ -853,7 +850,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
853
850
  // Files outside of the distDir can be "type": "module"
854
851
  await writeFileUtf8(_path.default.join(distDir, 'package.json'), '{"type": "commonjs"}');
855
852
  // These are written to distDir, so they need to come after creating and cleaning distDr.
856
- await (0, _builddiagnostics.recordFrameworkVersion)("15.6.0-canary.37");
853
+ await (0, _builddiagnostics.recordFrameworkVersion)("15.6.0-canary.38");
857
854
  await (0, _builddiagnostics.updateBuildDiagnostics)({
858
855
  buildStage: 'start'
859
856
  });
@@ -885,7 +882,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
885
882
  });
886
883
  let shutdownPromise = Promise.resolve();
887
884
  if (!isGenerateMode) {
888
- if (bundler === _bundler.Bundler.Turbopack) {
885
+ if (isTurbopack) {
889
886
  const { duration: compilerDuration, shutdownPromise: p, ...rest } = await (0, _turbopackbuild.turbopackBuild)(process.env.NEXT_TURBOPACK_USE_WORKER === undefined || process.env.NEXT_TURBOPACK_USE_WORKER !== '0');
890
887
  shutdownPromise = p;
891
888
  (0, _trace1.traceMemoryUsage)('Finished build', nextBuildSpan);
@@ -966,7 +963,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
966
963
  const durationString = (0, _durationtostring.durationToString)(durationInSeconds);
967
964
  _log.event(`Compiled successfully in ${durationString}`);
968
965
  telemetry.record((0, _events.eventBuildCompleted)(pagesPaths, {
969
- bundler: getBundlerForTelemetry(bundler),
966
+ bundler: getBundlerForTelemetry(isTurbopack),
970
967
  durationInSeconds,
971
968
  totalAppPagesCount
972
969
  }));
@@ -975,7 +972,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
975
972
  (0, _trace1.traceMemoryUsage)('Finished build', nextBuildSpan);
976
973
  buildTraceContext = rest.buildTraceContext;
977
974
  telemetry.record((0, _events.eventBuildCompleted)(pagesPaths, {
978
- bundler: getBundlerForTelemetry(bundler),
975
+ bundler: getBundlerForTelemetry(isTurbopack),
979
976
  durationInSeconds: compilerDuration,
980
977
  totalAppPagesCount
981
978
  }));
@@ -1400,7 +1397,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
1400
1397
  instrumentationHookEntryFiles.push(_path.default.join(_constants1.SERVER_DIRECTORY, `${_constants.INSTRUMENTATION_HOOK_FILENAME}.js`));
1401
1398
  // If there's edge routes, append the edge instrumentation hook
1402
1399
  // Turbopack generates this chunk with a hashed name and references it in middleware-manifest.
1403
- if (bundler !== _bundler.Bundler.Turbopack && (edgeRuntimeAppCount || edgeRuntimePagesCount)) {
1400
+ if (!isTurbopack && (edgeRuntimeAppCount || edgeRuntimePagesCount)) {
1404
1401
  instrumentationHookEntryFiles.push(_path.default.join(_constants1.SERVER_DIRECTORY, `edge-${_constants.INSTRUMENTATION_HOOK_FILENAME}.js`));
1405
1402
  }
1406
1403
  }
@@ -1437,7 +1434,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
1437
1434
  _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.FUNCTIONS_CONFIG_MANIFEST),
1438
1435
  _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.MIDDLEWARE_MANIFEST),
1439
1436
  _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.MIDDLEWARE_BUILD_MANIFEST + '.js'),
1440
- ...bundler !== _bundler.Bundler.Turbopack ? [
1437
+ ...!isTurbopack ? [
1441
1438
  _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.MIDDLEWARE_REACT_LOADABLE_MANIFEST + '.js'),
1442
1439
  _constants1.REACT_LOADABLE_MANIFEST
1443
1440
  ] : [],
@@ -1451,7 +1448,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
1451
1448
  _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.SERVER_REFERENCE_MANIFEST + '.js'),
1452
1449
  _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.SERVER_REFERENCE_MANIFEST + '.json')
1453
1450
  ] : [],
1454
- ...pagesDir && bundler !== _bundler.Bundler.Turbopack ? [
1451
+ ...pagesDir && !isTurbopack ? [
1455
1452
  _constants1.DYNAMIC_CSS_MANIFEST + '.json',
1456
1453
  _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.DYNAMIC_CSS_MANIFEST + '.js')
1457
1454
  ] : [],
@@ -1492,13 +1489,13 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
1492
1489
  }
1493
1490
  ]
1494
1491
  };
1495
- if (bundler === _bundler.Bundler.Turbopack) {
1492
+ if (isTurbopack) {
1496
1493
  await writeManifest(_path.default.join(distDir, 'static', buildId, _constants1.TURBOPACK_CLIENT_MIDDLEWARE_MANIFEST), functionsConfigManifest.functions['/_middleware'].matchers || []);
1497
1494
  }
1498
1495
  }
1499
1496
  }
1500
1497
  await writeFunctionsConfigManifest(distDir, functionsConfigManifest);
1501
- if (bundler !== _bundler.Bundler.Turbopack && !isGenerateMode && !buildTracesPromise) {
1498
+ if (!isTurbopack && !isGenerateMode && !buildTracesPromise) {
1502
1499
  buildTracesPromise = nextBuildSpan.traceChild('collect-build-traces').traceAsyncFn(()=>{
1503
1500
  return (0, _collectbuildtraces.collectBuildTraces)({
1504
1501
  dir,
@@ -1597,7 +1594,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
1597
1594
  await writeRequiredServerFilesManifest(distDir, requiredServerFilesManifest);
1598
1595
  // we don't need to inline for turbopack build as
1599
1596
  // it will handle it's own caching separate of compile
1600
- if (isGenerateMode && bundler !== _bundler.Bundler.Turbopack) {
1597
+ if (isGenerateMode && !isTurbopack) {
1601
1598
  _log.info('Inlining static env ...');
1602
1599
  await nextBuildSpan.traceChild('inline-static-env').traceAsyncFn(async ()=>{
1603
1600
  await (0, _inlinestaticenv.inlineStaticEnv)({
@@ -2487,7 +2484,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
2487
2484
  distDir,
2488
2485
  config,
2489
2486
  staticPages,
2490
- nextVersion: "15.6.0-canary.37",
2487
+ nextVersion: "15.6.0-canary.38",
2491
2488
  tracingRoot: outputFileTracingRoot,
2492
2489
  hasNodeMiddleware,
2493
2490
  hasInstrumentationHook,
@@ -2531,7 +2528,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
2531
2528
  const telemetry = _shared.traceGlobals.get('telemetry');
2532
2529
  if (telemetry) {
2533
2530
  telemetry.record((0, _events.eventBuildFailed)({
2534
- bundler: getBundlerForTelemetry(bundler),
2531
+ bundler: getBundlerForTelemetry(isTurbopack),
2535
2532
  errorCode: getErrorCodeForTelemetry(e),
2536
2533
  durationInSeconds: Math.floor((Date.now() - buildStartTime) / 1000)
2537
2534
  }));
@@ -2549,7 +2546,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
2549
2546
  mode: 'build',
2550
2547
  projectDir: dir,
2551
2548
  distDir: loadedConfig.distDir,
2552
- isTurboSession: bundler === _bundler.Bundler.Turbopack,
2549
+ isTurboSession: isTurbopack,
2553
2550
  sync: true
2554
2551
  });
2555
2552
  }
@@ -2559,21 +2556,14 @@ function errorFromUnsupportedSegmentConfig() {
2559
2556
  _log.error(`Invalid segment configuration export detected. This can cause unexpected behavior from the configs not being applied. You should see the relevant failures in the logs above. Please fix them to continue.`);
2560
2557
  process.exit(1);
2561
2558
  }
2562
- function getBundlerForTelemetry(bundler) {
2563
- switch(bundler){
2564
- case _bundler.Bundler.Turbopack:
2565
- return 'turbopack';
2566
- case _bundler.Bundler.Rspack:
2567
- return 'rspack';
2568
- case _bundler.Bundler.Webpack:
2569
- return 'webpack';
2570
- default:
2571
- throw Object.defineProperty(new Error(`unknown bundler: ${bundler}`), "__NEXT_ERROR_CODE", {
2572
- value: "E826",
2573
- enumerable: false,
2574
- configurable: true
2575
- });
2559
+ function getBundlerForTelemetry(isTurbopack) {
2560
+ if (isTurbopack) {
2561
+ return 'turbopack';
2562
+ }
2563
+ if (process.env.NEXT_RSPACK) {
2564
+ return 'rspack';
2576
2565
  }
2566
+ return 'webpack';
2577
2567
  }
2578
2568
  function getErrorCodeForTelemetry(err) {
2579
2569
  const code = (0, _errortelemetryutils.extractNextErrorCode)(err);