@vercel/next 3.9.1 → 3.9.3
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 +11 -8
- package/dist/server-build.js +5 -7
- package/package.json +1 -1
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
|
-
|
41591
|
+
const originalStaticPages = await (0, build_utils_1.glob)('**/*.html', pagesDir);
|
41592
|
+
staticPages = (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,
|
@@ -42704,6 +42708,7 @@ async function getServerlessPages(params) {
|
|
42704
42708
|
? Promise.all([
|
42705
42709
|
(0, build_utils_1.glob)('**/page.js', path_1.default.join(params.pagesDir, '../app')),
|
42706
42710
|
(0, build_utils_1.glob)('**/route.js', path_1.default.join(params.pagesDir, '../app')),
|
42711
|
+
(0, build_utils_1.glob)('**/_not-found.js', path_1.default.join(params.pagesDir, '../app')),
|
42707
42712
|
]).then(items => Object.assign(...items))
|
42708
42713
|
: Promise.resolve({}),
|
42709
42714
|
(0, utils_1.getMiddlewareManifest)(params.entryPath, params.outputDirectory),
|
@@ -43103,7 +43108,7 @@ const CORRECT_MIDDLEWARE_ORDER_VERSION = 'v12.1.7-canary.29';
|
|
43103
43108
|
const NEXT_DATA_MIDDLEWARE_RESOLVING_VERSION = 'v12.1.7-canary.33';
|
43104
43109
|
const EMPTY_ALLOW_QUERY_FOR_PRERENDERED_VERSION = 'v12.2.0';
|
43105
43110
|
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, }) {
|
43111
|
+
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
43112
|
lambdaPages = Object.assign({}, lambdaPages, lambdaAppPaths);
|
43108
43113
|
const lambdas = {};
|
43109
43114
|
const prerenders = {};
|
@@ -43145,17 +43150,15 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, functionsConfi
|
|
43145
43150
|
};
|
43146
43151
|
const { i18n } = routesManifest;
|
43147
43152
|
const hasPages404 = routesManifest.pages404;
|
43148
|
-
let localePrefixed404 = false;
|
43149
43153
|
let static404Page = staticPages[path_1.default.posix.join(entryDirectory, '404')] && hasPages404
|
43150
43154
|
? path_1.default.posix.join(entryDirectory, '404')
|
43151
43155
|
: staticPages[path_1.default.posix.join(entryDirectory, '_errors/404')]
|
43152
43156
|
? path_1.default.posix.join(entryDirectory, '_errors/404')
|
43153
43157
|
: undefined;
|
43154
|
-
if (!static404Page &&
|
43155
|
-
|
43156
|
-
|
43157
|
-
|
43158
|
-
}
|
43158
|
+
if (!static404Page &&
|
43159
|
+
i18n &&
|
43160
|
+
staticPages[path_1.default.posix.join(entryDirectory, i18n.defaultLocale, '404')]) {
|
43161
|
+
static404Page = path_1.default.posix.join(entryDirectory, i18n.defaultLocale, '404');
|
43159
43162
|
}
|
43160
43163
|
if (!hasStatic500 && i18n) {
|
43161
43164
|
hasStatic500 =
|
package/dist/server-build.js
CHANGED
@@ -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 &&
|
73
|
-
|
74
|
-
|
75
|
-
|
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 =
|