@vercel/next 4.10.5 → 4.10.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +80 -80
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -13000,19 +13000,17 @@ async function getNodeMiddleware({
13000
13000
  )
13001
13001
  )).filter((entry) => !!entry)
13002
13002
  );
13003
+ const absoluteOutputDirectory = import_path2.default.posix.join(entryPath, outputDirectory);
13003
13004
  const launcherData = (await import_fs_extra3.default.readFile(import_path2.default.join(__dirname, "middleware-launcher.js"), "utf8")).replace(
13004
13005
  /(?:var|const) conf = __NEXT_CONFIG__/,
13005
13006
  `const conf = ${JSON.stringify({
13006
13007
  ...requiredServerFilesManifest.config,
13007
- distDir: import_path2.default.relative(
13008
- projectDir,
13009
- import_path2.default.join(entryPath, outputDirectory)
13010
- )
13008
+ distDir: import_path2.default.relative(projectDir, absoluteOutputDirectory)
13011
13009
  })}`
13012
13010
  ).replace(
13013
13011
  "__NEXT_MIDDLEWARE_PATH__",
13014
13012
  "./" + import_path2.default.posix.join(
13015
- import_path2.default.posix.relative(projectDir, outputDirectory),
13013
+ import_path2.default.posix.relative(projectDir, absoluteOutputDirectory),
13016
13014
  `server/middleware.js`
13017
13015
  )
13018
13016
  );
@@ -14927,6 +14925,83 @@ ${JSON.stringify(
14927
14925
  JSON.stringify(Array.from(experimentalStreamingLambdaPaths))
14928
14926
  );
14929
14927
  }
14928
+ const nodeMiddleware = await getNodeMiddleware({
14929
+ config,
14930
+ baseDir,
14931
+ projectDir,
14932
+ entryPath,
14933
+ nextVersion,
14934
+ nodeVersion: nodeVersion.runtime,
14935
+ lstatSema,
14936
+ lstatResults,
14937
+ pageExtensions: requiredServerFilesManifest.config.pageExtensions,
14938
+ routesManifest,
14939
+ outputDirectory,
14940
+ prerenderBypassToken: prerenderManifest.bypassToken,
14941
+ isCorrectMiddlewareOrder,
14942
+ functionsConfigManifest,
14943
+ requiredServerFilesManifest
14944
+ });
14945
+ const middleware = await getMiddlewareBundle({
14946
+ config,
14947
+ entryPath,
14948
+ outputDirectory,
14949
+ routesManifest,
14950
+ isCorrectMiddlewareOrder,
14951
+ prerenderBypassToken: prerenderManifest.bypassToken || "",
14952
+ nextVersion,
14953
+ appPathRoutesManifest: appPathRoutesManifest || {}
14954
+ });
14955
+ if (appPathRoutesManifest) {
14956
+ const edgeFunctions = middleware.edgeFunctions;
14957
+ for (const page of Object.values(appPathRoutesManifest)) {
14958
+ const pathname = import_path4.default.posix.join(
14959
+ "./",
14960
+ entryDirectory,
14961
+ page === "/" ? "/index" : page
14962
+ );
14963
+ if (lambdas[pathname]) {
14964
+ lambdas[`${pathname}.rsc`] = lambdas[pathname];
14965
+ if (isAppPPREnabled) {
14966
+ lambdas[`${pathname}${RSC_PREFETCH_SUFFIX}`] = lambdas[pathname];
14967
+ }
14968
+ }
14969
+ if (edgeFunctions[pathname]) {
14970
+ edgeFunctions[`${pathname}.rsc`] = edgeFunctions[pathname];
14971
+ if (isAppPPREnabled) {
14972
+ edgeFunctions[`${pathname}${RSC_PREFETCH_SUFFIX}`] = edgeFunctions[pathname];
14973
+ }
14974
+ }
14975
+ }
14976
+ for (const route of routesManifest.dynamicRoutes) {
14977
+ if (!("sourcePage" in route))
14978
+ continue;
14979
+ if (typeof route.sourcePage !== "string")
14980
+ continue;
14981
+ if (route.sourcePage === route.page)
14982
+ continue;
14983
+ const sourcePathname = import_path4.default.posix.join(
14984
+ "./",
14985
+ entryDirectory,
14986
+ route.sourcePage === "/" ? "/index" : route.sourcePage
14987
+ );
14988
+ const pathname = import_path4.default.posix.join(
14989
+ "./",
14990
+ entryDirectory,
14991
+ route.page === "/" ? "/index" : route.page
14992
+ );
14993
+ if (lambdas[sourcePathname]) {
14994
+ lambdas[`${pathname}`] = lambdas[sourcePathname];
14995
+ lambdas[`${pathname}.rsc`] = lambdas[sourcePathname];
14996
+ lambdas[`${pathname}${RSC_PREFETCH_SUFFIX}`] = lambdas[sourcePathname];
14997
+ }
14998
+ if (edgeFunctions[sourcePathname]) {
14999
+ edgeFunctions[`${pathname}`] = edgeFunctions[sourcePathname];
15000
+ edgeFunctions[`${pathname}.rsc`] = edgeFunctions[sourcePathname];
15001
+ edgeFunctions[`${pathname}${RSC_PREFETCH_SUFFIX}`] = edgeFunctions[sourcePathname];
15002
+ }
15003
+ }
15004
+ }
14930
15005
  const prerenderRoute = onPrerenderRoute({
14931
15006
  appDir,
14932
15007
  pagesDir,
@@ -14990,33 +15065,6 @@ ${JSON.stringify(
14990
15065
  true
14991
15066
  )];
14992
15067
  });
