@vercel/next 3.9.1 → 3.9.2

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
@@ -41588,7 +41588,8 @@ const build = async ({ files, workPath, repoRootPath, entrypoint, config = {}, m
41588
41588
  appPathRoutesManifest,
41589
41589
  });
41590
41590
  const canUsePreviewMode = Object.keys(pages).some(page => (0, utils_1.isApiPage)(pages[page].fsPath));
41591
- staticPages = await (0, utils_1.filterStaticPages)(await (0, build_utils_1.glob)('**/*.html', pagesDir), dynamicPages, entryDirectory, exports.htmlContentType, prerenderManifest, routesManifest);
41591
+ const originalStaticPages = await (0, build_utils_1.glob)('**/*.html', pagesDir);
41592
+ staticPages = await (0, utils_1.filterStaticPages)(originalStaticPages, dynamicPages, entryDirectory, exports.htmlContentType, prerenderManifest, routesManifest);
41592
41593
  hasStatic500 = !!staticPages[path_1.default.posix.join(entryDirectory, '500')];
41593
41594
  // this can be either 404.html in latest versions
41594
41595
  // or _errors/404.html versions while this was experimental
@@ -41708,6 +41709,8 @@ const build = async ({ files, workPath, repoRootPath, entrypoint, config = {}, m
41708
41709
  if (!routesManifest) {
41709
41710
  throw new Error(`A routes-manifest could not be located, please check your outputDirectory and try again.`);
41710
41711
  }
41712
+ const localePrefixed404 = !!(routesManifest.i18n &&
41713
+ originalStaticPages[path_1.default.posix.join(entryDirectory, routesManifest.i18n.defaultLocale, '404.html')]);
41711
41714
  return (0, server_build_1.serverBuild)({
41712
41715
  config,
41713
41716
  functionsConfigManifest,
@@ -41717,6 +41720,7 @@ const build = async ({ files, workPath, repoRootPath, entrypoint, config = {}, m
41717
41720
  dynamicPages,
41718
41721
  canUsePreviewMode,
41719
41722
  staticPages,
41723
+ localePrefixed404,
41720
41724
  lambdaPages: pages,
41721
41725
  lambdaAppPaths,
41722
41726
  omittedPrerenderRoutes,
@@ -43103,7 +43107,7 @@ const CORRECT_MIDDLEWARE_ORDER_VERSION = 'v12.1.7-canary.29';
43103
43107
  const NEXT_DATA_MIDDLEWARE_RESOLVING_VERSION = 'v12.1.7-canary.33';
43104
43108
  const EMPTY_ALLOW_QUERY_FOR_PRERENDERED_VERSION = 'v12.2.0';
43105
43109
  const CORRECTED_MANIFESTS_VERSION = 'v12.2.0';
43106
- async function serverBuild({ dynamicPages, pagesDir, config = {}, functionsConfigManifest, privateOutputs, baseDir, workPath, entryPath, nodeVersion, buildId, escapedBuildId, dynamicPrefix, entryDirectory, outputDirectory, redirects, beforeFilesRewrites, afterFilesRewrites, fallbackRewrites, headers, dataRoutes, hasIsr404Page, hasIsr500Page, imagesManifest, wildcardConfig, routesManifest, staticPages, lambdaPages, nextVersion, lambdaAppPaths, canUsePreviewMode, trailingSlash, prerenderManifest, appPathRoutesManifest, omittedPrerenderRoutes, trailingSlashRedirects, isCorrectLocaleAPIRoutes, lambdaCompressedByteLimit, requiredServerFilesManifest, }) {
43110
+ async function serverBuild({ dynamicPages, pagesDir, config = {}, functionsConfigManifest, privateOutputs, baseDir, workPath, entryPath, nodeVersion, buildId, escapedBuildId, dynamicPrefix, entryDirectory, outputDirectory, redirects, beforeFilesRewrites, afterFilesRewrites, fallbackRewrites, headers, dataRoutes, hasIsr404Page, hasIsr500Page, imagesManifest, wildcardConfig, routesManifest, staticPages, lambdaPages, localePrefixed404, nextVersion, lambdaAppPaths, canUsePreviewMode, trailingSlash, prerenderManifest, appPathRoutesManifest, omittedPrerenderRoutes, trailingSlashRedirects, isCorrectLocaleAPIRoutes, lambdaCompressedByteLimit, requiredServerFilesManifest, }) {
43107
43111
  lambdaPages = Object.assign({}, lambdaPages, lambdaAppPaths);
43108
43112
  const lambdas = {};
43109
43113
  const prerenders = {};
@@ -43145,17 +43149,15 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, functionsConfi
43145
43149
  };
43146
43150
  const { i18n } = routesManifest;
43147
43151
  const hasPages404 = routesManifest.pages404;
43148
- let localePrefixed404 = false;
43149
43152
  let static404Page = staticPages[path_1.default.posix.join(entryDirectory, '404')] && hasPages404
43150
43153
  ? path_1.default.posix.join(entryDirectory, '404')
43151
43154
  : staticPages[path_1.default.posix.join(entryDirectory, '_errors/404')]
43152
43155
  ? path_1.default.posix.join(entryDirectory, '_errors/404')
43153
43156
  : undefined;
43154
- if (!static404Page && i18n) {
43155
- if (staticPages[path_1.default.posix.join(entryDirectory, i18n.defaultLocale, '404')]) {
43156
- localePrefixed404 = true;
43157
- static404Page = path_1.default.posix.join(entryDirectory, i18n.defaultLocale, '404');
43158
- }
43157
+ if (!static404Page &&
43158
+ i18n &&
43159
+ staticPages[path_1.default.posix.join(entryDirectory, i18n.defaultLocale, '404')]) {
43160
+ static404Page = path_1.default.posix.join(entryDirectory, i18n.defaultLocale, '404');
43159
43161
  }
43160
43162
  if (!hasStatic500 && i18n) {
43161
43163
  hasStatic500 =
@@ -21,7 +21,7 @@ const CORRECT_MIDDLEWARE_ORDER_VERSION = 'v12.1.7-canary.29';
21
21
  const NEXT_DATA_MIDDLEWARE_RESOLVING_VERSION = 'v12.1.7-canary.33';
22
22
  const EMPTY_ALLOW_QUERY_FOR_PRERENDERED_VERSION = 'v12.2.0';
23
23
  const CORRECTED_MANIFESTS_VERSION = 'v12.2.0';
24
- async function serverBuild({ dynamicPages, pagesDir, config = {}, functionsConfigManifest, privateOutputs, baseDir, workPath, entryPath, nodeVersion, buildId, escapedBuildId, dynamicPrefix, entryDirectory, outputDirectory, redirects, beforeFilesRewrites, afterFilesRewrites, fallbackRewrites, headers, dataRoutes, hasIsr404Page, hasIsr500Page, imagesManifest, wildcardConfig, routesManifest, staticPages, lambdaPages, nextVersion, lambdaAppPaths, canUsePreviewMode, trailingSlash, prerenderManifest, appPathRoutesManifest, omittedPrerenderRoutes, trailingSlashRedirects, isCorrectLocaleAPIRoutes, lambdaCompressedByteLimit, requiredServerFilesManifest, }) {
24
+ async function serverBuild({ dynamicPages, pagesDir, config = {}, functionsConfigManifest, privateOutputs, baseDir, workPath, entryPath, nodeVersion, buildId, escapedBuildId, dynamicPrefix, entryDirectory, outputDirectory, redirects, beforeFilesRewrites, afterFilesRewrites, fallbackRewrites, headers, dataRoutes, hasIsr404Page, hasIsr500Page, imagesManifest, wildcardConfig, routesManifest, staticPages, lambdaPages, localePrefixed404, nextVersion, lambdaAppPaths, canUsePreviewMode, trailingSlash, prerenderManifest, appPathRoutesManifest, omittedPrerenderRoutes, trailingSlashRedirects, isCorrectLocaleAPIRoutes, lambdaCompressedByteLimit, requiredServerFilesManifest, }) {
25
25
  lambdaPages = Object.assign({}, lambdaPages, lambdaAppPaths);
26
26
  const lambdas = {};
27
27
  const prerenders = {};
@@ -63,17 +63,15 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, functionsConfi
63
63
  };
64
64
  const { i18n } = routesManifest;
65
65
  const hasPages404 = routesManifest.pages404;
66
- let localePrefixed404 = false;
67
66
  let static404Page = staticPages[path_1.default.posix.join(entryDirectory, '404')] && hasPages404
68
67
  ? path_1.default.posix.join(entryDirectory, '404')
69
68
  : staticPages[path_1.default.posix.join(entryDirectory, '_errors/404')]
70
69
  ? path_1.default.posix.join(entryDirectory, '_errors/404')
71
70
  : undefined;
72
- if (!static404Page && i18n) {
73
- if (staticPages[path_1.default.posix.join(entryDirectory, i18n.defaultLocale, '404')]) {
74
- localePrefixed404 = true;
75
- static404Page = path_1.default.posix.join(entryDirectory, i18n.defaultLocale, '404');
76
- }
71
+ if (!static404Page &&
72
+ i18n &&
73
+ staticPages[path_1.default.posix.join(entryDirectory, i18n.defaultLocale, '404')]) {
74
+ static404Page = path_1.default.posix.join(entryDirectory, i18n.defaultLocale, '404');
77
75
  }
78
76
  if (!hasStatic500 && i18n) {
79
77
  hasStatic500 =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/next",
3
- "version": "3.9.1",
3
+ "version": "3.9.2",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",