This commit is contained in:
2026-08-14 16:03:47 +01:00
parent fd53e3f4fb
commit dfdc3b2840
2463 changed files with 186456 additions and 111315 deletions
+13 -10
View File
@@ -1,4 +1,3 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -39,16 +38,18 @@ const DEFAULT_CONTENT_TYPE = "text/plain";
const DEFAULT_OUTPUT_DIR = "./static";
const generateFilePath = (routePath, outDir, mimeType, extensionMap) => {
const extension = determineExtension(mimeType, extensionMap);
let filePath;
if (routePath.endsWith(`.${extension}`)) {
return (0, import_utils2.joinPaths)(outDir, routePath);
filePath = (0, import_utils2.joinPaths)(outDir, routePath);
} else if (routePath === "/") {
filePath = (0, import_utils2.joinPaths)(outDir, `index.${extension}`);
} else if (routePath.endsWith("/")) {
filePath = (0, import_utils2.joinPaths)(outDir, routePath, `index.${extension}`);
} else {
filePath = (0, import_utils2.joinPaths)(outDir, `${routePath}.${extension}`);
}
if (routePath === "/") {
return (0, import_utils2.joinPaths)(outDir, `index.${extension}`);
}
if (routePath.endsWith("/")) {
return (0, import_utils2.joinPaths)(outDir, routePath, `index.${extension}`);
}
return (0, import_utils2.joinPaths)(outDir, `${routePath}.${extension}`);
(0, import_utils2.ensureWithinOutDir)(outDir, filePath);
return filePath;
};
const parseResponseContent = async (response) => {
const contentType = response.headers.get("Content-Type");
@@ -68,6 +69,8 @@ const defaultExtensionMap = {
"text/html": "html",
"text/xml": "xml",
"application/xml": "xml",
"application/atom+xml": "xml",
"application/rss+xml": "xml",
"application/yaml": "yaml"
};
const determineExtension = (mimeType, userExtensionMap) => {
@@ -139,7 +142,7 @@ const fetchRoutesContent = function* (app, beforeRequestHook, afterResponseHook,
}
forGetInfoURLRequest = maybeRequest;
}
await pool.run(() => app.fetch(forGetInfoURLRequest));
await pool.run(() => app.fetch(forGetInfoURLRequest, { [import_middleware.SSG_CONTEXT]: true }));
if (!forGetInfoURLRequest.ssgParams) {
if ((0, import_utils2.isDynamicRoute)(route.path)) {
resolveGetInfo(void 0);