@vercel/next 4.2.10 → 4.2.11

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 +30 -4
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -12656,6 +12656,9 @@ async function getSourceFilePathFromPage({
12656
12656
  }
12657
12657
  }
12658
12658
  }
12659
+ if (page === "/_not-found/page") {
12660
+ return "";
12661
+ }
12659
12662
  console.log(
12660
12663
  `WARNING: Unable to find source file for page ${page} with extensions: ${extensionsToTry.join(
12661
12664
  ", "
@@ -12718,12 +12721,13 @@ async function getPageLambdaGroups({
12718
12721
  opts = functionsConfigManifest.functions[routeName];
12719
12722
  }
12720
12723
  if (config && config.functions) {
12721
- const pageFromManifest = inversedAppPathManifest?.[routeName];
12722
12724
  const sourceFile = await getSourceFilePathFromPage({
12723
12725
  workPath: entryPath,
12724
- // since this function is used by both `pages` and `app`, the manifest might not be provided
12725
- // so fallback to normal behavior of just checking the `page`.
12726
- page: pageFromManifest ?? page,
12726
+ page: normalizeSourceFilePageFromManifest(
12727
+ routeName,
12728
+ page,
12729
+ inversedAppPathManifest
12730
+ ),
12727
12731
  pageExtensions
12728
12732
  });
12729
12733
  const vercelConfigOpts = await (0, import_build_utils.getLambdaOptionsFromFunction)({
@@ -12779,6 +12783,28 @@ async function getPageLambdaGroups({
12779
12783
  }
12780
12784
  return groups;
12781
12785
  }
12786
+ function normalizeSourceFilePageFromManifest(routeName, page, inversedAppPathManifest) {
12787
+ const pageFromManifest = inversedAppPathManifest?.[routeName];
12788
+ if (!pageFromManifest) {
12789
+ return page;
12790
+ }
12791
+ const metadataConventions = [
12792
+ "/favicon.",
12793
+ "/icon.",
12794
+ "/apple-icon.",
12795
+ "/opengraph-image.",
12796
+ "/twitter-image.",
12797
+ "/sitemap.",
12798
+ "/robots."
12799
+ ];
12800
+ const isSpecialFile = metadataConventions.some(
12801
+ (convention) => routeName.startsWith(convention)
12802
+ );
12803
+ if (isSpecialFile) {
12804
+ return routeName;
12805
+ }
12806
+ return pageFromManifest;
12807
+ }
12782
12808
  var outputFunctionFileSizeInfo = (pages, pseudoLayer, pseudoLayerUncompressedBytes, compressedPages) => {
12783
12809
  const exceededLimitOutput = [];
12784
12810
  console.log(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/next",
3
- "version": "4.2.10",
3
+ "version": "4.2.11",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -30,7 +30,7 @@
30
30
  "@types/semver": "6.0.0",
31
31
  "@types/text-table": "0.2.1",
32
32
  "@types/webpack-sources": "3.2.0",
33
- "@vercel/build-utils": "8.1.0",
33
+ "@vercel/build-utils": "8.1.1",
34
34
  "@vercel/routing-utils": "3.1.0",
35
35
  "async-sema": "3.0.1",
36
36
  "buffer-crc32": "0.2.13",