14993
- const nodeMiddleware = await getNodeMiddleware({
14994
- config,
14995
- baseDir,
14996
- projectDir,
14997
- entryPath,
14998
- nextVersion,
14999
- nodeVersion: nodeVersion.runtime,
15000
- lstatSema,
15001
- lstatResults,
15002
- pageExtensions: requiredServerFilesManifest.config.pageExtensions,
15003
- routesManifest,
15004
- outputDirectory,
15005
- prerenderBypassToken: prerenderManifest.bypassToken,
15006
- isCorrectMiddlewareOrder,
15007
- functionsConfigManifest,
15008
- requiredServerFilesManifest
15009
- });
15010
- const middleware = await getMiddlewareBundle({
15011
- config,
15012
- entryPath,
15013
- outputDirectory,
15014
- routesManifest,
15015
- isCorrectMiddlewareOrder,
15016
- prerenderBypassToken: prerenderManifest.bypassToken || "",
15017
- nextVersion,
15018
- appPathRoutesManifest: appPathRoutesManifest || {}
15019
- });
15020
15068
  const isNextDataServerResolving = (middleware.staticRoutes.length > 0 || nodeMiddleware) && import_semver3.default.gte(nextVersion, NEXT_DATA_MIDDLEWARE_RESOLVING_VERSION);
15021
15069
  const staticSegmentRoutes = isAppClientSegmentCacheEnabled ? await getStaticSegmentRoutes({
15022
15070
  entryDirectory,
@@ -15172,54 +15220,6 @@ ${JSON.stringify(
15172
15220
  fsPath: catchallFsPath
15173
15221
  });
15174
15222
  }
15175
- if (appPathRoutesManifest) {
15176
- const edgeFunctions = middleware.edgeFunctions;
15177
- for (const page of Object.values(appPathRoutesManifest)) {
15178
- const pathname = import_path4.default.posix.join(
15179
- "./",
15180
- entryDirectory,
15181
- page === "/" ? "/index" : page
15182
- );
15183
- if (lambdas[pathname]) {
15184
- lambdas[`${pathname}.rsc`] = lambdas[pathname];
15185
- if (isAppPPREnabled) {
15186
- lambdas[`${pathname}${RSC_PREFETCH_SUFFIX}`] = lambdas[pathname];
15187
- }
15188
- }
15189
- if (edgeFunctions[pathname]) {
15190
- edgeFunctions[`${pathname}.rsc`] = edgeFunctions[pathname];
15191
- if (isAppPPREnabled) {
15192
- edgeFunctions[`${pathname}${RSC_PREFETCH_SUFFIX}`] = edgeFunctions[pathname];
15193
- }
15194
- }
15195
- }
15196
- for (const route of routesManifest.dynamicRoutes) {
15197
- if (!("sourcePage" in route))
15198
- continue;
15199
- if (typeof route.sourcePage !== "string")
15200
- continue;
15201
- if (route.sourcePage === route.page)
15202
- continue;
15203
- const sourcePathname = import_path4.default.posix.join(
15204
- "./",
15205
- entryDirectory,
15206
- route.sourcePage === "/" ? "/index" : route.sourcePage
15207
- );
15208
- const pathname = import_path4.default.posix.join(
15209
- "./",
15210
- entryDirectory,
15211
- route.page === "/" ? "/index" : route.page
15212
- );
15213
- if (lambdas[sourcePathname]) {
15214
- lambdas[`${pathname}.rsc`] = lambdas[sourcePathname];
15215
- lambdas[`${pathname}${RSC_PREFETCH_SUFFIX}`] = lambdas[sourcePathname];
15216
- }
15217
- if (edgeFunctions[sourcePathname]) {
15218
- edgeFunctions[`${pathname}.rsc`] = edgeFunctions[sourcePathname];
15219
- edgeFunctions[`${pathname}${RSC_PREFETCH_SUFFIX}`] = edgeFunctions[sourcePathname];
15220
- }
15221
- }
15222
- }
15223
15223
  const prefetchSegmentHeader = routesManifest?.rsc?.prefetchSegmentHeader;
15224
15224
  const prefetchSegmentDirSuffix = routesManifest?.rsc?.prefetchSegmentDirSuffix;
15225
15225
  const prefetchSegmentSuffix = routesManifest?.rsc?.prefetchSegmentSuffix;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/next",
3
- "version": "4.10.5",
3
+ "version": "4.10.7",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",