rasengan 1.0.0-beta.25 → 1.0.0-beta.26
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.
|
@@ -42,7 +42,7 @@ import { createStaticHandler, createStaticRouter, } from "react-router-dom/serve
|
|
|
42
42
|
// @ts-ignore
|
|
43
43
|
import { createFetchRequest } from "rasengan";
|
|
44
44
|
export default (function (req, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
45
|
-
var __filename, __dirname, url, host, appPath, err_1, file, templateHtml, serverFilePath, bootstrapDirPath, entry, bootstrap, styles, render, staticRoutes, loadTemplateHtml, handler, fetchRequest, context_1, status_1, redirect, helmetContext, router, rendered, html, e_1;
|
|
45
|
+
var __filename, __dirname, url, host, appPath, err_1, filePath, file, templateHtml, serverFilePath, bootstrapDirPath, entry, bootstrap, styles, render, staticRoutes, loadTemplateHtml, handler, fetchRequest, context_1, status_1, redirect, helmetContext, router, rendered, html, e_1;
|
|
46
46
|
var _a;
|
|
47
47
|
return __generator(this, function (_b) {
|
|
48
48
|
switch (_b.label) {
|
|
@@ -75,8 +75,9 @@ export default (function (req, context) { return __awaiter(void 0, void 0, void
|
|
|
75
75
|
if (url === "/manifest.json") {
|
|
76
76
|
return [2 /*return*/, new Response(path.resolve(join(appPath, "dist/client/manifest.json")))];
|
|
77
77
|
}
|
|
78
|
-
if (!
|
|
79
|
-
|
|
78
|
+
if (!url.includes("/assets")) return [3 /*break*/, 7];
|
|
79
|
+
filePath = join(appPath, "dist/client", url);
|
|
80
|
+
return [4 /*yield*/, fs.readFile(filePath, "utf-8")];
|
|
80
81
|
case 6:
|
|
81
82
|
file = _b.sent();
|
|
82
83
|
return [2 /*return*/, new Response(file, {
|