@openuiai/next 15.6.0-bun.14 → 15.6.0-bun.16
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.
- package/dist/bin/next +1 -1
- package/dist/build/index.js +3 -3
- package/dist/build/swc/index.js +1 -1
- package/dist/build/webpack-build/impl.d.ts +1 -0
- package/dist/build/webpack-build/impl.js +1 -0
- package/dist/build/webpack-build/impl.js.map +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/esm/build/index.js +3 -3
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/webpack-build/impl.js +1 -0
- package/dist/esm/build/webpack-build/impl.js.map +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/server/require-hook.js +6 -2
- package/dist/esm/server/require-hook.js.map +1 -1
- package/dist/esm/shared/lib/canary-only.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/server/require-hook.js +6 -2
- package/dist/server/require-hook.js.map +1 -1
- package/dist/shared/lib/canary-only.js +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +1 -1
package/dist/bin/next
CHANGED
|
@@ -79,7 +79,7 @@ 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-bun.
|
|
82
|
+
}).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.6.0-bun.16"}`, '-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('--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',
|
package/dist/build/index.js
CHANGED
|
@@ -369,7 +369,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
|
369
369
|
const nextBuildSpan = (0, _trace.trace)('next-build', undefined, {
|
|
370
370
|
buildMode: experimentalBuildMode,
|
|
371
371
|
isTurboBuild: String(isTurbopack),
|
|
372
|
-
version: "15.6.0-bun.
|
|
372
|
+
version: "15.6.0-bun.16"
|
|
373
373
|
});
|
|
374
374
|
_buildcontext.NextBuildContext.nextBuildSpan = nextBuildSpan;
|
|
375
375
|
_buildcontext.NextBuildContext.dir = dir;
|
|
@@ -848,7 +848,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
|
848
848
|
// Files outside of the distDir can be "type": "module"
|
|
849
849
|
await writeFileUtf8(_path.default.join(distDir, 'package.json'), '{"type": "commonjs"}');
|
|
850
850
|
// These are written to distDir, so they need to come after creating and cleaning distDr.
|
|
851
|
-
await (0, _builddiagnostics.recordFrameworkVersion)("15.6.0-bun.
|
|
851
|
+
await (0, _builddiagnostics.recordFrameworkVersion)("15.6.0-bun.16");
|
|
852
852
|
await (0, _builddiagnostics.updateBuildDiagnostics)({
|
|
853
853
|
buildStage: 'start'
|
|
854
854
|
});
|
|
@@ -2493,7 +2493,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
|
2493
2493
|
distDir,
|
|
2494
2494
|
config,
|
|
2495
2495
|
staticPages,
|
|
2496
|
-
nextVersion: "15.6.0-bun.
|
|
2496
|
+
nextVersion: "15.6.0-bun.16",
|
|
2497
2497
|
tracingRoot: outputFileTracingRoot,
|
|
2498
2498
|
hasNodeMiddleware,
|
|
2499
2499
|
hasInstrumentationHook,
|
package/dist/build/swc/index.js
CHANGED
|
@@ -131,7 +131,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
131
131
|
}
|
|
132
132
|
return newObj;
|
|
133
133
|
}
|
|
134
|
-
const nextVersion = "15.6.0-bun.
|
|
134
|
+
const nextVersion = "15.6.0-bun.16";
|
|
135
135
|
const ArchName = (0, _os.arch)();
|
|
136
136
|
const PlatformName = (0, _os.platform)();
|
|
137
137
|
function infoLog(...args) {
|
|
@@ -20,6 +20,7 @@ _export(exports, {
|
|
|
20
20
|
return workerMain;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
+
require("../../server/require-hook");
|
|
23
24
|
const _webpacksources3 = require("next/dist/compiled/webpack-sources3");
|
|
24
25
|
const _picocolors = require("../../lib/picocolors");
|
|
25
26
|
const _formatwebpackmessages = /*#__PURE__*/ _interop_require_default(require("../../shared/lib/format-webpack-messages"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/build/webpack-build/impl.ts"],"sourcesContent":["import type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { stringBufferUtils } from 'next/dist/compiled/webpack-sources3'\nimport { red } from '../../lib/picocolors'\nimport formatWebpackMessages from '../../shared/lib/format-webpack-messages'\nimport { nonNullable } from '../../lib/non-nullable'\nimport type { COMPILER_INDEXES } from '../../shared/lib/constants'\nimport {\n COMPILER_NAMES,\n CLIENT_STATIC_FILES_RUNTIME_MAIN_APP,\n APP_CLIENT_INTERNALS,\n PHASE_PRODUCTION_BUILD,\n} from '../../shared/lib/constants'\nimport { runCompiler } from '../compiler'\nimport * as Log from '../output/log'\nimport getBaseWebpackConfig, { loadProjectInfo } from '../webpack-config'\nimport type { NextError } from '../../lib/is-error'\nimport {\n TelemetryPlugin,\n type TelemetryPluginState,\n} from '../webpack/plugins/telemetry-plugin/telemetry-plugin'\nimport {\n NextBuildContext,\n resumePluginState,\n getPluginState,\n} from '../build-context'\nimport { createEntrypoints } from '../entries'\nimport loadConfig from '../../server/config'\nimport {\n getTraceEvents,\n initializeTraceState,\n setGlobal,\n trace,\n type TraceEvent,\n type TraceState,\n} from '../../trace'\nimport { WEBPACK_LAYERS } from '../../lib/constants'\nimport { TraceEntryPointsPlugin } from '../webpack/plugins/next-trace-entrypoints-plugin'\nimport type { BuildTraceContext } from '../webpack/plugins/next-trace-entrypoints-plugin'\nimport type { UnwrapPromise } from '../../lib/coalesced-function'\n\nimport origDebug from 'next/dist/compiled/debug'\nimport { Telemetry } from '../../telemetry/storage'\nimport { durationToString } from '../duration-to-string'\n\nconst debug = origDebug('next:build:webpack-build')\n\nfunction hrtimeToSeconds(hrtime: [number, number]): number {\n // hrtime is a tuple of [seconds, nanoseconds]\n return hrtime[0] + hrtime[1] / 1e9\n}\n\ntype CompilerResult = {\n errors: webpack.StatsError[]\n warnings: webpack.StatsError[]\n stats: (webpack.Stats | undefined)[]\n}\n\ntype SingleCompilerResult = {\n errors: webpack.StatsError[]\n warnings: webpack.StatsError[]\n stats: webpack.Stats | undefined\n}\n\nfunction isTelemetryPlugin(plugin: unknown): plugin is TelemetryPlugin {\n return plugin instanceof TelemetryPlugin\n}\n\nfunction isTraceEntryPointsPlugin(\n plugin: unknown\n): plugin is TraceEntryPointsPlugin {\n return plugin instanceof TraceEntryPointsPlugin\n}\n\nexport async function webpackBuildImpl(\n compilerName: keyof typeof COMPILER_INDEXES | null\n): Promise<{\n duration: number\n pluginState: any\n buildTraceContext?: BuildTraceContext\n telemetryState?: TelemetryPluginState\n}> {\n let result: CompilerResult | null = {\n warnings: [],\n errors: [],\n stats: [],\n }\n let webpackBuildStart\n const nextBuildSpan = NextBuildContext.nextBuildSpan!\n const dir = NextBuildContext.dir!\n const config = NextBuildContext.config!\n process.env.NEXT_COMPILER_NAME = compilerName || 'server'\n\n const runWebpackSpan = nextBuildSpan.traceChild('run-webpack-compiler')\n const entrypoints = await nextBuildSpan\n .traceChild('create-entrypoints')\n .traceAsyncFn(() =>\n createEntrypoints({\n buildId: NextBuildContext.buildId!,\n config: config,\n envFiles: NextBuildContext.loadedEnvFiles!,\n isDev: false,\n rootDir: dir,\n pageExtensions: config.pageExtensions!,\n pagesDir: NextBuildContext.pagesDir!,\n appDir: NextBuildContext.appDir!,\n pages: NextBuildContext.mappedPages!,\n appPaths: NextBuildContext.mappedAppPages!,\n previewMode: NextBuildContext.previewProps!,\n rootPaths: NextBuildContext.mappedRootPaths!,\n hasInstrumentationHook: NextBuildContext.hasInstrumentationHook!,\n })\n )\n\n const commonWebpackOptions = {\n isServer: false,\n isCompileMode: NextBuildContext.isCompileMode,\n buildId: NextBuildContext.buildId!,\n encryptionKey: NextBuildContext.encryptionKey!,\n config: config,\n appDir: NextBuildContext.appDir!,\n pagesDir: NextBuildContext.pagesDir!,\n rewrites: NextBuildContext.rewrites!,\n originalRewrites: NextBuildContext.originalRewrites,\n originalRedirects: NextBuildContext.originalRedirects,\n reactProductionProfiling: NextBuildContext.reactProductionProfiling!,\n noMangling: NextBuildContext.noMangling!,\n clientRouterFilters: NextBuildContext.clientRouterFilters!,\n previewProps: NextBuildContext.previewProps!,\n allowedRevalidateHeaderKeys: NextBuildContext.allowedRevalidateHeaderKeys!,\n fetchCacheKeyPrefix: NextBuildContext.fetchCacheKeyPrefix!,\n }\n\n const configs = await runWebpackSpan\n .traceChild('generate-webpack-config')\n .traceAsyncFn(async () => {\n const info = await loadProjectInfo({\n dir,\n config: commonWebpackOptions.config,\n dev: false,\n })\n return Promise.all([\n getBaseWebpackConfig(dir, {\n ...commonWebpackOptions,\n middlewareMatchers: entrypoints.middlewareMatchers,\n runWebpackSpan,\n compilerType: COMPILER_NAMES.client,\n entrypoints: entrypoints.client,\n ...info,\n }),\n getBaseWebpackConfig(dir, {\n ...commonWebpackOptions,\n runWebpackSpan,\n middlewareMatchers: entrypoints.middlewareMatchers,\n compilerType: COMPILER_NAMES.server,\n entrypoints: entrypoints.server,\n ...info,\n }),\n getBaseWebpackConfig(dir, {\n ...commonWebpackOptions,\n runWebpackSpan,\n middlewareMatchers: entrypoints.middlewareMatchers,\n compilerType: COMPILER_NAMES.edgeServer,\n entrypoints: entrypoints.edgeServer,\n ...info,\n }),\n ])\n })\n\n const clientConfig = configs[0]\n const serverConfig = configs[1]\n const edgeConfig = configs[2]\n\n if (\n clientConfig.optimization &&\n (clientConfig.optimization.minimize !== true ||\n (clientConfig.optimization.minimizer &&\n clientConfig.optimization.minimizer.length === 0))\n ) {\n Log.warn(\n `Production code optimization has been disabled in your project. Read more: https://nextjs.org/docs/messages/minification-disabled`\n )\n }\n\n webpackBuildStart = process.hrtime()\n\n debug(`starting compiler`, compilerName)\n // We run client and server compilation separately to optimize for memory usage\n await runWebpackSpan.traceAsyncFn(async () => {\n if (config.experimental.webpackMemoryOptimizations) {\n stringBufferUtils.disableDualStringBufferCaching()\n stringBufferUtils.enterStringInterningRange()\n }\n\n // Run the server compilers first and then the client\n // compiler to track the boundary of server/client components.\n let clientResult: SingleCompilerResult | null = null\n\n // During the server compilations, entries of client components will be\n // injected to this set and then will be consumed by the client compiler.\n let serverResult: UnwrapPromise<ReturnType<typeof runCompiler>>[0] | null =\n null\n let edgeServerResult:\n | UnwrapPromise<ReturnType<typeof runCompiler>>[0]\n | null = null\n\n let inputFileSystem: webpack.Compiler['inputFileSystem'] | undefined\n\n if (!compilerName || compilerName === 'server') {\n debug('starting server compiler')\n const start = Date.now()\n ;[serverResult, inputFileSystem] = await runCompiler(serverConfig, {\n runWebpackSpan,\n inputFileSystem,\n })\n debug(`server compiler finished ${Date.now() - start}ms`)\n }\n\n if (!compilerName || compilerName === 'edge-server') {\n debug('starting edge-server compiler')\n const start = Date.now()\n ;[edgeServerResult, inputFileSystem] = edgeConfig\n ? await runCompiler(edgeConfig, { runWebpackSpan, inputFileSystem })\n : [null]\n debug(`edge-server compiler finished ${Date.now() - start}ms`)\n }\n\n // Only continue if there were no errors\n if (!serverResult?.errors.length && !edgeServerResult?.errors.length) {\n const pluginState = getPluginState()\n for (const key in pluginState.injectedClientEntries) {\n const value = pluginState.injectedClientEntries[key]\n const clientEntry = clientConfig.entry as webpack.EntryObject\n if (key === APP_CLIENT_INTERNALS) {\n clientEntry[CLIENT_STATIC_FILES_RUNTIME_MAIN_APP] = {\n import: [\n // TODO-APP: cast clientEntry[CLIENT_STATIC_FILES_RUNTIME_MAIN_APP] to type EntryDescription once it's available from webpack\n // @ts-expect-error clientEntry['main-app'] is type EntryDescription { import: ... }\n ...clientEntry[CLIENT_STATIC_FILES_RUNTIME_MAIN_APP].import,\n value,\n ],\n layer: WEBPACK_LAYERS.appPagesBrowser,\n }\n } else {\n clientEntry[key] = {\n dependOn: [CLIENT_STATIC_FILES_RUNTIME_MAIN_APP],\n import: value,\n layer: WEBPACK_LAYERS.appPagesBrowser,\n }\n }\n }\n\n if (!compilerName || compilerName === 'client') {\n debug('starting client compiler')\n const start = Date.now()\n ;[clientResult, inputFileSystem] = await runCompiler(clientConfig, {\n runWebpackSpan,\n inputFileSystem,\n })\n debug(`client compiler finished ${Date.now() - start}ms`)\n }\n }\n\n if (config.experimental.webpackMemoryOptimizations) {\n stringBufferUtils.exitStringInterningRange()\n }\n inputFileSystem?.purge?.()\n\n result = {\n warnings: [\n ...(clientResult?.warnings ?? []),\n ...(serverResult?.warnings ?? []),\n ...(edgeServerResult?.warnings ?? []),\n ].filter(nonNullable),\n errors: [\n ...(clientResult?.errors ?? []),\n ...(serverResult?.errors ?? []),\n ...(edgeServerResult?.errors ?? []),\n ].filter(nonNullable),\n stats: [\n clientResult?.stats,\n serverResult?.stats,\n edgeServerResult?.stats,\n ],\n }\n })\n result = nextBuildSpan\n .traceChild('format-webpack-messages')\n .traceFn(() => formatWebpackMessages(result, true)) as CompilerResult\n\n const telemetryPlugin = (clientConfig as webpack.Configuration).plugins?.find(\n isTelemetryPlugin\n )\n\n const traceEntryPointsPlugin = (\n serverConfig as webpack.Configuration\n ).plugins?.find(isTraceEntryPointsPlugin)\n\n const webpackBuildEnd = process.hrtime(webpackBuildStart)\n\n if (result.errors.length > 0) {\n // Only keep the first few errors. Others are often indicative\n // of the same problem, but confuse the reader with noise.\n if (result.errors.length > 5) {\n result.errors.length = 5\n }\n let error = result.errors.filter(Boolean).join('\\n\\n')\n\n console.error(red('Failed to compile.\\n'))\n\n if (\n error.indexOf('private-next-pages') > -1 &&\n error.indexOf('does not contain a default export') > -1\n ) {\n const page_name_regex = /'private-next-pages\\/(?<page_name>[^']*)'/\n const parsed = page_name_regex.exec(error)\n const page_name = parsed && parsed.groups && parsed.groups.page_name\n throw new Error(\n `webpack build failed: found page without a React Component as default export in pages/${page_name}\\n\\nSee https://nextjs.org/docs/messages/page-without-valid-component for more info.`\n )\n }\n\n console.error(error)\n console.error()\n\n if (\n error.indexOf('private-next-pages') > -1 ||\n error.indexOf('__next_polyfill__') > -1\n ) {\n const err = new Error(\n 'webpack config.resolve.alias was incorrectly overridden. https://nextjs.org/docs/messages/invalid-resolve-alias'\n ) as NextError\n err.code = 'INVALID_RESOLVE_ALIAS'\n throw err\n }\n const err = new Error(\n `Build failed because of ${process.env.NEXT_RSPACK ? 'Rspack' : 'webpack'} errors`\n ) as NextError\n err.code = 'WEBPACK_ERRORS'\n throw err\n } else {\n const duration = hrtimeToSeconds(webpackBuildEnd)\n const durationString = durationToString(duration)\n\n if (result.warnings.length > 0) {\n Log.warn(`Compiled with warnings in ${durationString}\\n`)\n console.warn(result.warnings.filter(Boolean).join('\\n\\n'))\n console.warn()\n } else if (!compilerName) {\n Log.event(`Compiled successfully in ${durationString}`)\n }\n\n return {\n duration,\n buildTraceContext: traceEntryPointsPlugin?.buildTraceContext,\n pluginState: getPluginState(),\n telemetryState: {\n usages: telemetryPlugin?.usages() || [],\n packagesUsedInServerSideProps:\n telemetryPlugin?.packagesUsedInServerSideProps() || [],\n useCacheTracker: telemetryPlugin?.getUseCacheTracker() || {},\n },\n }\n }\n}\n\n// the main function when this file is run as a worker\nexport async function workerMain(workerData: {\n compilerName: keyof typeof COMPILER_INDEXES\n buildContext: typeof NextBuildContext\n traceState: TraceState\n}): Promise<\n Awaited<ReturnType<typeof webpackBuildImpl>> & {\n debugTraceEvents: TraceEvent[]\n }\n> {\n // Clone the telemetry for worker\n const telemetry = new Telemetry({\n distDir: workerData.buildContext.config!.distDir,\n })\n setGlobal('telemetry', telemetry)\n // setup new build context from the serialized data passed from the parent\n Object.assign(NextBuildContext, workerData.buildContext)\n\n // Initialize tracer state from the parent\n initializeTraceState(workerData.traceState)\n\n // Resume plugin state\n resumePluginState(NextBuildContext.pluginState)\n\n /// load the config because it's not serializable\n NextBuildContext.config = await loadConfig(\n PHASE_PRODUCTION_BUILD,\n NextBuildContext.dir!,\n { debugPrerender: NextBuildContext.debugPrerender }\n )\n NextBuildContext.nextBuildSpan = trace(\n `worker-main-${workerData.compilerName}`\n )\n\n const result = await webpackBuildImpl(workerData.compilerName)\n const { entriesTrace, chunksTrace } = result.buildTraceContext ?? {}\n if (entriesTrace) {\n const { entryNameMap, depModArray } = entriesTrace\n if (depModArray) {\n result.buildTraceContext!.entriesTrace!.depModArray = depModArray\n }\n if (entryNameMap) {\n const entryEntries = entryNameMap\n result.buildTraceContext!.entriesTrace!.entryNameMap = entryEntries\n }\n }\n if (chunksTrace?.entryNameFilesMap) {\n const entryNameFilesMap = chunksTrace.entryNameFilesMap\n result.buildTraceContext!.chunksTrace!.entryNameFilesMap = entryNameFilesMap\n }\n NextBuildContext.nextBuildSpan.stop()\n return { ...result, debugTraceEvents: getTraceEvents() }\n}\n"],"names":["webpackBuildImpl","workerMain","debug","origDebug","hrtimeToSeconds","hrtime","isTelemetryPlugin","plugin","TelemetryPlugin","isTraceEntryPointsPlugin","TraceEntryPointsPlugin","compilerName","result","warnings","errors","stats","webpackBuildStart","nextBuildSpan","NextBuildContext","dir","config","process","env","NEXT_COMPILER_NAME","runWebpackSpan","traceChild","entrypoints","traceAsyncFn","createEntrypoints","buildId","envFiles","loadedEnvFiles","isDev","rootDir","pageExtensions","pagesDir","appDir","pages","mappedPages","appPaths","mappedAppPages","previewMode","previewProps","rootPaths","mappedRootPaths","hasInstrumentationHook","commonWebpackOptions","isServer","isCompileMode","encryptionKey","rewrites","originalRewrites","originalRedirects","reactProductionProfiling","noMangling","clientRouterFilters","allowedRevalidateHeaderKeys","fetchCacheKeyPrefix","configs","info","loadProjectInfo","dev","Promise","all","getBaseWebpackConfig","middlewareMatchers","compilerType","COMPILER_NAMES","client","server","edgeServer","clientConfig","serverConfig","edgeConfig","optimization","minimize","minimizer","length","Log","warn","inputFileSystem","experimental","webpackMemoryOptimizations","stringBufferUtils","disableDualStringBufferCaching","enterStringInterningRange","clientResult","serverResult","edgeServerResult","start","Date","now","runCompiler","pluginState","getPluginState","key","injectedClientEntries","value","clientEntry","entry","APP_CLIENT_INTERNALS","CLIENT_STATIC_FILES_RUNTIME_MAIN_APP","import","layer","WEBPACK_LAYERS","appPagesBrowser","dependOn","exitStringInterningRange","purge","filter","nonNullable","traceFn","formatWebpackMessages","telemetryPlugin","plugins","find","traceEntryPointsPlugin","webpackBuildEnd","error","Boolean","join","console","red","indexOf","page_name_regex","parsed","exec","page_name","groups","Error","err","code","NEXT_RSPACK","duration","durationString","durationToString","event","buildTraceContext","telemetryState","usages","packagesUsedInServerSideProps","useCacheTracker","getUseCacheTracker","workerData","telemetry","Telemetry","distDir","buildContext","setGlobal","Object","assign","initializeTraceState","traceState","resumePluginState","loadConfig","PHASE_PRODUCTION_BUILD","debugPrerender","trace","entriesTrace","chunksTrace","entryNameMap","depModArray","entryEntries","entryNameFilesMap","stop","debugTraceEvents","getTraceEvents"],"mappings":";;;;;;;;;;;;;;;IAyEsBA,gBAAgB;eAAhBA;;IAqSAC,UAAU;eAAVA;;;iCA7WY;4BACd;8EACc;6BACN;2BAOrB;0BACqB;6DACP;uEACiC;iCAK/C;8BAKA;yBAC2B;+DACX;uBAQhB;4BACwB;4CACQ;8DAIjB;yBACI;kCACO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjC,MAAMC,QAAQC,IAAAA,cAAS,EAAC;AAExB,SAASC,gBAAgBC,MAAwB;IAC/C,8CAA8C;IAC9C,OAAOA,MAAM,CAAC,EAAE,GAAGA,MAAM,CAAC,EAAE,GAAG;AACjC;AAcA,SAASC,kBAAkBC,MAAe;IACxC,OAAOA,kBAAkBC,gCAAe;AAC1C;AAEA,SAASC,yBACPF,MAAe;IAEf,OAAOA,kBAAkBG,kDAAsB;AACjD;AAEO,eAAeV,iBACpBW,YAAkD;QAuN1B,uBAIO;IApN/B,IAAIC,SAAgC;QAClCC,UAAU,EAAE;QACZC,QAAQ,EAAE;QACVC,OAAO,EAAE;IACX;IACA,IAAIC;IACJ,MAAMC,gBAAgBC,8BAAgB,CAACD,aAAa;IACpD,MAAME,MAAMD,8BAAgB,CAACC,GAAG;IAChC,MAAMC,SAASF,8BAAgB,CAACE,MAAM;IACtCC,QAAQC,GAAG,CAACC,kBAAkB,GAAGZ,gBAAgB;IAEjD,MAAMa,iBAAiBP,cAAcQ,UAAU,CAAC;IAChD,MAAMC,cAAc,MAAMT,cACvBQ,UAAU,CAAC,sBACXE,YAAY,CAAC,IACZC,IAAAA,0BAAiB,EAAC;YAChBC,SAASX,8BAAgB,CAACW,OAAO;YACjCT,QAAQA;YACRU,UAAUZ,8BAAgB,CAACa,cAAc;Y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QAAEyI,gBAAgB1I,8BAAgB,CAAC0I,cAAc;IAAC;IAEpD1I,8BAAgB,CAACD,aAAa,GAAG4I,IAAAA,YAAK,EACpC,CAAC,YAAY,EAAEd,WAAWpI,YAAY,EAAE;IAG1C,MAAMC,SAAS,MAAMZ,iBAAiB+I,WAAWpI,YAAY;IAC7D,MAAM,EAAEmJ,YAAY,EAAEC,WAAW,EAAE,GAAGnJ,OAAO6H,iBAAiB,IAAI,CAAC;IACnE,IAAIqB,cAAc;QAChB,MAAM,EAAEE,YAAY,EAAEC,WAAW,EAAE,GAAGH;QACtC,IAAIG,aAAa;YACfrJ,OAAO6H,iBAAiB,CAAEqB,YAAY,CAAEG,WAAW,GAAGA;QACxD;QACA,IAAID,cAAc;YAChB,MAAME,eAAeF;YACrBpJ,OAAO6H,iBAAiB,CAAEqB,YAAY,CAAEE,YAAY,GAAGE;QACzD;IACF;IACA,IAAIH,+BAAAA,YAAaI,iBAAiB,EAAE;QAClC,MAAMA,oBAAoBJ,YAAYI,iBAAiB;QACvDvJ,OAAO6H,iBAAiB,CAAEsB,WAAW,CAAEI,iBAAiB,GAAGA;IAC7D;IACAjJ,8BAAgB,CAACD,aAAa,CAACmJ,IAAI;IACnC,OAAO;QAAE,GAAGxJ,MAAM;QAAEyJ,kBAAkBC,IAAAA,qBAAc;IAAG;AACzD","ignoreList":[0]}
|
|
1
|
+
{"version":3,"sources":["../../../src/build/webpack-build/impl.ts"],"sourcesContent":["import '../../server/require-hook'\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { stringBufferUtils } from 'next/dist/compiled/webpack-sources3'\nimport { red } from '../../lib/picocolors'\nimport formatWebpackMessages from '../../shared/lib/format-webpack-messages'\nimport { nonNullable } from '../../lib/non-nullable'\nimport type { COMPILER_INDEXES } from '../../shared/lib/constants'\nimport {\n COMPILER_NAMES,\n CLIENT_STATIC_FILES_RUNTIME_MAIN_APP,\n APP_CLIENT_INTERNALS,\n PHASE_PRODUCTION_BUILD,\n} from '../../shared/lib/constants'\nimport { runCompiler } from '../compiler'\nimport * as Log from '../output/log'\nimport getBaseWebpackConfig, { loadProjectInfo } from '../webpack-config'\nimport type { NextError } from '../../lib/is-error'\nimport {\n TelemetryPlugin,\n type TelemetryPluginState,\n} from '../webpack/plugins/telemetry-plugin/telemetry-plugin'\nimport {\n NextBuildContext,\n resumePluginState,\n getPluginState,\n} from '../build-context'\nimport { createEntrypoints } from '../entries'\nimport loadConfig from '../../server/config'\nimport {\n getTraceEvents,\n initializeTraceState,\n setGlobal,\n trace,\n type TraceEvent,\n type TraceState,\n} from '../../trace'\nimport { WEBPACK_LAYERS } from '../../lib/constants'\nimport { TraceEntryPointsPlugin } from '../webpack/plugins/next-trace-entrypoints-plugin'\nimport type { BuildTraceContext } from '../webpack/plugins/next-trace-entrypoints-plugin'\nimport type { UnwrapPromise } from '../../lib/coalesced-function'\n\nimport origDebug from 'next/dist/compiled/debug'\nimport { Telemetry } from '../../telemetry/storage'\nimport { durationToString } from '../duration-to-string'\n\nconst debug = origDebug('next:build:webpack-build')\n\nfunction hrtimeToSeconds(hrtime: [number, number]): number {\n // hrtime is a tuple of [seconds, nanoseconds]\n return hrtime[0] + hrtime[1] / 1e9\n}\n\ntype CompilerResult = {\n errors: webpack.StatsError[]\n warnings: webpack.StatsError[]\n stats: (webpack.Stats | undefined)[]\n}\n\ntype SingleCompilerResult = {\n errors: webpack.StatsError[]\n warnings: webpack.StatsError[]\n stats: webpack.Stats | undefined\n}\n\nfunction isTelemetryPlugin(plugin: unknown): plugin is TelemetryPlugin {\n return plugin instanceof TelemetryPlugin\n}\n\nfunction isTraceEntryPointsPlugin(\n plugin: unknown\n): plugin is TraceEntryPointsPlugin {\n return plugin instanceof TraceEntryPointsPlugin\n}\n\nexport async function webpackBuildImpl(\n compilerName: keyof typeof COMPILER_INDEXES | null\n): Promise<{\n duration: number\n pluginState: any\n buildTraceContext?: BuildTraceContext\n telemetryState?: TelemetryPluginState\n}> {\n let result: CompilerResult | null = {\n warnings: [],\n errors: [],\n stats: [],\n }\n let webpackBuildStart\n const nextBuildSpan = NextBuildContext.nextBuildSpan!\n const dir = NextBuildContext.dir!\n const config = NextBuildContext.config!\n process.env.NEXT_COMPILER_NAME = compilerName || 'server'\n\n const runWebpackSpan = nextBuildSpan.traceChild('run-webpack-compiler')\n const entrypoints = await nextBuildSpan\n .traceChild('create-entrypoints')\n .traceAsyncFn(() =>\n createEntrypoints({\n buildId: NextBuildContext.buildId!,\n config: config,\n envFiles: NextBuildContext.loadedEnvFiles!,\n isDev: false,\n rootDir: dir,\n pageExtensions: config.pageExtensions!,\n pagesDir: NextBuildContext.pagesDir!,\n appDir: NextBuildContext.appDir!,\n pages: NextBuildContext.mappedPages!,\n appPaths: NextBuildContext.mappedAppPages!,\n previewMode: NextBuildContext.previewProps!,\n rootPaths: NextBuildContext.mappedRootPaths!,\n hasInstrumentationHook: NextBuildContext.hasInstrumentationHook!,\n })\n )\n\n const commonWebpackOptions = {\n isServer: false,\n isCompileMode: NextBuildContext.isCompileMode,\n buildId: NextBuildContext.buildId!,\n encryptionKey: NextBuildContext.encryptionKey!,\n config: config,\n appDir: NextBuildContext.appDir!,\n pagesDir: NextBuildContext.pagesDir!,\n rewrites: NextBuildContext.rewrites!,\n originalRewrites: NextBuildContext.originalRewrites,\n originalRedirects: NextBuildContext.originalRedirects,\n reactProductionProfiling: NextBuildContext.reactProductionProfiling!,\n noMangling: NextBuildContext.noMangling!,\n clientRouterFilters: NextBuildContext.clientRouterFilters!,\n previewProps: NextBuildContext.previewProps!,\n allowedRevalidateHeaderKeys: NextBuildContext.allowedRevalidateHeaderKeys!,\n fetchCacheKeyPrefix: NextBuildContext.fetchCacheKeyPrefix!,\n }\n\n const configs = await runWebpackSpan\n .traceChild('generate-webpack-config')\n .traceAsyncFn(async () => {\n const info = await loadProjectInfo({\n dir,\n config: commonWebpackOptions.config,\n dev: false,\n })\n return Promise.all([\n getBaseWebpackConfig(dir, {\n ...commonWebpackOptions,\n middlewareMatchers: entrypoints.middlewareMatchers,\n runWebpackSpan,\n compilerType: COMPILER_NAMES.client,\n entrypoints: entrypoints.client,\n ...info,\n }),\n getBaseWebpackConfig(dir, {\n ...commonWebpackOptions,\n runWebpackSpan,\n middlewareMatchers: entrypoints.middlewareMatchers,\n compilerType: COMPILER_NAMES.server,\n entrypoints: entrypoints.server,\n ...info,\n }),\n getBaseWebpackConfig(dir, {\n ...commonWebpackOptions,\n runWebpackSpan,\n middlewareMatchers: entrypoints.middlewareMatchers,\n compilerType: COMPILER_NAMES.edgeServer,\n entrypoints: entrypoints.edgeServer,\n ...info,\n }),\n ])\n })\n\n const clientConfig = configs[0]\n const serverConfig = configs[1]\n const edgeConfig = configs[2]\n\n if (\n clientConfig.optimization &&\n (clientConfig.optimization.minimize !== true ||\n (clientConfig.optimization.minimizer &&\n clientConfig.optimization.minimizer.length === 0))\n ) {\n Log.warn(\n `Production code optimization has been disabled in your project. Read more: https://nextjs.org/docs/messages/minification-disabled`\n )\n }\n\n webpackBuildStart = process.hrtime()\n\n debug(`starting compiler`, compilerName)\n // We run client and server compilation separately to optimize for memory usage\n await runWebpackSpan.traceAsyncFn(async () => {\n if (config.experimental.webpackMemoryOptimizations) {\n stringBufferUtils.disableDualStringBufferCaching()\n stringBufferUtils.enterStringInterningRange()\n }\n\n // Run the server compilers first and then the client\n // compiler to track the boundary of server/client components.\n let clientResult: SingleCompilerResult | null = null\n\n // During the server compilations, entries of client components will be\n // injected to this set and then will be consumed by the client compiler.\n let serverResult: UnwrapPromise<ReturnType<typeof runCompiler>>[0] | null =\n null\n let edgeServerResult:\n | UnwrapPromise<ReturnType<typeof runCompiler>>[0]\n | null = null\n\n let inputFileSystem: webpack.Compiler['inputFileSystem'] | undefined\n\n if (!compilerName || compilerName === 'server') {\n debug('starting server compiler')\n const start = Date.now()\n ;[serverResult, inputFileSystem] = await runCompiler(serverConfig, {\n runWebpackSpan,\n inputFileSystem,\n })\n debug(`server compiler finished ${Date.now() - start}ms`)\n }\n\n if (!compilerName || compilerName === 'edge-server') {\n debug('starting edge-server compiler')\n const start = Date.now()\n ;[edgeServerResult, inputFileSystem] = edgeConfig\n ? await runCompiler(edgeConfig, { runWebpackSpan, inputFileSystem })\n : [null]\n debug(`edge-server compiler finished ${Date.now() - start}ms`)\n }\n\n // Only continue if there were no errors\n if (!serverResult?.errors.length && !edgeServerResult?.errors.length) {\n const pluginState = getPluginState()\n for (const key in pluginState.injectedClientEntries) {\n const value = pluginState.injectedClientEntries[key]\n const clientEntry = clientConfig.entry as webpack.EntryObject\n if (key === APP_CLIENT_INTERNALS) {\n clientEntry[CLIENT_STATIC_FILES_RUNTIME_MAIN_APP] = {\n import: [\n // TODO-APP: cast clientEntry[CLIENT_STATIC_FILES_RUNTIME_MAIN_APP] to type EntryDescription once it's available from webpack\n // @ts-expect-error clientEntry['main-app'] is type EntryDescription { import: ... }\n ...clientEntry[CLIENT_STATIC_FILES_RUNTIME_MAIN_APP].import,\n value,\n ],\n layer: WEBPACK_LAYERS.appPagesBrowser,\n }\n } else {\n clientEntry[key] = {\n dependOn: [CLIENT_STATIC_FILES_RUNTIME_MAIN_APP],\n import: value,\n layer: WEBPACK_LAYERS.appPagesBrowser,\n }\n }\n }\n\n if (!compilerName || compilerName === 'client') {\n debug('starting client compiler')\n const start = Date.now()\n ;[clientResult, inputFileSystem] = await runCompiler(clientConfig, {\n runWebpackSpan,\n inputFileSystem,\n })\n debug(`client compiler finished ${Date.now() - start}ms`)\n }\n }\n\n if (config.experimental.webpackMemoryOptimizations) {\n stringBufferUtils.exitStringInterningRange()\n }\n inputFileSystem?.purge?.()\n\n result = {\n warnings: [\n ...(clientResult?.warnings ?? []),\n ...(serverResult?.warnings ?? []),\n ...(edgeServerResult?.warnings ?? []),\n ].filter(nonNullable),\n errors: [\n ...(clientResult?.errors ?? []),\n ...(serverResult?.errors ?? []),\n ...(edgeServerResult?.errors ?? []),\n ].filter(nonNullable),\n stats: [\n clientResult?.stats,\n serverResult?.stats,\n edgeServerResult?.stats,\n ],\n }\n })\n result = nextBuildSpan\n .traceChild('format-webpack-messages')\n .traceFn(() => formatWebpackMessages(result, true)) as CompilerResult\n\n const telemetryPlugin = (clientConfig as webpack.Configuration).plugins?.find(\n isTelemetryPlugin\n )\n\n const traceEntryPointsPlugin = (\n serverConfig as webpack.Configuration\n ).plugins?.find(isTraceEntryPointsPlugin)\n\n const webpackBuildEnd = process.hrtime(webpackBuildStart)\n\n if (result.errors.length > 0) {\n // Only keep the first few errors. Others are often indicative\n // of the same problem, but confuse the reader with noise.\n if (result.errors.length > 5) {\n result.errors.length = 5\n }\n let error = result.errors.filter(Boolean).join('\\n\\n')\n\n console.error(red('Failed to compile.\\n'))\n\n if (\n error.indexOf('private-next-pages') > -1 &&\n error.indexOf('does not contain a default export') > -1\n ) {\n const page_name_regex = /'private-next-pages\\/(?<page_name>[^']*)'/\n const parsed = page_name_regex.exec(error)\n const page_name = parsed && parsed.groups && parsed.groups.page_name\n throw new Error(\n `webpack build failed: found page without a React Component as default export in pages/${page_name}\\n\\nSee https://nextjs.org/docs/messages/page-without-valid-component for more info.`\n )\n }\n\n console.error(error)\n console.error()\n\n if (\n error.indexOf('private-next-pages') > -1 ||\n error.indexOf('__next_polyfill__') > -1\n ) {\n const err = new Error(\n 'webpack config.resolve.alias was incorrectly overridden. https://nextjs.org/docs/messages/invalid-resolve-alias'\n ) as NextError\n err.code = 'INVALID_RESOLVE_ALIAS'\n throw err\n }\n const err = new Error(\n `Build failed because of ${process.env.NEXT_RSPACK ? 'Rspack' : 'webpack'} errors`\n ) as NextError\n err.code = 'WEBPACK_ERRORS'\n throw err\n } else {\n const duration = hrtimeToSeconds(webpackBuildEnd)\n const durationString = durationToString(duration)\n\n if (result.warnings.length > 0) {\n Log.warn(`Compiled with warnings in ${durationString}\\n`)\n console.warn(result.warnings.filter(Boolean).join('\\n\\n'))\n console.warn()\n } else if (!compilerName) {\n Log.event(`Compiled successfully in ${durationString}`)\n }\n\n return {\n duration,\n buildTraceContext: traceEntryPointsPlugin?.buildTraceContext,\n pluginState: getPluginState(),\n telemetryState: {\n usages: telemetryPlugin?.usages() || [],\n packagesUsedInServerSideProps:\n telemetryPlugin?.packagesUsedInServerSideProps() || [],\n useCacheTracker: telemetryPlugin?.getUseCacheTracker() || {},\n },\n }\n }\n}\n\n// the main function when this file is run as a worker\nexport async function workerMain(workerData: {\n compilerName: keyof typeof COMPILER_INDEXES\n buildContext: typeof NextBuildContext\n traceState: TraceState\n}): Promise<\n Awaited<ReturnType<typeof webpackBuildImpl>> & {\n debugTraceEvents: TraceEvent[]\n }\n> {\n // Clone the telemetry for worker\n const telemetry = new Telemetry({\n distDir: workerData.buildContext.config!.distDir,\n })\n setGlobal('telemetry', telemetry)\n // setup new build context from the serialized data passed from the parent\n Object.assign(NextBuildContext, workerData.buildContext)\n\n // Initialize tracer state from the parent\n initializeTraceState(workerData.traceState)\n\n // Resume plugin state\n resumePluginState(NextBuildContext.pluginState)\n\n /// load the config because it's not serializable\n NextBuildContext.config = await loadConfig(\n PHASE_PRODUCTION_BUILD,\n NextBuildContext.dir!,\n { debugPrerender: NextBuildContext.debugPrerender }\n )\n NextBuildContext.nextBuildSpan = trace(\n `worker-main-${workerData.compilerName}`\n )\n\n const result = await webpackBuildImpl(workerData.compilerName)\n const { entriesTrace, chunksTrace } = result.buildTraceContext ?? {}\n if (entriesTrace) {\n const { entryNameMap, depModArray } = entriesTrace\n if (depModArray) {\n result.buildTraceContext!.entriesTrace!.depModArray = depModArray\n }\n if (entryNameMap) {\n const entryEntries = entryNameMap\n result.buildTraceContext!.entriesTrace!.entryNameMap = entryEntries\n }\n }\n if (chunksTrace?.entryNameFilesMap) {\n const entryNameFilesMap = chunksTrace.entryNameFilesMap\n result.buildTraceContext!.chunksTrace!.entryNameFilesMap = entryNameFilesMap\n }\n NextBuildContext.nextBuildSpan.stop()\n return { ...result, debugTraceEvents: getTraceEvents() }\n}\n"],"names":["webpackBuildImpl","workerMain","debug","origDebug","hrtimeToSeconds","hrtime","isTelemetryPlugin","plugin","TelemetryPlugin","isTraceEntryPointsPlugin","TraceEntryPointsPlugin","compilerName","result","warnings","errors","stats","webpackBuildStart","nextBuildSpan","NextBuildContext","dir","config","process","env","NEXT_COMPILER_NAME","runWebpackSpan","traceChild","entrypoints","traceAsyncFn","createEntrypoints","buildId","envFiles","loadedEnvFiles","isDev","rootDir","pageExtensions","pagesDir","appDir","pages","mappedPages","appPaths","mappedAppPages","previewMode","previewProps","rootPaths","mappedRootPaths","hasInstrumentationHook","commonWebpackOptions","isServer","isCompileMode","encryptionKey","rewrites","originalRewrites","originalRedirects","reactProductionProfiling","noMangling","clientRouterFilters","allowedRevalidateHeaderKeys","fetchCacheKeyPrefix","configs","info","loadProjectInfo","dev","Promise","all","getBaseWebpackConfig","middlewareMatchers","compilerType","COMPILER_NAMES","client","server","edgeServer","clientConfig","serverConfig","edgeConfig","optimization","minimize","minimizer","length","Log","warn","inputFileSystem","experimental","webpackMemoryOptimizations","stringBufferUtils","disableDualStringBufferCaching","enterStringInterningRange","clientResult","serverResult","edgeServerResult","start","Date","now","runCompiler","pluginState","getPluginState","key","injectedClientEntries","value","clientEntry","entry","APP_CLIENT_INTERNALS","CLIENT_STATIC_FILES_RUNTIME_MAIN_APP","import","layer","WEBPACK_LAYERS","appPagesBrowser","dependOn","exitStringInterningRange","purge","filter","nonNullable","traceFn","formatWebpackMessages","telemetryPlugin","plugins","find","traceEntryPointsPlugin","webpackBuildEnd","error","Boolean","join","console","red","indexOf","page_name_regex","parsed","exec","page_name","groups","Error","err","code","NEXT_RSPACK","duration","durationString","durationToString","event","buildTraceContext","telemetryState","usages","packagesUsedInServerSideProps","useCacheTracker","getUseCacheTracker","workerData","telemetry","Telemetry","distDir","buildContext","setGlobal","Object","assign","initializeTraceState","traceState","resumePluginState","loadConfig","PHASE_PRODUCTION_BUILD","debugPrerender","trace","entriesTrace","chunksTrace","entryNameMap","depModArray","entryEntries","entryNameFilesMap","stop","debugTraceEvents","getTraceEvents"],"mappings":";;;;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AMC,SAAS,MAAMZ,iBAAiB+I,WAAWpI,YAAY;IAC7D,MAAM,EAAEmJ,YAAY,EAAEC,WAAW,EAAE,GAAGnJ,OAAO6H,iBAAiB,IAAI,CAAC;IACnE,IAAIqB,cAAc;QAChB,MAAM,EAAEE,YAAY,EAAEC,WAAW,EAAE,GAAGH;QACtC,IAAIG,aAAa;YACfrJ,OAAO6H,iBAAiB,CAAEqB,YAAY,CAAEG,WAAW,GAAGA;QACxD;QACA,IAAID,cAAc;YAChB,MAAME,eAAeF;YACrBpJ,OAAO6H,iBAAiB,CAAEqB,YAAY,CAAEE,YAAY,GAAGE;QACzD;IACF;IACA,IAAIH,+BAAAA,YAAaI,iBAAiB,EAAE;QAClC,MAAMA,oBAAoBJ,YAAYI,iBAAiB;QACvDvJ,OAAO6H,iBAAiB,CAAEsB,WAAW,CAAEI,iBAAiB,GAAGA;IAC7D;IACAjJ,8BAAgB,CAACD,aAAa,CAACmJ,IAAI;IACnC,OAAO;QAAE,GAAGxJ,MAAM;QAAEyJ,kBAAkBC,IAAAA,qBAAc;IAAG;AACzD","ignoreList":[0]}
|
|
@@ -1678,7 +1678,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1678
1678
|
isClient && new _copyfileplugin.CopyFilePlugin({
|
|
1679
1679
|
// file path to build output of `@next/polyfill-nomodule`
|
|
1680
1680
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
|
1681
|
-
cacheKey: "15.6.0-bun.
|
|
1681
|
+
cacheKey: "15.6.0-bun.16",
|
|
1682
1682
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
|
1683
1683
|
minimize: false,
|
|
1684
1684
|
info: {
|
|
@@ -1859,7 +1859,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1859
1859
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
|
1860
1860
|
// - Next.js version
|
|
1861
1861
|
// - next.config.js keys that affect compilation
|
|
1862
|
-
version: `${__dirname}|${"15.6.0-bun.
|
|
1862
|
+
version: `${__dirname}|${"15.6.0-bun.16"}|${configVars}`,
|
|
1863
1863
|
cacheDirectory: _path.default.join(distDir, 'cache', 'webpack'),
|
|
1864
1864
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
|
1865
1865
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|
|
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "appBootstrap", {
|
|
|
15
15
|
});
|
|
16
16
|
const _assetprefix = require("./asset-prefix");
|
|
17
17
|
const _setattributesfromprops = require("./set-attributes-from-props");
|
|
18
|
-
const version = "15.6.0-bun.
|
|
18
|
+
const version = "15.6.0-bun.16";
|
|
19
19
|
window.next = {
|
|
20
20
|
version,
|
|
21
21
|
appDir: true
|
package/dist/client/index.js
CHANGED
|
@@ -61,7 +61,7 @@ const _hooksclientcontextsharedruntime = require("../shared/lib/hooks-client-con
|
|
|
61
61
|
const _onrecoverableerror = require("./react-client-callbacks/on-recoverable-error");
|
|
62
62
|
const _tracer = /*#__PURE__*/ _interop_require_default._(require("./tracing/tracer"));
|
|
63
63
|
const _isnextroutererror = require("./components/is-next-router-error");
|
|
64
|
-
const version = "15.6.0-bun.
|
|
64
|
+
const version = "15.6.0-bun.16";
|
|
65
65
|
let router;
|
|
66
66
|
const emitter = (0, _mitt.default)();
|
|
67
67
|
const looseToArray = (input)=>[].slice.call(input);
|
package/dist/esm/build/index.js
CHANGED
|
@@ -301,7 +301,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
|
301
301
|
const nextBuildSpan = trace('next-build', undefined, {
|
|
302
302
|
buildMode: experimentalBuildMode,
|
|
303
303
|
isTurboBuild: String(isTurbopack),
|
|
304
|
-
version: "15.6.0-bun.
|
|
304
|
+
version: "15.6.0-bun.16"
|
|
305
305
|
});
|
|
306
306
|
NextBuildContext.nextBuildSpan = nextBuildSpan;
|
|
307
307
|
NextBuildContext.dir = dir;
|
|
@@ -780,7 +780,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
|
780
780
|
// Files outside of the distDir can be "type": "module"
|
|
781
781
|
await writeFileUtf8(path.join(distDir, 'package.json'), '{"type": "commonjs"}');
|
|
782
782
|
// These are written to distDir, so they need to come after creating and cleaning distDr.
|
|
783
|
-
await recordFrameworkVersion("15.6.0-bun.
|
|
783
|
+
await recordFrameworkVersion("15.6.0-bun.16");
|
|
784
784
|
await updateBuildDiagnostics({
|
|
785
785
|
buildStage: 'start'
|
|
786
786
|
});
|
|
@@ -2425,7 +2425,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
|
2425
2425
|
distDir,
|
|
2426
2426
|
config,
|
|
2427
2427
|
staticPages,
|
|
2428
|
-
nextVersion: "15.6.0-bun.
|
|
2428
|
+
nextVersion: "15.6.0-bun.16",
|
|
2429
2429
|
tracingRoot: outputFileTracingRoot,
|
|
2430
2430
|
hasNodeMiddleware,
|
|
2431
2431
|
hasInstrumentationHook,
|
|
@@ -11,7 +11,7 @@ import { isDeepStrictEqual } from 'util';
|
|
|
11
11
|
import { getDefineEnv } from '../define-env';
|
|
12
12
|
import { getReactCompilerLoader } from '../get-babel-loader-config';
|
|
13
13
|
import { throwTurbopackInternalError } from '../../shared/lib/turbopack/internal-error';
|
|
14
|
-
const nextVersion = "15.6.0-bun.
|
|
14
|
+
const nextVersion = "15.6.0-bun.16";
|
|
15
15
|
const ArchName = arch();
|
|
16
16
|
const PlatformName = platform();
|
|
17
17
|
function infoLog(...args) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/build/webpack-build/impl.ts"],"sourcesContent":["import type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { stringBufferUtils } from 'next/dist/compiled/webpack-sources3'\nimport { red } from '../../lib/picocolors'\nimport formatWebpackMessages from '../../shared/lib/format-webpack-messages'\nimport { nonNullable } from '../../lib/non-nullable'\nimport type { COMPILER_INDEXES } from '../../shared/lib/constants'\nimport {\n COMPILER_NAMES,\n CLIENT_STATIC_FILES_RUNTIME_MAIN_APP,\n APP_CLIENT_INTERNALS,\n PHASE_PRODUCTION_BUILD,\n} from '../../shared/lib/constants'\nimport { runCompiler } from '../compiler'\nimport * as Log from '../output/log'\nimport getBaseWebpackConfig, { loadProjectInfo } from '../webpack-config'\nimport type { NextError } from '../../lib/is-error'\nimport {\n TelemetryPlugin,\n type TelemetryPluginState,\n} from '../webpack/plugins/telemetry-plugin/telemetry-plugin'\nimport {\n NextBuildContext,\n resumePluginState,\n getPluginState,\n} from '../build-context'\nimport { createEntrypoints } from '../entries'\nimport loadConfig from '../../server/config'\nimport {\n getTraceEvents,\n initializeTraceState,\n setGlobal,\n trace,\n type TraceEvent,\n type TraceState,\n} from '../../trace'\nimport { WEBPACK_LAYERS } from '../../lib/constants'\nimport { TraceEntryPointsPlugin } from '../webpack/plugins/next-trace-entrypoints-plugin'\nimport type { BuildTraceContext } from '../webpack/plugins/next-trace-entrypoints-plugin'\nimport type { UnwrapPromise } from '../../lib/coalesced-function'\n\nimport origDebug from 'next/dist/compiled/debug'\nimport { Telemetry } from '../../telemetry/storage'\nimport { durationToString } from '../duration-to-string'\n\nconst debug = origDebug('next:build:webpack-build')\n\nfunction hrtimeToSeconds(hrtime: [number, number]): number {\n // hrtime is a tuple of [seconds, nanoseconds]\n return hrtime[0] + hrtime[1] / 1e9\n}\n\ntype CompilerResult = {\n errors: webpack.StatsError[]\n warnings: webpack.StatsError[]\n stats: (webpack.Stats | undefined)[]\n}\n\ntype SingleCompilerResult = {\n errors: webpack.StatsError[]\n warnings: webpack.StatsError[]\n stats: webpack.Stats | undefined\n}\n\nfunction isTelemetryPlugin(plugin: unknown): plugin is TelemetryPlugin {\n return plugin instanceof TelemetryPlugin\n}\n\nfunction isTraceEntryPointsPlugin(\n plugin: unknown\n): plugin is TraceEntryPointsPlugin {\n return plugin instanceof TraceEntryPointsPlugin\n}\n\nexport async function webpackBuildImpl(\n compilerName: keyof typeof COMPILER_INDEXES | null\n): Promise<{\n duration: number\n pluginState: any\n buildTraceContext?: BuildTraceContext\n telemetryState?: TelemetryPluginState\n}> {\n let result: CompilerResult | null = {\n warnings: [],\n errors: [],\n stats: [],\n }\n let webpackBuildStart\n const nextBuildSpan = NextBuildContext.nextBuildSpan!\n const dir = NextBuildContext.dir!\n const config = NextBuildContext.config!\n process.env.NEXT_COMPILER_NAME = compilerName || 'server'\n\n const runWebpackSpan = nextBuildSpan.traceChild('run-webpack-compiler')\n const entrypoints = await nextBuildSpan\n .traceChild('create-entrypoints')\n .traceAsyncFn(() =>\n createEntrypoints({\n buildId: NextBuildContext.buildId!,\n config: config,\n envFiles: NextBuildContext.loadedEnvFiles!,\n isDev: false,\n rootDir: dir,\n pageExtensions: config.pageExtensions!,\n pagesDir: NextBuildContext.pagesDir!,\n appDir: NextBuildContext.appDir!,\n pages: NextBuildContext.mappedPages!,\n appPaths: NextBuildContext.mappedAppPages!,\n previewMode: NextBuildContext.previewProps!,\n rootPaths: NextBuildContext.mappedRootPaths!,\n hasInstrumentationHook: NextBuildContext.hasInstrumentationHook!,\n })\n )\n\n const commonWebpackOptions = {\n isServer: false,\n isCompileMode: NextBuildContext.isCompileMode,\n buildId: NextBuildContext.buildId!,\n encryptionKey: NextBuildContext.encryptionKey!,\n config: config,\n appDir: NextBuildContext.appDir!,\n pagesDir: NextBuildContext.pagesDir!,\n rewrites: NextBuildContext.rewrites!,\n originalRewrites: NextBuildContext.originalRewrites,\n originalRedirects: NextBuildContext.originalRedirects,\n reactProductionProfiling: NextBuildContext.reactProductionProfiling!,\n noMangling: NextBuildContext.noMangling!,\n clientRouterFilters: NextBuildContext.clientRouterFilters!,\n previewProps: NextBuildContext.previewProps!,\n allowedRevalidateHeaderKeys: NextBuildContext.allowedRevalidateHeaderKeys!,\n fetchCacheKeyPrefix: NextBuildContext.fetchCacheKeyPrefix!,\n }\n\n const configs = await runWebpackSpan\n .traceChild('generate-webpack-config')\n .traceAsyncFn(async () => {\n const info = await loadProjectInfo({\n dir,\n config: commonWebpackOptions.config,\n dev: false,\n })\n return Promise.all([\n getBaseWebpackConfig(dir, {\n ...commonWebpackOptions,\n middlewareMatchers: entrypoints.middlewareMatchers,\n runWebpackSpan,\n compilerType: COMPILER_NAMES.client,\n entrypoints: entrypoints.client,\n ...info,\n }),\n getBaseWebpackConfig(dir, {\n ...commonWebpackOptions,\n runWebpackSpan,\n middlewareMatchers: entrypoints.middlewareMatchers,\n compilerType: COMPILER_NAMES.server,\n entrypoints: entrypoints.server,\n ...info,\n }),\n getBaseWebpackConfig(dir, {\n ...commonWebpackOptions,\n runWebpackSpan,\n middlewareMatchers: entrypoints.middlewareMatchers,\n compilerType: COMPILER_NAMES.edgeServer,\n entrypoints: entrypoints.edgeServer,\n ...info,\n }),\n ])\n })\n\n const clientConfig = configs[0]\n const serverConfig = configs[1]\n const edgeConfig = configs[2]\n\n if (\n clientConfig.optimization &&\n (clientConfig.optimization.minimize !== true ||\n (clientConfig.optimization.minimizer &&\n clientConfig.optimization.minimizer.length === 0))\n ) {\n Log.warn(\n `Production code optimization has been disabled in your project. Read more: https://nextjs.org/docs/messages/minification-disabled`\n )\n }\n\n webpackBuildStart = process.hrtime()\n\n debug(`starting compiler`, compilerName)\n // We run client and server compilation separately to optimize for memory usage\n await runWebpackSpan.traceAsyncFn(async () => {\n if (config.experimental.webpackMemoryOptimizations) {\n stringBufferUtils.disableDualStringBufferCaching()\n stringBufferUtils.enterStringInterningRange()\n }\n\n // Run the server compilers first and then the client\n // compiler to track the boundary of server/client components.\n let clientResult: SingleCompilerResult | null = null\n\n // During the server compilations, entries of client components will be\n // injected to this set and then will be consumed by the client compiler.\n let serverResult: UnwrapPromise<ReturnType<typeof runCompiler>>[0] | null =\n null\n let edgeServerResult:\n | UnwrapPromise<ReturnType<typeof runCompiler>>[0]\n | null = null\n\n let inputFileSystem: webpack.Compiler['inputFileSystem'] | undefined\n\n if (!compilerName || compilerName === 'server') {\n debug('starting server compiler')\n const start = Date.now()\n ;[serverResult, inputFileSystem] = await runCompiler(serverConfig, {\n runWebpackSpan,\n inputFileSystem,\n })\n debug(`server compiler finished ${Date.now() - start}ms`)\n }\n\n if (!compilerName || compilerName === 'edge-server') {\n debug('starting edge-server compiler')\n const start = Date.now()\n ;[edgeServerResult, inputFileSystem] = edgeConfig\n ? await runCompiler(edgeConfig, { runWebpackSpan, inputFileSystem })\n : [null]\n debug(`edge-server compiler finished ${Date.now() - start}ms`)\n }\n\n // Only continue if there were no errors\n if (!serverResult?.errors.length && !edgeServerResult?.errors.length) {\n const pluginState = getPluginState()\n for (const key in pluginState.injectedClientEntries) {\n const value = pluginState.injectedClientEntries[key]\n const clientEntry = clientConfig.entry as webpack.EntryObject\n if (key === APP_CLIENT_INTERNALS) {\n clientEntry[CLIENT_STATIC_FILES_RUNTIME_MAIN_APP] = {\n import: [\n // TODO-APP: cast clientEntry[CLIENT_STATIC_FILES_RUNTIME_MAIN_APP] to type EntryDescription once it's available from webpack\n // @ts-expect-error clientEntry['main-app'] is type EntryDescription { import: ... }\n ...clientEntry[CLIENT_STATIC_FILES_RUNTIME_MAIN_APP].import,\n value,\n ],\n layer: WEBPACK_LAYERS.appPagesBrowser,\n }\n } else {\n clientEntry[key] = {\n dependOn: [CLIENT_STATIC_FILES_RUNTIME_MAIN_APP],\n import: value,\n layer: WEBPACK_LAYERS.appPagesBrowser,\n }\n }\n }\n\n if (!compilerName || compilerName === 'client') {\n debug('starting client compiler')\n const start = Date.now()\n ;[clientResult, inputFileSystem] = await runCompiler(clientConfig, {\n runWebpackSpan,\n inputFileSystem,\n })\n debug(`client compiler finished ${Date.now() - start}ms`)\n }\n }\n\n if (config.experimental.webpackMemoryOptimizations) {\n stringBufferUtils.exitStringInterningRange()\n }\n inputFileSystem?.purge?.()\n\n result = {\n warnings: [\n ...(clientResult?.warnings ?? []),\n ...(serverResult?.warnings ?? []),\n ...(edgeServerResult?.warnings ?? []),\n ].filter(nonNullable),\n errors: [\n ...(clientResult?.errors ?? []),\n ...(serverResult?.errors ?? []),\n ...(edgeServerResult?.errors ?? []),\n ].filter(nonNullable),\n stats: [\n clientResult?.stats,\n serverResult?.stats,\n edgeServerResult?.stats,\n ],\n }\n })\n result = nextBuildSpan\n .traceChild('format-webpack-messages')\n .traceFn(() => formatWebpackMessages(result, true)) as CompilerResult\n\n const telemetryPlugin = (clientConfig as webpack.Configuration).plugins?.find(\n isTelemetryPlugin\n )\n\n const traceEntryPointsPlugin = (\n serverConfig as webpack.Configuration\n ).plugins?.find(isTraceEntryPointsPlugin)\n\n const webpackBuildEnd = process.hrtime(webpackBuildStart)\n\n if (result.errors.length > 0) {\n // Only keep the first few errors. Others are often indicative\n // of the same problem, but confuse the reader with noise.\n if (result.errors.length > 5) {\n result.errors.length = 5\n }\n let error = result.errors.filter(Boolean).join('\\n\\n')\n\n console.error(red('Failed to compile.\\n'))\n\n if (\n error.indexOf('private-next-pages') > -1 &&\n error.indexOf('does not contain a default export') > -1\n ) {\n const page_name_regex = /'private-next-pages\\/(?<page_name>[^']*)'/\n const parsed = page_name_regex.exec(error)\n const page_name = parsed && parsed.groups && parsed.groups.page_name\n throw new Error(\n `webpack build failed: found page without a React Component as default export in pages/${page_name}\\n\\nSee https://nextjs.org/docs/messages/page-without-valid-component for more info.`\n )\n }\n\n console.error(error)\n console.error()\n\n if (\n error.indexOf('private-next-pages') > -1 ||\n error.indexOf('__next_polyfill__') > -1\n ) {\n const err = new Error(\n 'webpack config.resolve.alias was incorrectly overridden. https://nextjs.org/docs/messages/invalid-resolve-alias'\n ) as NextError\n err.code = 'INVALID_RESOLVE_ALIAS'\n throw err\n }\n const err = new Error(\n `Build failed because of ${process.env.NEXT_RSPACK ? 'Rspack' : 'webpack'} errors`\n ) as NextError\n err.code = 'WEBPACK_ERRORS'\n throw err\n } else {\n const duration = hrtimeToSeconds(webpackBuildEnd)\n const durationString = durationToString(duration)\n\n if (result.warnings.length > 0) {\n Log.warn(`Compiled with warnings in ${durationString}\\n`)\n console.warn(result.warnings.filter(Boolean).join('\\n\\n'))\n console.warn()\n } else if (!compilerName) {\n Log.event(`Compiled successfully in ${durationString}`)\n }\n\n return {\n duration,\n buildTraceContext: traceEntryPointsPlugin?.buildTraceContext,\n pluginState: getPluginState(),\n telemetryState: {\n usages: telemetryPlugin?.usages() || [],\n packagesUsedInServerSideProps:\n telemetryPlugin?.packagesUsedInServerSideProps() || [],\n useCacheTracker: telemetryPlugin?.getUseCacheTracker() || {},\n },\n }\n }\n}\n\n// the main function when this file is run as a worker\nexport async function workerMain(workerData: {\n compilerName: keyof typeof COMPILER_INDEXES\n buildContext: typeof NextBuildContext\n traceState: TraceState\n}): Promise<\n Awaited<ReturnType<typeof webpackBuildImpl>> & {\n debugTraceEvents: TraceEvent[]\n }\n> {\n // Clone the telemetry for worker\n const telemetry = new Telemetry({\n distDir: workerData.buildContext.config!.distDir,\n })\n setGlobal('telemetry', telemetry)\n // setup new build context from the serialized data passed from the parent\n Object.assign(NextBuildContext, workerData.buildContext)\n\n // Initialize tracer state from the parent\n initializeTraceState(workerData.traceState)\n\n // Resume plugin state\n resumePluginState(NextBuildContext.pluginState)\n\n /// load the config because it's not serializable\n NextBuildContext.config = await loadConfig(\n PHASE_PRODUCTION_BUILD,\n NextBuildContext.dir!,\n { debugPrerender: NextBuildContext.debugPrerender }\n )\n NextBuildContext.nextBuildSpan = trace(\n `worker-main-${workerData.compilerName}`\n )\n\n const result = await webpackBuildImpl(workerData.compilerName)\n const { entriesTrace, chunksTrace } = result.buildTraceContext ?? {}\n if (entriesTrace) {\n const { entryNameMap, depModArray } = entriesTrace\n if (depModArray) {\n result.buildTraceContext!.entriesTrace!.depModArray = depModArray\n }\n if (entryNameMap) {\n const entryEntries = entryNameMap\n result.buildTraceContext!.entriesTrace!.entryNameMap = entryEntries\n }\n }\n if (chunksTrace?.entryNameFilesMap) {\n const entryNameFilesMap = chunksTrace.entryNameFilesMap\n result.buildTraceContext!.chunksTrace!.entryNameFilesMap = entryNameFilesMap\n }\n NextBuildContext.nextBuildSpan.stop()\n return { ...result, debugTraceEvents: getTraceEvents() }\n}\n"],"names":["stringBufferUtils","red","formatWebpackMessages","nonNullable","COMPILER_NAMES","CLIENT_STATIC_FILES_RUNTIME_MAIN_APP","APP_CLIENT_INTERNALS","PHASE_PRODUCTION_BUILD","runCompiler","Log","getBaseWebpackConfig","loadProjectInfo","TelemetryPlugin","NextBuildContext","resumePluginState","getPluginState","createEntrypoints","loadConfig","getTraceEvents","initializeTraceState","setGlobal","trace","WEBPACK_LAYERS","TraceEntryPointsPlugin","origDebug","Telemetry","durationToString","debug","hrtimeToSeconds","hrtime","isTelemetryPlugin","plugin","isTraceEntryPointsPlugin","webpackBuildImpl","compilerName","result","warnings","errors","stats","webpackBuildStart","nextBuildSpan","dir","config","process","env","NEXT_COMPILER_NAME","runWebpackSpan","traceChild","entrypoints","traceAsyncFn","buildId","envFiles","loadedEnvFiles","isDev","rootDir","pageExtensions","pagesDir","appDir","pages","mappedPages","appPaths","mappedAppPages","previewMode","previewProps","rootPaths","mappedRootPaths","hasInstrumentationHook","commonWebpackOptions","isServer","isCompileMode","encryptionKey","rewrites","originalRewrites","originalRedirects","reactProductionProfiling","noMangling","clientRouterFilters","allowedRevalidateHeaderKeys","fetchCacheKeyPrefix","configs","info","dev","Promise","all","middlewareMatchers","compilerType","client","server","edgeServer","clientConfig","serverConfig","edgeConfig","optimization","minimize","minimizer","length","warn","inputFileSystem","experimental","webpackMemoryOptimizations","disableDualStringBufferCaching","enterStringInterningRange","clientResult","serverResult","edgeServerResult","start","Date","now","pluginState","key","injectedClientEntries","value","clientEntry","entry","import","layer","appPagesBrowser","dependOn","exitStringInterningRange","purge","filter","traceFn","telemetryPlugin","plugins","find","traceEntryPointsPlugin","webpackBuildEnd","error","Boolean","join","console","indexOf","page_name_regex","parsed","exec","page_name","groups","Error","err","code","NEXT_RSPACK","duration","durationString","event","buildTraceContext","telemetryState","usages","packagesUsedInServerSideProps","useCacheTracker","getUseCacheTracker","workerMain","workerData","telemetry","distDir","buildContext","Object","assign","traceState","debugPrerender","entriesTrace","chunksTrace","entryNameMap","depModArray","entryEntries","entryNameFilesMap","stop","debugTraceEvents"],"mappings":"AACA,SAASA,iBAAiB,QAAQ,sCAAqC;AACvE,SAASC,GAAG,QAAQ,uBAAsB;AAC1C,OAAOC,2BAA2B,2CAA0C;AAC5E,SAASC,WAAW,QAAQ,yBAAwB;AAEpD,SACEC,cAAc,EACdC,oCAAoC,EACpCC,oBAAoB,EACpBC,sBAAsB,QACjB,6BAA4B;AACnC,SAASC,WAAW,QAAQ,cAAa;AACzC,YAAYC,SAAS,gBAAe;AACpC,OAAOC,wBAAwBC,eAAe,QAAQ,oBAAmB;AAEzE,SACEC,eAAe,QAEV,uDAAsD;AAC7D,SACEC,gBAAgB,EAChBC,iBAAiB,EACjBC,cAAc,QACT,mBAAkB;AACzB,SAASC,iBAAiB,QAAQ,aAAY;AAC9C,OAAOC,gBAAgB,sBAAqB;AAC5C,SACEC,cAAc,EACdC,oBAAoB,EACpBC,SAAS,EACTC,KAAK,QAGA,cAAa;AACpB,SAASC,cAAc,QAAQ,sBAAqB;AACpD,SAASC,sBAAsB,QAAQ,mDAAkD;AAIzF,OAAOC,eAAe,2BAA0B;AAChD,SAASC,SAAS,QAAQ,0BAAyB;AACnD,SAASC,gBAAgB,QAAQ,wBAAuB;AAExD,MAAMC,QAAQH,UAAU;AAExB,SAASI,gBAAgBC,MAAwB;IAC/C,8CAA8C;IAC9C,OAAOA,MAAM,CAAC,EAAE,GAAGA,MAAM,CAAC,EAAE,GAAG;AACjC;AAcA,SAASC,kBAAkBC,MAAe;IACxC,OAAOA,kBAAkBnB;AAC3B;AAEA,SAASoB,yBACPD,MAAe;IAEf,OAAOA,kBAAkBR;AAC3B;AAEA,OAAO,eAAeU,iBACpBC,YAAkD;QAuN1B,uBAIO;IApN/B,IAAIC,SAAgC;QAClCC,UAAU,EAAE;QACZC,QAAQ,EAAE;QACVC,OAAO,EAAE;IACX;IACA,IAAI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EACpB;QAAEqH,gBAAgBjJ,iBAAiBiJ,cAAc;IAAC;IAEpDjJ,iBAAiB2B,aAAa,GAAGnB,MAC/B,CAAC,YAAY,EAAEkI,WAAWrH,YAAY,EAAE;IAG1C,MAAMC,SAAS,MAAMF,iBAAiBsH,WAAWrH,YAAY;IAC7D,MAAM,EAAE6H,YAAY,EAAEC,WAAW,EAAE,GAAG7H,OAAO6G,iBAAiB,IAAI,CAAC;IACnE,IAAIe,cAAc;QAChB,MAAM,EAAEE,YAAY,EAAEC,WAAW,EAAE,GAAGH;QACtC,IAAIG,aAAa;YACf/H,OAAO6G,iBAAiB,CAAEe,YAAY,CAAEG,WAAW,GAAGA;QACxD;QACA,IAAID,cAAc;YAChB,MAAME,eAAeF;YACrB9H,OAAO6G,iBAAiB,CAAEe,YAAY,CAAEE,YAAY,GAAGE;QACzD;IACF;IACA,IAAIH,+BAAAA,YAAaI,iBAAiB,EAAE;QAClC,MAAMA,oBAAoBJ,YAAYI,iBAAiB;QACvDjI,OAAO6G,iBAAiB,CAAEgB,WAAW,CAAEI,iBAAiB,GAAGA;IAC7D;IACAvJ,iBAAiB2B,aAAa,CAAC6H,IAAI;IACnC,OAAO;QAAE,GAAGlI,MAAM;QAAEmI,kBAAkBpJ;IAAiB;AACzD","ignoreList":[0]}
|
|
1
|
+
{"version":3,"sources":["../../../src/build/webpack-build/impl.ts"],"sourcesContent":["import '../../server/require-hook'\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { stringBufferUtils } from 'next/dist/compiled/webpack-sources3'\nimport { red } from '../../lib/picocolors'\nimport formatWebpackMessages from '../../shared/lib/format-webpack-messages'\nimport { nonNullable } from '../../lib/non-nullable'\nimport type { COMPILER_INDEXES } from '../../shared/lib/constants'\nimport {\n COMPILER_NAMES,\n CLIENT_STATIC_FILES_RUNTIME_MAIN_APP,\n APP_CLIENT_INTERNALS,\n PHASE_PRODUCTION_BUILD,\n} from '../../shared/lib/constants'\nimport { runCompiler } from '../compiler'\nimport * as Log from '../output/log'\nimport getBaseWebpackConfig, { loadProjectInfo } from '../webpack-config'\nimport type { NextError } from '../../lib/is-error'\nimport {\n TelemetryPlugin,\n type TelemetryPluginState,\n} from '../webpack/plugins/telemetry-plugin/telemetry-plugin'\nimport {\n NextBuildContext,\n resumePluginState,\n getPluginState,\n} from '../build-context'\nimport { createEntrypoints } from '../entries'\nimport loadConfig from '../../server/config'\nimport {\n getTraceEvents,\n initializeTraceState,\n setGlobal,\n trace,\n type TraceEvent,\n type TraceState,\n} from '../../trace'\nimport { WEBPACK_LAYERS } from '../../lib/constants'\nimport { TraceEntryPointsPlugin } from '../webpack/plugins/next-trace-entrypoints-plugin'\nimport type { BuildTraceContext } from '../webpack/plugins/next-trace-entrypoints-plugin'\nimport type { UnwrapPromise } from '../../lib/coalesced-function'\n\nimport origDebug from 'next/dist/compiled/debug'\nimport { Telemetry } from '../../telemetry/storage'\nimport { durationToString } from '../duration-to-string'\n\nconst debug = origDebug('next:build:webpack-build')\n\nfunction hrtimeToSeconds(hrtime: [number, number]): number {\n // hrtime is a tuple of [seconds, nanoseconds]\n return hrtime[0] + hrtime[1] / 1e9\n}\n\ntype CompilerResult = {\n errors: webpack.StatsError[]\n warnings: webpack.StatsError[]\n stats: (webpack.Stats | undefined)[]\n}\n\ntype SingleCompilerResult = {\n errors: webpack.StatsError[]\n warnings: webpack.StatsError[]\n stats: webpack.Stats | undefined\n}\n\nfunction isTelemetryPlugin(plugin: unknown): plugin is TelemetryPlugin {\n return plugin instanceof TelemetryPlugin\n}\n\nfunction isTraceEntryPointsPlugin(\n plugin: unknown\n): plugin is TraceEntryPointsPlugin {\n return plugin instanceof TraceEntryPointsPlugin\n}\n\nexport async function webpackBuildImpl(\n compilerName: keyof typeof COMPILER_INDEXES | null\n): Promise<{\n duration: number\n pluginState: any\n buildTraceContext?: BuildTraceContext\n telemetryState?: TelemetryPluginState\n}> {\n let result: CompilerResult | null = {\n warnings: [],\n errors: [],\n stats: [],\n }\n let webpackBuildStart\n const nextBuildSpan = NextBuildContext.nextBuildSpan!\n const dir = NextBuildContext.dir!\n const config = NextBuildContext.config!\n process.env.NEXT_COMPILER_NAME = compilerName || 'server'\n\n const runWebpackSpan = nextBuildSpan.traceChild('run-webpack-compiler')\n const entrypoints = await nextBuildSpan\n .traceChild('create-entrypoints')\n .traceAsyncFn(() =>\n createEntrypoints({\n buildId: NextBuildContext.buildId!,\n config: config,\n envFiles: NextBuildContext.loadedEnvFiles!,\n isDev: false,\n rootDir: dir,\n pageExtensions: config.pageExtensions!,\n pagesDir: NextBuildContext.pagesDir!,\n appDir: NextBuildContext.appDir!,\n pages: NextBuildContext.mappedPages!,\n appPaths: NextBuildContext.mappedAppPages!,\n previewMode: NextBuildContext.previewProps!,\n rootPaths: NextBuildContext.mappedRootPaths!,\n hasInstrumentationHook: NextBuildContext.hasInstrumentationHook!,\n })\n )\n\n const commonWebpackOptions = {\n isServer: false,\n isCompileMode: NextBuildContext.isCompileMode,\n buildId: NextBuildContext.buildId!,\n encryptionKey: NextBuildContext.encryptionKey!,\n config: config,\n appDir: NextBuildContext.appDir!,\n pagesDir: NextBuildContext.pagesDir!,\n rewrites: NextBuildContext.rewrites!,\n originalRewrites: NextBuildContext.originalRewrites,\n originalRedirects: NextBuildContext.originalRedirects,\n reactProductionProfiling: NextBuildContext.reactProductionProfiling!,\n noMangling: NextBuildContext.noMangling!,\n clientRouterFilters: NextBuildContext.clientRouterFilters!,\n previewProps: NextBuildContext.previewProps!,\n allowedRevalidateHeaderKeys: NextBuildContext.allowedRevalidateHeaderKeys!,\n fetchCacheKeyPrefix: NextBuildContext.fetchCacheKeyPrefix!,\n }\n\n const configs = await runWebpackSpan\n .traceChild('generate-webpack-config')\n .traceAsyncFn(async () => {\n const info = await loadProjectInfo({\n dir,\n config: commonWebpackOptions.config,\n dev: false,\n })\n return Promise.all([\n getBaseWebpackConfig(dir, {\n ...commonWebpackOptions,\n middlewareMatchers: entrypoints.middlewareMatchers,\n runWebpackSpan,\n compilerType: COMPILER_NAMES.client,\n entrypoints: entrypoints.client,\n ...info,\n }),\n getBaseWebpackConfig(dir, {\n ...commonWebpackOptions,\n runWebpackSpan,\n middlewareMatchers: entrypoints.middlewareMatchers,\n compilerType: COMPILER_NAMES.server,\n entrypoints: entrypoints.server,\n ...info,\n }),\n getBaseWebpackConfig(dir, {\n ...commonWebpackOptions,\n runWebpackSpan,\n middlewareMatchers: entrypoints.middlewareMatchers,\n compilerType: COMPILER_NAMES.edgeServer,\n entrypoints: entrypoints.edgeServer,\n ...info,\n }),\n ])\n })\n\n const clientConfig = configs[0]\n const serverConfig = configs[1]\n const edgeConfig = configs[2]\n\n if (\n clientConfig.optimization &&\n (clientConfig.optimization.minimize !== true ||\n (clientConfig.optimization.minimizer &&\n clientConfig.optimization.minimizer.length === 0))\n ) {\n Log.warn(\n `Production code optimization has been disabled in your project. Read more: https://nextjs.org/docs/messages/minification-disabled`\n )\n }\n\n webpackBuildStart = process.hrtime()\n\n debug(`starting compiler`, compilerName)\n // We run client and server compilation separately to optimize for memory usage\n await runWebpackSpan.traceAsyncFn(async () => {\n if (config.experimental.webpackMemoryOptimizations) {\n stringBufferUtils.disableDualStringBufferCaching()\n stringBufferUtils.enterStringInterningRange()\n }\n\n // Run the server compilers first and then the client\n // compiler to track the boundary of server/client components.\n let clientResult: SingleCompilerResult | null = null\n\n // During the server compilations, entries of client components will be\n // injected to this set and then will be consumed by the client compiler.\n let serverResult: UnwrapPromise<ReturnType<typeof runCompiler>>[0] | null =\n null\n let edgeServerResult:\n | UnwrapPromise<ReturnType<typeof runCompiler>>[0]\n | null = null\n\n let inputFileSystem: webpack.Compiler['inputFileSystem'] | undefined\n\n if (!compilerName || compilerName === 'server') {\n debug('starting server compiler')\n const start = Date.now()\n ;[serverResult, inputFileSystem] = await runCompiler(serverConfig, {\n runWebpackSpan,\n inputFileSystem,\n })\n debug(`server compiler finished ${Date.now() - start}ms`)\n }\n\n if (!compilerName || compilerName === 'edge-server') {\n debug('starting edge-server compiler')\n const start = Date.now()\n ;[edgeServerResult, inputFileSystem] = edgeConfig\n ? await runCompiler(edgeConfig, { runWebpackSpan, inputFileSystem })\n : [null]\n debug(`edge-server compiler finished ${Date.now() - start}ms`)\n }\n\n // Only continue if there were no errors\n if (!serverResult?.errors.length && !edgeServerResult?.errors.length) {\n const pluginState = getPluginState()\n for (const key in pluginState.injectedClientEntries) {\n const value = pluginState.injectedClientEntries[key]\n const clientEntry = clientConfig.entry as webpack.EntryObject\n if (key === APP_CLIENT_INTERNALS) {\n clientEntry[CLIENT_STATIC_FILES_RUNTIME_MAIN_APP] = {\n import: [\n // TODO-APP: cast clientEntry[CLIENT_STATIC_FILES_RUNTIME_MAIN_APP] to type EntryDescription once it's available from webpack\n // @ts-expect-error clientEntry['main-app'] is type EntryDescription { import: ... }\n ...clientEntry[CLIENT_STATIC_FILES_RUNTIME_MAIN_APP].import,\n value,\n ],\n layer: WEBPACK_LAYERS.appPagesBrowser,\n }\n } else {\n clientEntry[key] = {\n dependOn: [CLIENT_STATIC_FILES_RUNTIME_MAIN_APP],\n import: value,\n layer: WEBPACK_LAYERS.appPagesBrowser,\n }\n }\n }\n\n if (!compilerName || compilerName === 'client') {\n debug('starting client compiler')\n const start = Date.now()\n ;[clientResult, inputFileSystem] = await runCompiler(clientConfig, {\n runWebpackSpan,\n inputFileSystem,\n })\n debug(`client compiler finished ${Date.now() - start}ms`)\n }\n }\n\n if (config.experimental.webpackMemoryOptimizations) {\n stringBufferUtils.exitStringInterningRange()\n }\n inputFileSystem?.purge?.()\n\n result = {\n warnings: [\n ...(clientResult?.warnings ?? []),\n ...(serverResult?.warnings ?? []),\n ...(edgeServerResult?.warnings ?? []),\n ].filter(nonNullable),\n errors: [\n ...(clientResult?.errors ?? []),\n ...(serverResult?.errors ?? []),\n ...(edgeServerResult?.errors ?? []),\n ].filter(nonNullable),\n stats: [\n clientResult?.stats,\n serverResult?.stats,\n edgeServerResult?.stats,\n ],\n }\n })\n result = nextBuildSpan\n .traceChild('format-webpack-messages')\n .traceFn(() => formatWebpackMessages(result, true)) as CompilerResult\n\n const telemetryPlugin = (clientConfig as webpack.Configuration).plugins?.find(\n isTelemetryPlugin\n )\n\n const traceEntryPointsPlugin = (\n serverConfig as webpack.Configuration\n ).plugins?.find(isTraceEntryPointsPlugin)\n\n const webpackBuildEnd = process.hrtime(webpackBuildStart)\n\n if (result.errors.length > 0) {\n // Only keep the first few errors. Others are often indicative\n // of the same problem, but confuse the reader with noise.\n if (result.errors.length > 5) {\n result.errors.length = 5\n }\n let error = result.errors.filter(Boolean).join('\\n\\n')\n\n console.error(red('Failed to compile.\\n'))\n\n if (\n error.indexOf('private-next-pages') > -1 &&\n error.indexOf('does not contain a default export') > -1\n ) {\n const page_name_regex = /'private-next-pages\\/(?<page_name>[^']*)'/\n const parsed = page_name_regex.exec(error)\n const page_name = parsed && parsed.groups && parsed.groups.page_name\n throw new Error(\n `webpack build failed: found page without a React Component as default export in pages/${page_name}\\n\\nSee https://nextjs.org/docs/messages/page-without-valid-component for more info.`\n )\n }\n\n console.error(error)\n console.error()\n\n if (\n error.indexOf('private-next-pages') > -1 ||\n error.indexOf('__next_polyfill__') > -1\n ) {\n const err = new Error(\n 'webpack config.resolve.alias was incorrectly overridden. https://nextjs.org/docs/messages/invalid-resolve-alias'\n ) as NextError\n err.code = 'INVALID_RESOLVE_ALIAS'\n throw err\n }\n const err = new Error(\n `Build failed because of ${process.env.NEXT_RSPACK ? 'Rspack' : 'webpack'} errors`\n ) as NextError\n err.code = 'WEBPACK_ERRORS'\n throw err\n } else {\n const duration = hrtimeToSeconds(webpackBuildEnd)\n const durationString = durationToString(duration)\n\n if (result.warnings.length > 0) {\n Log.warn(`Compiled with warnings in ${durationString}\\n`)\n console.warn(result.warnings.filter(Boolean).join('\\n\\n'))\n console.warn()\n } else if (!compilerName) {\n Log.event(`Compiled successfully in ${durationString}`)\n }\n\n return {\n duration,\n buildTraceContext: traceEntryPointsPlugin?.buildTraceContext,\n pluginState: getPluginState(),\n telemetryState: {\n usages: telemetryPlugin?.usages() || [],\n packagesUsedInServerSideProps:\n telemetryPlugin?.packagesUsedInServerSideProps() || [],\n useCacheTracker: telemetryPlugin?.getUseCacheTracker() || {},\n },\n }\n }\n}\n\n// the main function when this file is run as a worker\nexport async function workerMain(workerData: {\n compilerName: keyof typeof COMPILER_INDEXES\n buildContext: typeof NextBuildContext\n traceState: TraceState\n}): Promise<\n Awaited<ReturnType<typeof webpackBuildImpl>> & {\n debugTraceEvents: TraceEvent[]\n }\n> {\n // Clone the telemetry for worker\n const telemetry = new Telemetry({\n distDir: workerData.buildContext.config!.distDir,\n })\n setGlobal('telemetry', telemetry)\n // setup new build context from the serialized data passed from the parent\n Object.assign(NextBuildContext, workerData.buildContext)\n\n // Initialize tracer state from the parent\n initializeTraceState(workerData.traceState)\n\n // Resume plugin state\n resumePluginState(NextBuildContext.pluginState)\n\n /// load the config because it's not serializable\n NextBuildContext.config = await loadConfig(\n PHASE_PRODUCTION_BUILD,\n NextBuildContext.dir!,\n { debugPrerender: NextBuildContext.debugPrerender }\n )\n NextBuildContext.nextBuildSpan = trace(\n `worker-main-${workerData.compilerName}`\n )\n\n const result = await webpackBuildImpl(workerData.compilerName)\n const { entriesTrace, chunksTrace } = result.buildTraceContext ?? {}\n if (entriesTrace) {\n const { entryNameMap, depModArray } = entriesTrace\n if (depModArray) {\n result.buildTraceContext!.entriesTrace!.depModArray = depModArray\n }\n if (entryNameMap) {\n const entryEntries = entryNameMap\n result.buildTraceContext!.entriesTrace!.entryNameMap = entryEntries\n }\n }\n if (chunksTrace?.entryNameFilesMap) {\n const entryNameFilesMap = chunksTrace.entryNameFilesMap\n result.buildTraceContext!.chunksTrace!.entryNameFilesMap = entryNameFilesMap\n }\n NextBuildContext.nextBuildSpan.stop()\n return { ...result, debugTraceEvents: getTraceEvents() }\n}\n"],"names":["stringBufferUtils","red","formatWebpackMessages","nonNullable","COMPILER_NAMES","CLIENT_STATIC_FILES_RUNTIME_MAIN_APP","APP_CLIENT_INTERNALS","PHASE_PRODUCTION_BUILD","runCompiler","Log","getBaseWebpackConfig","loadProjectInfo","TelemetryPlugin","NextBuildContext","resumePluginState","getPluginState","createEntrypoints","loadConfig","getTraceEvents","initializeTraceState","setGlobal","trace","WEBPACK_LAYERS","TraceEntryPointsPlugin","origDebug","Telemetry","durationToString","debug","hrtimeToSeconds","hrtime","isTelemetryPlugin","plugin","isTraceEntryPointsPlugin","webpackBuildImpl","compilerName","result","warnings","errors","stats","webpackBuildStart","nextBuildSpan","dir","config","process","env","NEXT_COMPILER_NAME","runWebpackSpan","traceChild","entrypoints","traceAsyncFn","buildId","envFiles","loadedEnvFiles","isDev","rootDir","pageExtensions","pagesDir","appDir","pages","mappedPages","appPaths","mappedAppPages","previewMode","previewProps","rootPaths","mappedRootPaths","hasInstrumentationHook","commonWebpackOptions","isServer","isCompileMode","encryptionKey","rewrites","originalRewrites","originalRedirects","reactProductionProfiling","noMangling","clientRouterFilters","allowedRevalidateHeaderKeys","fetchCacheKeyPrefix","configs","info","dev","Promise","all","middlewareMatchers","compilerType","client","server","edgeServer","clientConfig","serverConfig","edgeConfig","optimization","minimize","minimizer","length","warn","inputFileSystem","experimental","webpackMemoryOptimizations","disableDualStringBufferCaching","enterStringInterningRange","clientResult","serverResult","edgeServerResult","start","Date","now","pluginState","key","injectedClientEntries","value","clientEntry","entry","import","layer","appPagesBrowser","dependOn","exitStringInterningRange","purge","filter","traceFn","telemetryPlugin","plugins","find","traceEntryPointsPlugin","webpackBuildEnd","error","Boolean","join","console","indexOf","page_name_regex","parsed","exec","page_name","groups","Error","err","code","NEXT_RSPACK","duration","durationString","event","buildTraceContext","telemetryState","usages","packagesUsedInServerSideProps","useCacheTracker","getUseCacheTracker","workerMain","workerData","telemetry","distDir","buildContext","Object","assign","traceState","debugPrerender","entriesTrace","chunksTrace","entryNameMap","depModArray","entryEntries","entryNameFilesMap","stop","debugTraceEvents"],"mappings":"AAAA,OAAO,4BAA2B;AAElC,SAASA,iBAAiB,Q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IAG1C,MAAMC,SAAS,MAAMF,iBAAiBsH,WAAWrH,YAAY;IAC7D,MAAM,EAAE6H,YAAY,EAAEC,WAAW,EAAE,GAAG7H,OAAO6G,iBAAiB,IAAI,CAAC;IACnE,IAAIe,cAAc;QAChB,MAAM,EAAEE,YAAY,EAAEC,WAAW,EAAE,GAAGH;QACtC,IAAIG,aAAa;YACf/H,OAAO6G,iBAAiB,CAAEe,YAAY,CAAEG,WAAW,GAAGA;QACxD;QACA,IAAID,cAAc;YAChB,MAAME,eAAeF;YACrB9H,OAAO6G,iBAAiB,CAAEe,YAAY,CAAEE,YAAY,GAAGE;QACzD;IACF;IACA,IAAIH,+BAAAA,YAAaI,iBAAiB,EAAE;QAClC,MAAMA,oBAAoBJ,YAAYI,iBAAiB;QACvDjI,OAAO6G,iBAAiB,CAAEgB,WAAW,CAAEI,iBAAiB,GAAGA;IAC7D;IACAvJ,iBAAiB2B,aAAa,CAAC6H,IAAI;IACnC,OAAO;QAAE,GAAGlI,MAAM;QAAEmI,kBAAkBpJ;IAAiB;AACzD","ignoreList":[0]}
|
|
@@ -1575,7 +1575,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
1575
1575
|
isClient && new CopyFilePlugin({
|
|
1576
1576
|
// file path to build output of `@next/polyfill-nomodule`
|
|
1577
1577
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
|
1578
|
-
cacheKey: "15.6.0-bun.
|
|
1578
|
+
cacheKey: "15.6.0-bun.16",
|
|
1579
1579
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
|
1580
1580
|
minimize: false,
|
|
1581
1581
|
info: {
|
|
@@ -1756,7 +1756,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
1756
1756
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
|
1757
1757
|
// - Next.js version
|
|
1758
1758
|
// - next.config.js keys that affect compilation
|
|
1759
|
-
version: `${__dirname}|${"15.6.0-bun.
|
|
1759
|
+
version: `${__dirname}|${"15.6.0-bun.16"}|${configVars}`,
|
|
1760
1760
|
cacheDirectory: path.join(distDir, 'cache', 'webpack'),
|
|
1761
1761
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
|
1762
1762
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* - next/script with `beforeInteractive` strategy
|
|
6
6
|
*/ import { getAssetPrefix } from './asset-prefix';
|
|
7
7
|
import { setAttributesFromProps } from './set-attributes-from-props';
|
|
8
|
-
const version = "15.6.0-bun.
|
|
8
|
+
const version = "15.6.0-bun.16";
|
|
9
9
|
window.next = {
|
|
10
10
|
version,
|
|
11
11
|
appDir: true
|
package/dist/esm/client/index.js
CHANGED
|
@@ -26,7 +26,7 @@ import { SearchParamsContext, PathParamsContext } from '../shared/lib/hooks-clie
|
|
|
26
26
|
import { onRecoverableError } from './react-client-callbacks/on-recoverable-error';
|
|
27
27
|
import tracer from './tracing/tracer';
|
|
28
28
|
import { isNextRouterError } from './components/is-next-router-error';
|
|
29
|
-
export const version = "15.6.0-bun.
|
|
29
|
+
export const version = "15.6.0-bun.16";
|
|
30
30
|
export let router;
|
|
31
31
|
export const emitter = mitt();
|
|
32
32
|
const looseToArray = (input)=>[].slice.call(input);
|
|
@@ -158,7 +158,7 @@ export default class HotReloaderWebpack {
|
|
|
158
158
|
this.previewProps = previewProps;
|
|
159
159
|
this.rewrites = rewrites;
|
|
160
160
|
this.hotReloaderSpan = trace('hot-reloader', undefined, {
|
|
161
|
-
version: "15.6.0-bun.
|
|
161
|
+
version: "15.6.0-bun.16"
|
|
162
162
|
});
|
|
163
163
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
|
164
164
|
// of the current `next dev` invocation.
|
|
@@ -14,7 +14,7 @@ export function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures
|
|
|
14
14
|
bundlerSuffix = ' (webpack)';
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.6.0-bun.
|
|
17
|
+
Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.6.0-bun.16"}`))}${bundlerSuffix}`);
|
|
18
18
|
if (appUrl) {
|
|
19
19
|
Log.bootstrap(`- Local: ${appUrl}`);
|
|
20
20
|
}
|
|
@@ -87,7 +87,7 @@ export async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup,
|
|
|
87
87
|
export async function startServer(serverOptions) {
|
|
88
88
|
const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
|
|
89
89
|
let { port } = serverOptions;
|
|
90
|
-
process.title = `next-server (v${"15.6.0-bun.
|
|
90
|
+
process.title = `next-server (v${"15.6.0-bun.16"})`;
|
|
91
91
|
let handlersReady = ()=>{};
|
|
92
92
|
let handlersError = ()=>{};
|
|
93
93
|
let handlersPromise = new Promise((resolve, reject)=>{
|
|
@@ -30,11 +30,13 @@ addHookAliases(toResolveMap(defaultOverrides));
|
|
|
30
30
|
mod._resolveFilename = (function(originalResolveFilename, requestMap, pkgName, request, parent, isMain, options) {
|
|
31
31
|
const hookResolved = requestMap.get(request);
|
|
32
32
|
if (hookResolved) request = hookResolved;
|
|
33
|
-
// Redirect next/dist/ and next/
|
|
33
|
+
// Redirect next/dist/, next/font/, and next/package.json requests to the actual package name (supports forked packages)
|
|
34
34
|
if (request.startsWith('next/dist/')) {
|
|
35
35
|
request = request.replace('next/dist/', `${pkgName}/dist/`);
|
|
36
36
|
} else if (request.startsWith('next/font/')) {
|
|
37
37
|
request = request.replace('next/font/', `${pkgName}/font/`);
|
|
38
|
+
} else if (request === 'next/package.json') {
|
|
39
|
+
request = `${pkgName}/package.json`;
|
|
38
40
|
}
|
|
39
41
|
return originalResolveFilename.call(mod, request, parent, isMain, options);
|
|
40
42
|
// We use `bind` here to avoid referencing outside variables to create potential memory leaks.
|
|
@@ -47,11 +49,13 @@ mod.prototype.require = function(request) {
|
|
|
47
49
|
if (request.endsWith('.shared-runtime')) {
|
|
48
50
|
return originalRequire.call(this, `${PKG_NAME}/dist/server/route-modules/pages/vendored/contexts/${path.basename(request, '.shared-runtime')}`);
|
|
49
51
|
}
|
|
50
|
-
// Redirect next/dist/ and next/
|
|
52
|
+
// Redirect next/dist/, next/font/, and next/package.json requests to the actual package name (supports forked packages)
|
|
51
53
|
if (request.startsWith('next/dist/')) {
|
|
52
54
|
return originalRequire.call(this, request.replace('next/dist/', `${PKG_NAME}/dist/`));
|
|
53
55
|
} else if (request.startsWith('next/font/')) {
|
|
54
56
|
return originalRequire.call(this, request.replace('next/font/', `${PKG_NAME}/font/`));
|
|
57
|
+
} else if (request === 'next/package.json') {
|
|
58
|
+
return originalRequire.call(this, `${PKG_NAME}/package.json`);
|
|
55
59
|
}
|
|
56
60
|
return originalRequire.call(this, request);
|
|
57
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/server/require-hook.ts"],"sourcesContent":["// Synchronously inject a require hook for webpack and webpack/. It's required to use the internal ncc webpack version.\n// This is needed for userland plugins to attach to the same webpack instance as Next.js'.\n// Individually compiled modules are as defined for the compilation in bundles/webpack/packages/*.\n\n// This module will only be loaded once per process.\nconst path = require('path') as typeof import('path')\nconst mod = require('module') as typeof import('module')\n\n// Read package name dynamically to support forked packages\nconst PKG_NAME = require('../../package.json').name\nconst originalRequire = mod.prototype.require\nconst resolveFilename =\n // @ts-expect-error\n mod._resolveFilename\n\nlet resolve: typeof require.resolve = process.env.NEXT_MINIMAL\n ? // @ts-ignore\n __non_webpack_require__.resolve\n : require.resolve\n\nexport const hookPropertyMap = new Map()\n\nexport const defaultOverrides = {\n 'styled-jsx': path.dirname(resolve('styled-jsx/package.json')),\n 'styled-jsx/style': resolve('styled-jsx/style'),\n 'styled-jsx/style.js': resolve('styled-jsx/style'),\n}\n\nconst toResolveMap = (map: Record<string, string>): [string, string][] =>\n Object.entries(map).map(([key, value]) => [key, resolve(value)])\n\nexport function addHookAliases(aliases: [string, string][] = []) {\n for (const [key, value] of aliases) {\n hookPropertyMap.set(key, value)\n }\n}\n\naddHookAliases(toResolveMap(defaultOverrides))\n\n// @ts-expect-error\nmod._resolveFilename = function (\n originalResolveFilename: (\n request: string,\n parent: string,\n isMain: boolean,\n opts: any\n ) => string,\n requestMap: Map<string, string>,\n pkgName: string,\n request: string,\n parent: string,\n isMain: boolean,\n options: any\n) {\n const hookResolved = requestMap.get(request)\n if (hookResolved) request = hookResolved\n\n // Redirect next/dist/ and next/
|
|
1
|
+
{"version":3,"sources":["../../src/server/require-hook.ts"],"sourcesContent":["// Synchronously inject a require hook for webpack and webpack/. It's required to use the internal ncc webpack version.\n// This is needed for userland plugins to attach to the same webpack instance as Next.js'.\n// Individually compiled modules are as defined for the compilation in bundles/webpack/packages/*.\n\n// This module will only be loaded once per process.\nconst path = require('path') as typeof import('path')\nconst mod = require('module') as typeof import('module')\n\n// Read package name dynamically to support forked packages\nconst PKG_NAME = require('../../package.json').name\nconst originalRequire = mod.prototype.require\nconst resolveFilename =\n // @ts-expect-error\n mod._resolveFilename\n\nlet resolve: typeof require.resolve = process.env.NEXT_MINIMAL\n ? // @ts-ignore\n __non_webpack_require__.resolve\n : require.resolve\n\nexport const hookPropertyMap = new Map()\n\nexport const defaultOverrides = {\n 'styled-jsx': path.dirname(resolve('styled-jsx/package.json')),\n 'styled-jsx/style': resolve('styled-jsx/style'),\n 'styled-jsx/style.js': resolve('styled-jsx/style'),\n}\n\nconst toResolveMap = (map: Record<string, string>): [string, string][] =>\n Object.entries(map).map(([key, value]) => [key, resolve(value)])\n\nexport function addHookAliases(aliases: [string, string][] = []) {\n for (const [key, value] of aliases) {\n hookPropertyMap.set(key, value)\n }\n}\n\naddHookAliases(toResolveMap(defaultOverrides))\n\n// @ts-expect-error\nmod._resolveFilename = function (\n originalResolveFilename: (\n request: string,\n parent: string,\n isMain: boolean,\n opts: any\n ) => string,\n requestMap: Map<string, string>,\n pkgName: string,\n request: string,\n parent: string,\n isMain: boolean,\n options: any\n) {\n const hookResolved = requestMap.get(request)\n if (hookResolved) request = hookResolved\n\n // Redirect next/dist/, next/font/, and next/package.json requests to the actual package name (supports forked packages)\n if (request.startsWith('next/dist/')) {\n request = request.replace('next/dist/', `${pkgName}/dist/`)\n } else if (request.startsWith('next/font/')) {\n request = request.replace('next/font/', `${pkgName}/font/`)\n } else if (request === 'next/package.json') {\n request = `${pkgName}/package.json`\n }\n\n return originalResolveFilename.call(mod, request, parent, isMain, options)\n\n // We use `bind` here to avoid referencing outside variables to create potential memory leaks.\n}.bind(null, resolveFilename, hookPropertyMap, PKG_NAME)\n\n// @ts-expect-error\n// This is a hack to make sure that if a user requires a Next.js module that wasn't bundled\n// that needs to point to the rendering runtime version, it will point to the correct one.\n// This can happen on `pages` when a user requires a dependency that uses next/image for example.\nmod.prototype.require = function (request: string) {\n if (request.endsWith('.shared-runtime')) {\n return originalRequire.call(\n this,\n `${PKG_NAME}/dist/server/route-modules/pages/vendored/contexts/${path.basename(\n request,\n '.shared-runtime'\n )}`\n )\n }\n\n // Redirect next/dist/, next/font/, and next/package.json requests to the actual package name (supports forked packages)\n if (request.startsWith('next/dist/')) {\n return originalRequire.call(this, request.replace('next/dist/', `${PKG_NAME}/dist/`))\n } else if (request.startsWith('next/font/')) {\n return originalRequire.call(this, request.replace('next/font/', `${PKG_NAME}/font/`))\n } else if (request === 'next/package.json') {\n return originalRequire.call(this, `${PKG_NAME}/package.json`)\n }\n\n return originalRequire.call(this, request)\n}\n"],"names":["path","require","mod","PKG_NAME","name","originalRequire","prototype","resolveFilename","_resolveFilename","resolve","process","env","NEXT_MINIMAL","__non_webpack_require__","hookPropertyMap","Map","defaultOverrides","dirname","toResolveMap","map","Object","entries","key","value","addHookAliases","aliases","set","originalResolveFilename","requestMap","pkgName","request","parent","isMain","options","hookResolved","get","startsWith","replace","call","bind","endsW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AAUA,QAAQO,OAAO,CAAC,cAAc,GAAGR,QAAQ,MAAM,CAAC;IAC5D,OAAO,IAAIC,YAAY,qBAAqB;QAC1CA,UAAU,GAAGD,QAAQ,aAAa,CAAC;IACrC;IAEA,OAAOF,wBAAwBW,IAAI,CAACpC,KAAK4B,SAASC,QAAQC,QAAQC;AAElE,8FAA8F;AAChG,CAAA,EAAEM,IAAI,CAAC,MAAMhC,iBAAiBO,iBAAiBX;AAE/C,mBAAmB;AACnB,2FAA2F;AAC3F,0FAA0F;AAC1F,iGAAiG;AACjGD,IAAII,SAAS,CAACL,OAAO,GAAG,SAAU6B,OAAe;IAC/C,IAAIA,QAAQU,QAAQ,CAAC,oBAAoB;QACvC,OAAOnC,gBAAgBiC,IAAI,CACzB,IAAI,EACJ,GAAGnC,SAAS,mDAAmD,EAAEH,KAAKyC,QAAQ,CAC5EX,SACA,oBACC;IAEP;IAEA,wHAAwH;IACxH,IAAIA,QAAQM,UAAU,CAAC,eAAe;QACpC,OAAO/B,gBAAgBiC,IAAI,CAAC,IAAI,EAAER,QAAQO,OAAO,CAAC,cAAc,GAAGlC,SAAS,MAAM,CAAC;IACrF,OAAO,IAAI2B,QAAQM,UAAU,CAAC,eAAe;QAC3C,OAAO/B,gBAAgBiC,IAAI,CAAC,IAAI,EAAER,QAAQO,OAAO,CAAC,cAAc,GAAGlC,SAAS,MAAM,CAAC;IACrF,OAAO,IAAI2B,YAAY,qBAAqB;QAC1C,OAAOzB,gBAAgBiC,IAAI,CAAC,IAAI,EAAE,GAAGnC,SAAS,aAAa,CAAC;IAC9D;IAEA,OAAOE,gBAAgBiC,IAAI,CAAC,IAAI,EAAER;AACpC","ignoreList":[0]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export function isStableBuild() {
|
|
2
2
|
var _process_env___NEXT_VERSION;
|
|
3
|
-
return !((_process_env___NEXT_VERSION = "15.6.0-bun.
|
|
3
|
+
return !((_process_env___NEXT_VERSION = "15.6.0-bun.16") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
|
|
4
4
|
}
|
|
5
5
|
export class CanaryOnlyError extends Error {
|
|
6
6
|
constructor(arg){
|
|
@@ -226,7 +226,7 @@ class HotReloaderWebpack {
|
|
|
226
226
|
this.previewProps = previewProps;
|
|
227
227
|
this.rewrites = rewrites;
|
|
228
228
|
this.hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
|
|
229
|
-
version: "15.6.0-bun.
|
|
229
|
+
version: "15.6.0-bun.16"
|
|
230
230
|
});
|
|
231
231
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
|
232
232
|
// of the current `next dev` invocation.
|
|
@@ -82,7 +82,7 @@ function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures, logBu
|
|
|
82
82
|
bundlerSuffix = ' (webpack)';
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
_log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"15.6.0-bun.
|
|
85
|
+
_log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"15.6.0-bun.16"}`))}${bundlerSuffix}`);
|
|
86
86
|
if (appUrl) {
|
|
87
87
|
_log.bootstrap(`- Local: ${appUrl}`);
|
|
88
88
|
}
|
|
@@ -155,7 +155,7 @@ async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup, server
|
|
|
155
155
|
async function startServer(serverOptions) {
|
|
156
156
|
const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
|
|
157
157
|
let { port } = serverOptions;
|
|
158
|
-
process.title = `next-server (v${"15.6.0-bun.
|
|
158
|
+
process.title = `next-server (v${"15.6.0-bun.16"})`;
|
|
159
159
|
let handlersReady = ()=>{};
|
|
160
160
|
let handlersError = ()=>{};
|
|
161
161
|
let handlersPromise = new Promise((resolve, reject)=>{
|
|
@@ -56,11 +56,13 @@ addHookAliases(toResolveMap(defaultOverrides));
|
|
|
56
56
|
mod._resolveFilename = (function(originalResolveFilename, requestMap, pkgName, request, parent, isMain, options) {
|
|
57
57
|
const hookResolved = requestMap.get(request);
|
|
58
58
|
if (hookResolved) request = hookResolved;
|
|
59
|
-
// Redirect next/dist/ and next/
|
|
59
|
+
// Redirect next/dist/, next/font/, and next/package.json requests to the actual package name (supports forked packages)
|
|
60
60
|
if (request.startsWith('next/dist/')) {
|
|
61
61
|
request = request.replace('next/dist/', `${pkgName}/dist/`);
|
|
62
62
|
} else if (request.startsWith('next/font/')) {
|
|
63
63
|
request = request.replace('next/font/', `${pkgName}/font/`);
|
|
64
|
+
} else if (request === 'next/package.json') {
|
|
65
|
+
request = `${pkgName}/package.json`;
|
|
64
66
|
}
|
|
65
67
|
return originalResolveFilename.call(mod, request, parent, isMain, options);
|
|
66
68
|
// We use `bind` here to avoid referencing outside variables to create potential memory leaks.
|
|
@@ -73,11 +75,13 @@ mod.prototype.require = function(request) {
|
|
|
73
75
|
if (request.endsWith('.shared-runtime')) {
|
|
74
76
|
return originalRequire.call(this, `${PKG_NAME}/dist/server/route-modules/pages/vendored/contexts/${path.basename(request, '.shared-runtime')}`);
|
|
75
77
|
}
|
|
76
|
-
// Redirect next/dist/ and next/
|
|
78
|
+
// Redirect next/dist/, next/font/, and next/package.json requests to the actual package name (supports forked packages)
|
|
77
79
|
if (request.startsWith('next/dist/')) {
|
|
78
80
|
return originalRequire.call(this, request.replace('next/dist/', `${PKG_NAME}/dist/`));
|
|
79
81
|
} else if (request.startsWith('next/font/')) {
|
|
80
82
|
return originalRequire.call(this, request.replace('next/font/', `${PKG_NAME}/font/`));
|
|
83
|
+
} else if (request === 'next/package.json') {
|
|
84
|
+
return originalRequire.call(this, `${PKG_NAME}/package.json`);
|
|
81
85
|
}
|
|
82
86
|
return originalRequire.call(this, request);
|
|
83
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/server/require-hook.ts"],"sourcesContent":["// Synchronously inject a require hook for webpack and webpack/. It's required to use the internal ncc webpack version.\n// This is needed for userland plugins to attach to the same webpack instance as Next.js'.\n// Individually compiled modules are as defined for the compilation in bundles/webpack/packages/*.\n\n// This module will only be loaded once per process.\nconst path = require('path') as typeof import('path')\nconst mod = require('module') as typeof import('module')\n\n// Read package name dynamically to support forked packages\nconst PKG_NAME = require('../../package.json').name\nconst originalRequire = mod.prototype.require\nconst resolveFilename =\n // @ts-expect-error\n mod._resolveFilename\n\nlet resolve: typeof require.resolve = process.env.NEXT_MINIMAL\n ? // @ts-ignore\n __non_webpack_require__.resolve\n : require.resolve\n\nexport const hookPropertyMap = new Map()\n\nexport const defaultOverrides = {\n 'styled-jsx': path.dirname(resolve('styled-jsx/package.json')),\n 'styled-jsx/style': resolve('styled-jsx/style'),\n 'styled-jsx/style.js': resolve('styled-jsx/style'),\n}\n\nconst toResolveMap = (map: Record<string, string>): [string, string][] =>\n Object.entries(map).map(([key, value]) => [key, resolve(value)])\n\nexport function addHookAliases(aliases: [string, string][] = []) {\n for (const [key, value] of aliases) {\n hookPropertyMap.set(key, value)\n }\n}\n\naddHookAliases(toResolveMap(defaultOverrides))\n\n// @ts-expect-error\nmod._resolveFilename = function (\n originalResolveFilename: (\n request: string,\n parent: string,\n isMain: boolean,\n opts: any\n ) => string,\n requestMap: Map<string, string>,\n pkgName: string,\n request: string,\n parent: string,\n isMain: boolean,\n options: any\n) {\n const hookResolved = requestMap.get(request)\n if (hookResolved) request = hookResolved\n\n // Redirect next/dist/ and next/
|
|
1
|
+
{"version":3,"sources":["../../src/server/require-hook.ts"],"sourcesContent":["// Synchronously inject a require hook for webpack and webpack/. It's required to use the internal ncc webpack version.\n// This is needed for userland plugins to attach to the same webpack instance as Next.js'.\n// Individually compiled modules are as defined for the compilation in bundles/webpack/packages/*.\n\n// This module will only be loaded once per process.\nconst path = require('path') as typeof import('path')\nconst mod = require('module') as typeof import('module')\n\n// Read package name dynamically to support forked packages\nconst PKG_NAME = require('../../package.json').name\nconst originalRequire = mod.prototype.require\nconst resolveFilename =\n // @ts-expect-error\n mod._resolveFilename\n\nlet resolve: typeof require.resolve = process.env.NEXT_MINIMAL\n ? // @ts-ignore\n __non_webpack_require__.resolve\n : require.resolve\n\nexport const hookPropertyMap = new Map()\n\nexport const defaultOverrides = {\n 'styled-jsx': path.dirname(resolve('styled-jsx/package.json')),\n 'styled-jsx/style': resolve('styled-jsx/style'),\n 'styled-jsx/style.js': resolve('styled-jsx/style'),\n}\n\nconst toResolveMap = (map: Record<string, string>): [string, string][] =>\n Object.entries(map).map(([key, value]) => [key, resolve(value)])\n\nexport function addHookAliases(aliases: [string, string][] = []) {\n for (const [key, value] of aliases) {\n hookPropertyMap.set(key, value)\n }\n}\n\naddHookAliases(toResolveMap(defaultOverrides))\n\n// @ts-expect-error\nmod._resolveFilename = function (\n originalResolveFilename: (\n request: string,\n parent: string,\n isMain: boolean,\n opts: any\n ) => string,\n requestMap: Map<string, string>,\n pkgName: string,\n request: string,\n parent: string,\n isMain: boolean,\n options: any\n) {\n const hookResolved = requestMap.get(request)\n if (hookResolved) request = hookResolved\n\n // Redirect next/dist/, next/font/, and next/package.json requests to the actual package name (supports forked packages)\n if (request.startsWith('next/dist/')) {\n request = request.replace('next/dist/', `${pkgName}/dist/`)\n } else if (request.startsWith('next/font/')) {\n request = request.replace('next/font/', `${pkgName}/font/`)\n } else if (request === 'next/package.json') {\n request = `${pkgName}/package.json`\n }\n\n return originalResolveFilename.call(mod, request, parent, isMain, options)\n\n // We use `bind` here to avoid referencing outside variables to create potential memory leaks.\n}.bind(null, resolveFilename, hookPropertyMap, PKG_NAME)\n\n// @ts-expect-error\n// This is a hack to make sure that if a user requires a Next.js module that wasn't bundled\n// that needs to point to the rendering runtime version, it will point to the correct one.\n// This can happen on `pages` when a user requires a dependency that uses next/image for example.\nmod.prototype.require = function (request: string) {\n if (request.endsWith('.shared-runtime')) {\n return originalRequire.call(\n this,\n `${PKG_NAME}/dist/server/route-modules/pages/vendored/contexts/${path.basename(\n request,\n '.shared-runtime'\n )}`\n )\n }\n\n // Redirect next/dist/, next/font/, and next/package.json requests to the actual package name (supports forked packages)\n if (request.startsWith('next/dist/')) {\n return originalRequire.call(this, request.replace('next/dist/', `${PKG_NAME}/dist/`))\n } else if (request.startsWith('next/font/')) {\n return originalRequire.call(this, request.replace('next/font/', `${PKG_NAME}/font/`))\n } else if (request === 'next/package.json') {\n return originalRequire.call(this, `${PKG_NAME}/package.json`)\n }\n\n return originalRequire.call(this, request)\n}\n"],"names":["addHookAliases","defaultOverrides","hookPropertyMap","path","require","mod","PKG_NAME","name","originalRequire","prototype","resolveFilename","_resolveFilename","resolve","process","env","NEXT_MINIMAL","__non_webpack_require__","Map","dirname","toResolveMap","map","Object","entries","key","value","aliases","set","originalResolveFilename","requestMap","pkgName","request","parent","isMain","options","hookResolved","get","startsWith","replace","call","bind","endsWith","basename"],"mappings":"AAAA,uHAAuH;AACvH,0FAA0F;AAC1F,kGAAkG;AAElG,oDAAoD;;;;;;;;;;;;;;;;;IA2BpCA,cAAc;eAAdA;;IATHC,gBAAgB;eAAhBA;;IAFAC,eAAe;eAAfA;;;AAfb,MAAMC,OAAOC,QAAQ;AACrB,MAAMC,MAAMD,QAAQ;AAEpB,2DAA2D;AAC3D,MAAME,WAAWF,QAAQ,sBAAsBG,IAAI;AACnD,MAAMC,kBAAkBH,IAAII,SAAS,CAACL,OAAO;AAC7C,MAAMM,kBACJ,mBAAmB;AACnBL,IAAIM,gBAAgB;AAEtB,IAAIC,UAAkCC,QAAQC,GAAG,CAACC,YAAY,GAE1DC,wBAAwBJ,OAAO,GAC/BR,QAAQQ,OAAO;AAEZ,MAAMV,kBAAkB,IAAIe;AAE5B,MAAMhB,mBAAmB;IAC9B,cAAcE,KAAKe,OAAO,CAACN,QAAQ;IACnC,oBAAoBA,QAAQ;IAC5B,uBAAuBA,QAAQ;AACjC;AAE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A,wHAAwH;IACxH,IAAIA,QAAQM,UAAU,CAAC,eAAe;QACpC,OAAO5B,gBAAgB8B,IAAI,CAAC,IAAI,EAAER,QAAQO,OAAO,CAAC,cAAc,GAAG/B,SAAS,MAAM,CAAC;IACrF,OAAO,IAAIwB,QAAQM,UAAU,CAAC,eAAe;QAC3C,OAAO5B,gBAAgB8B,IAAI,CAAC,IAAI,EAAER,QAAQO,OAAO,CAAC,cAAc,GAAG/B,SAAS,MAAM,CAAC;IACrF,OAAO,IAAIwB,YAAY,qBAAqB;QAC1C,OAAOtB,gBAAgB8B,IAAI,CAAC,IAAI,EAAE,GAAGhC,SAAS,aAAa,CAAC;IAC9D;IAEA,OAAOE,gBAAgB8B,IAAI,CAAC,IAAI,EAAER;AACpC","ignoreList":[0]}
|
|
@@ -22,7 +22,7 @@ _export(exports, {
|
|
|
22
22
|
});
|
|
23
23
|
function isStableBuild() {
|
|
24
24
|
var _process_env___NEXT_VERSION;
|
|
25
|
-
return !((_process_env___NEXT_VERSION = "15.6.0-bun.
|
|
25
|
+
return !((_process_env___NEXT_VERSION = "15.6.0-bun.16") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
|
|
26
26
|
}
|
|
27
27
|
class CanaryOnlyError extends Error {
|
|
28
28
|
constructor(arg){
|
|
@@ -11,11 +11,11 @@ Object.defineProperty(exports, "eventCliSessionStopped", {
|
|
|
11
11
|
const EVENT_VERSION = 'NEXT_CLI_SESSION_STOPPED';
|
|
12
12
|
function eventCliSessionStopped(event) {
|
|
13
13
|
// This should be an invariant, if it fails our build tooling is broken.
|
|
14
|
-
if (typeof "15.6.0-bun.
|
|
14
|
+
if (typeof "15.6.0-bun.16" !== 'string') {
|
|
15
15
|
return [];
|
|
16
16
|
}
|
|
17
17
|
const payload = {
|
|
18
|
-
nextVersion: "15.6.0-bun.
|
|
18
|
+
nextVersion: "15.6.0-bun.16",
|
|
19
19
|
nodeVersion: process.version,
|
|
20
20
|
cliCommand: event.cliCommand,
|
|
21
21
|
durationMilliseconds: event.durationMilliseconds,
|
|
@@ -12,12 +12,12 @@ const EVENT_VERSION = 'NEXT_CLI_SESSION_STARTED';
|
|
|
12
12
|
function eventCliSession(nextConfig, event) {
|
|
13
13
|
var _nextConfig_experimental_staleTimes, _nextConfig_experimental_staleTimes1, _nextConfig_experimental_reactCompiler, _nextConfig_experimental_reactCompiler1;
|
|
14
14
|
// This should be an invariant, if it fails our build tooling is broken.
|
|
15
|
-
if (typeof "15.6.0-bun.
|
|
15
|
+
if (typeof "15.6.0-bun.16" !== 'string') {
|
|
16
16
|
return [];
|
|
17
17
|
}
|
|
18
18
|
const { images, i18n } = nextConfig || {};
|
|
19
19
|
const payload = {
|
|
20
|
-
nextVersion: "15.6.0-bun.
|
|
20
|
+
nextVersion: "15.6.0-bun.16",
|
|
21
21
|
nodeVersion: process.version,
|
|
22
22
|
cliCommand: event.cliCommand,
|
|
23
23
|
isSrcDir: event.isSrcDir,
|