rasengan 1.0.0-beta.40 → 1.0.0-beta.42
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.
|
@@ -50,10 +50,11 @@ import { createStaticHandler, createStaticRouter, } from "react-router-dom/serve
|
|
|
50
50
|
// @ts-ignore
|
|
51
51
|
import { createFetchRequest } from "rasengan";
|
|
52
52
|
import { fileTypeFromBuffer } from "file-type";
|
|
53
|
+
var RASENGAN_VERCEL_CONFIG = process.env.RASENGAN_VERCEL_CONFIG;
|
|
53
54
|
// Create server for production only
|
|
54
55
|
export default function handler(req, res) {
|
|
55
56
|
return __awaiter(this, void 0, void 0, function () {
|
|
56
|
-
var url, host, appPath, configPath, config, filePath, file, err_1, segments, segmentsWithoutOrigin, _i, segments_1, segment, filePath, file, otherFile, result, mimeType, file, templateHtml, serverFilePath, bootstrapDirPath, entry, bootstrap, styles, render, staticRoutes, loadTemplateHtml, handler_1, fetchRequest, context, status_1, redirect, helmetContext, router, rendered, html, e_1;
|
|
57
|
+
var url, host, appPath, config_1, configPath, config, filePath, file, err_1, segments, segmentsWithoutOrigin, _i, segments_1, segment, filePath, file, otherFile, result, mimeType, file, templateHtml, serverFilePath, bootstrapDirPath, entry, bootstrap, styles, render, staticRoutes, loadTemplateHtml, handler_1, fetchRequest, context, status_1, redirect, helmetContext, router, rendered, html, e_1;
|
|
57
58
|
var _a;
|
|
58
59
|
return __generator(this, function (_b) {
|
|
59
60
|
switch (_b.label) {
|
|
@@ -62,7 +63,13 @@ export default function handler(req, res) {
|
|
|
62
63
|
url = req.url;
|
|
63
64
|
host = req.headers.host;
|
|
64
65
|
appPath = process.cwd();
|
|
65
|
-
|
|
66
|
+
// Check if RASENGAN_VERCEL_CONFIG is set
|
|
67
|
+
if (RASENGAN_VERCEL_CONFIG) {
|
|
68
|
+
config_1 = JSON.parse(RASENGAN_VERCEL_CONFIG);
|
|
69
|
+
// Get the app path
|
|
70
|
+
appPath = join(appPath, config_1.rootDirectory);
|
|
71
|
+
}
|
|
72
|
+
console.log({ env: appPath });
|
|
66
73
|
configPath = path.resolve(join(process.cwd() + "./../../", "rasengan.config.js"));
|
|
67
74
|
return [4 /*yield*/, import(configPath)];
|
|
68
75
|
case 1:
|