Repository: vercel/next.js
File: packages/next/src/server/config-schema.ts (TypeScript)

Code before:
        z.literal('LCP'),
        z.literal('TTFB'),
      ])
    )
    .optional(),
  // This is partial set of mdx-rs transform options we support, aligned
  // with next_core::next_config::MdxRsOptions. Ensure both types are kept in sync.
  mdxRs: z
    .union([
      z.boolean(),
      z.object({
        development: z.boolean().optional(),
        jsxRuntime: z.string().optional(),
        jsxImportSource: z.string().optional(),
        providerImportSource: z.string().optional(),
        mdxType: z.enum(['gfm', 'commonmark']).optional(),
      }),
    ])
    .optional(),
  transitionIndicator: z.boolean().optional(),
  gestureTransition: z.boolean().optional(),
  typedRoutes: z.boolean().optional(),
  webpackBuildWorker: z.boolean().optional(),
  webpackMemoryOptimizations: z.boolean().optional(),
  turbopackMemoryLimit: z.number().optional(),
  turbopackNodeBackend: z.enum(['workerThreads', 'childProcesses']).optional(),
  turbopackMinify: z.boolean().optional(),
  turbopackFileSystemCacheForDev: z.boolean().optional(),
  turbopackFileSystemCacheForBuild: z.boolean().optional(),
  turbopackSourceMaps: z.boolean().optional(),
  turbopackInputSourceMaps: z.boolean().optional(),
  turbopackTreeShaking: z.boolean().optional(),
  turbopackRemoveUnusedImports: z.boolean().optional(),
  turbopackRemoveUnusedExports: z.boolean().optional(),
  turbopackScopeHoisting: z.boolean().optional(),
  turbopackClientSideNestedAsyncChunking: z.boolean().optional(),
  turbopackServerSideNestedAsyncChunking: z.boolean().optional(),
  turbopackImportTypeBytes: z.boolean().optional(),
  turbopackImportTypeText: z.boolean().optional(),
  turbopackUseBuiltinBabel: z.boolean().optional(),
  turbopackUseBuiltinSass: z.boolean().optional(),
  turbopackModuleIds: z.enum(['named', 'deterministic']).optional(),
  turbopackInferModuleSideEffects: z.boolean().optional(),
  optimizePackageImports: z.array(z.string()).optional(),
  optimizeServerReact: z.boolean().optional(),
  strictRouteTypes: z.boolean().optional(),
  clientTraceMetadata: z.array(z.string()).optional(),
  serverMinification: z.boolean().optional(),
  serverSourceMaps: z.boolean().optional(),
  useWasmBinary: z.boolean().optional(),
  useLightningcss: z.boolean().optional(),

Review comment (suggestion):
maybe `turbopackEscmascriptBackend`?  `turbopackPluginRuntimeStrategy`?

if the next process is running in `bun` then we would use bun worker threads.



Code after:
        z.literal('LCP'),
        z.literal('TTFB'),
      ])
    )
    .optional(),
  // This is partial set of mdx-rs transform options we support, aligned
  // with next_core::next_config::MdxRsOptions. Ensure both types are kept in sync.
  mdxRs: z
    .union([
      z.boolean(),
      z.object({
        development: z.boolean().optional(),
        jsxRuntime: z.string().optional(),
        jsxImportSource: z.string().optional(),
        providerImportSource: z.string().optional(),
        mdxType: z.enum(['gfm', 'commonmark']).optional(),
      }),
    ])
    .optional(),
  transitionIndicator: z.boolean().optional(),
  gestureTransition: z.boolean().optional(),
  typedRoutes: z.boolean().optional(),
  webpackBuildWorker: z.boolean().optional(),
  webpackMemoryOptimizations: z.boolean().optional(),
  turbopackMemoryLimit: z.number().optional(),
  turbopackPluginRuntimeStrategy: z
    .enum(['workerThreads', 'childProcesses'])
    .optional(),
  turbopackMinify: z.boolean().optional(),
  turbopackFileSystemCacheForDev: z.boolean().optional(),
  turbopackFileSystemCacheForBuild: z.boolean().optional(),
  turbopackSourceMaps: z.boolean().optional(),
  turbopackInputSourceMaps: z.boolean().optional(),
  turbopackTreeShaking: z.boolean().optional(),
  turbopackRemoveUnusedImports: z.boolean().optional(),
  turbopackRemoveUnusedExports: z.boolean().optional(),
  turbopackScopeHoisting: z.boolean().optional(),
  turbopackClientSideNestedAsyncChunking: z.boolean().optional(),
  turbopackServerSideNestedAsyncChunking: z.boolean().optional(),
  turbopackImportTypeBytes: z.boolean().optional(),
  turbopackImportTypeText: z.boolean().optional(),
  turbopackUseBuiltinBabel: z.boolean().optional(),
  turbopackUseBuiltinSass: z.boolean().optional(),
  turbopackModuleIds: z.enum(['named', 'deterministic']).optional(),
  turbopackInferModuleSideEffects: z.boolean().optional(),
  optimizePackageImports: z.array(z.string()).optional(),
  optimizeServerReact: z.boolean().optional(),
  strictRouteTypes: z.boolean().optional(),
  clientTraceMetadata: z.array(z.string()).optional(),
  serverMinification: z.boolean().optional(),
  serverSourceMaps: z.boolean().optional(),