@vercel/next 3.6.3 → 3.6.4

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/index.js CHANGED
@@ -42420,6 +42420,13 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
42420
42420
  const projectDir = requiredServerFilesManifest.relativeAppDir
42421
42421
  ? path_1.default.join(baseDir, requiredServerFilesManifest.relativeAppDir)
42422
42422
  : requiredServerFilesManifest.appDir || entryPath;
42423
+ // allow looking up original route from normalized route
42424
+ const inversedAppPathManifest = {};
42425
+ if (appPathRoutesManifest) {
42426
+ for (const ogRoute of Object.keys(appPathRoutesManifest)) {
42427
+ inversedAppPathManifest[appPathRoutesManifest[ogRoute]] = ogRoute;
42428
+ }
42429
+ }
42423
42430
  let appBuildTraces = {};
42424
42431
  let appDir = null;
42425
42432
  if (appPathRoutesManifest) {
@@ -42438,7 +42445,8 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
42438
42445
  });
42439
42446
  }
42440
42447
  const pageMatchesApi = (page) => {
42441
- return (!appPathRoutesManifest?.[page] &&
42448
+ const normalizedPage = `/${page.replace(/\.js$/, '')}`;
42449
+ return (!inversedAppPathManifest[normalizedPage] &&
42442
42450
  (page.startsWith('api/') || page === 'api.js'));
42443
42451
  };
42444
42452
  const { i18n } = routesManifest;
@@ -43068,13 +43076,8 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
43068
43076
  // to match prerenders so we can route the same when the
43069
43077
  // __rsc__ header is present
43070
43078
  const edgeFunctions = middleware.edgeFunctions;
43071
- // allow looking up original route from normalized route
43072
- const inverseAppPathManifest = {};
43073
- for (const ogRoute of Object.keys(appPathRoutesManifest)) {
43074
- inverseAppPathManifest[appPathRoutesManifest[ogRoute]] = ogRoute;
43075
- }
43076
43079
  for (let route of Object.values(appPathRoutesManifest)) {
43077
- const ogRoute = inverseAppPathManifest[route];
43080
+ const ogRoute = inversedAppPathManifest[route];
43078
43081
  if (ogRoute.endsWith('/route')) {
43079
43082
  continue;
43080
43083
  }
@@ -32,6 +32,13 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
32
32
  const projectDir = requiredServerFilesManifest.relativeAppDir
33
33
  ? path_1.default.join(baseDir, requiredServerFilesManifest.relativeAppDir)
34
34
  : requiredServerFilesManifest.appDir || entryPath;
35
+ // allow looking up original route from normalized route
36
+ const inversedAppPathManifest = {};
37
+ if (appPathRoutesManifest) {
38
+ for (const ogRoute of Object.keys(appPathRoutesManifest)) {
39
+ inversedAppPathManifest[appPathRoutesManifest[ogRoute]] = ogRoute;
40
+ }
41
+ }
35
42
  let appBuildTraces = {};
36
43
  let appDir = null;
37
44
  if (appPathRoutesManifest) {
@@ -50,7 +57,8 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
50
57
  });
51
58
  }
52
59
  const pageMatchesApi = (page) => {
53
- return (!appPathRoutesManifest?.[page] &&
60
+ const normalizedPage = `/${page.replace(/\.js$/, '')}`;
61
+ return (!inversedAppPathManifest[normalizedPage] &&
54
62
  (page.startsWith('api/') || page === 'api.js'));
55
63
  };
56
64
  const { i18n } = routesManifest;
@@ -680,13 +688,8 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
680
688
  // to match prerenders so we can route the same when the
681
689
  // __rsc__ header is present
682
690
  const edgeFunctions = middleware.edgeFunctions;
683
- // allow looking up original route from normalized route
684
- const inverseAppPathManifest = {};
685
- for (const ogRoute of Object.keys(appPathRoutesManifest)) {
686
- inverseAppPathManifest[appPathRoutesManifest[ogRoute]] = ogRoute;
687
- }
688
691
  for (let route of Object.values(appPathRoutesManifest)) {
689
- const ogRoute = inverseAppPathManifest[route];
692
+ const ogRoute = inversedAppPathManifest[route];
690
693
  if (ogRoute.endsWith('/route')) {
691
694
  continue;
692
695
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/next",
3
- "version": "3.6.3",
3
+ "version": "3.6.4",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -71,5 +71,5 @@
71
71
  "typescript": "4.5.2",
72
72
  "webpack-sources": "3.2.3"
73
73
  },
74
- "gitHead": "cfc1c9e818ebb55d440479cf0edf18536b772b28"
74
+ "gitHead": "a92c68e0ffc4d91fc2e11e703da445c285f0c926"
75
75
  }