@vercel/next 4.7.6 → 4.7.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.
- package/dist/index.js +24 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -13988,6 +13988,11 @@ async function serverBuild({
|
|
13988
13988
|
// We don't want to perform the actual rewrite here, instead we want
|
13989
13989
|
// to just add the headers associated with the rewrite.
|
13990
13990
|
dest: void 0,
|
13991
|
+
// We don't want to check here, so omit the check property but we do
|
13992
|
+
// want to maintain the order of the rewrites, so add the continue
|
13993
|
+
// property.
|
13994
|
+
check: void 0,
|
13995
|
+
continue: true,
|
13991
13996
|
has,
|
13992
13997
|
headers: headers2
|
13993
13998
|
};
|
@@ -14036,6 +14041,7 @@ async function serverBuild({
|
|
14036
14041
|
const lstatSema = new import_async_sema2.Sema(25);
|
14037
14042
|
const lstatResults = {};
|
14038
14043
|
const nonLambdaSsgPages = /* @__PURE__ */ new Set();
|
14044
|
+
const static404Pages = new Set(static404Page ? [static404Page] : []);
|
14039
14045
|
Object.keys(prerenderManifest.staticRoutes).forEach((route) => {
|
14040
14046
|
const result = onPrerenderRouteInitial(
|
14041
14047
|
prerenderManifest,
|
@@ -14048,6 +14054,7 @@ async function serverBuild({
|
|
14048
14054
|
appDir
|
14049
14055
|
);
|
14050
14056
|
if (result && result.static404Page) {
|
14057
|
+
static404Pages.add(result.static404Page);
|
14051
14058
|
static404Page = result.static404Page;
|
14052
14059
|
}
|
14053
14060
|
if (result && result.static500Page) {
|
@@ -14209,27 +14216,29 @@ async function serverBuild({
|
|
14209
14216
|
mode: (await import_fs_extra5.default.lstat(nextServerFile)).mode,
|
14210
14217
|
fsPath: nextServerFile
|
14211
14218
|
});
|
14212
|
-
if (
|
14219
|
+
if (static404Pages.size > 0) {
|
14213
14220
|
if (i18n) {
|
14214
14221
|
for (const locale of i18n.locales) {
|
14215
|
-
|
14216
|
-
|
14222
|
+
const static404Page2 = import_path4.default.posix.join(entryDirectory, locale, "404");
|
14223
|
+
static404Pages.add(static404Page2);
|
14224
|
+
}
|
14225
|
+
}
|
14226
|
+
for (const static404Page2 of static404Pages) {
|
14227
|
+
let static404File = staticPages[static404Page2];
|
14228
|
+
if (!static404File) {
|
14229
|
+
const static404FilePath = import_path4.default.join(
|
14230
|
+
pagesDir,
|
14231
|
+
`${static404Page2}.html`
|
14232
|
+
);
|
14233
|
+
if (import_fs_extra5.default.existsSync(static404FilePath)) {
|
14217
14234
|
static404File = new import_build_utils2.FileFsRef({
|
14218
|
-
fsPath:
|
14235
|
+
fsPath: static404FilePath
|
14219
14236
|
});
|
14220
|
-
if (!import_fs_extra5.default.existsSync(static404File.fsPath)) {
|
14221
|
-
static404File = new import_build_utils2.FileFsRef({
|
14222
|
-
fsPath: import_path4.default.join(pagesDir, "/404.html")
|
14223
|
-
});
|
14224
|
-
}
|
14225
14237
|
}
|
14238
|
+
}
|
14239
|
+
if (static404File) {
|
14226
14240
|
requiredFiles[import_path4.default.relative(baseDir, static404File.fsPath)] = static404File;
|
14227
14241
|
}
|
14228
|
-
} else {
|
14229
|
-
const static404File = staticPages[static404Page] || new import_build_utils2.FileFsRef({
|
14230
|
-
fsPath: import_path4.default.join(pagesDir, "/404.html")
|
14231
|
-
});
|
14232
|
-
requiredFiles[import_path4.default.relative(baseDir, static404File.fsPath)] = static404File;
|
14233
14242
|
}
|
14234
14243
|
}
|
14235
14244
|
const envFiles = [];
|
@@ -16057,7 +16066,7 @@ var build = async (buildOptions) => {
|
|
16057
16066
|
if (!nextVersion) {
|
16058
16067
|
throw new import_build_utils3.NowBuildError({
|
16059
16068
|
code: "NEXT_NO_VERSION",
|
16060
|
-
message: 'No Next.js version
|
16069
|
+
message: 'No Next.js version detected. Make sure your package.json has "next" in either "dependencies" or "devDependencies". Also check your Root Directory setting matches the directory of your package.json file.'
|
16061
16070
|
});
|
16062
16071
|
}
|
16063
16072
|
let isServerMode = !(config.framework === "blitzjs") && import_semver4.default.gte(nextVersion, SERVER_BUILD_MINIMUM_NEXT_VERSION);
|