rasengan 1.0.0-beta.14 → 1.0.0-beta.16
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.
|
@@ -65,13 +65,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
65
65
|
var promises_1 = __importDefault(require("node:fs/promises"));
|
|
66
66
|
var node_fs_1 = __importDefault(require("node:fs"));
|
|
67
67
|
var node_path_1 = __importStar(require("node:path"));
|
|
68
|
-
var node_url_1 = require("node:url");
|
|
69
68
|
var server_js_1 = require("react-router-dom/server.js");
|
|
70
69
|
// @ts-ignore
|
|
71
70
|
var rasengan_1 = require("rasengan");
|
|
72
|
-
// @ts-ignore
|
|
73
|
-
var __filename = (0, node_url_1.fileURLToPath)(import.meta.url);
|
|
74
|
-
var __dirname = (0, node_path_1.dirname)(__filename);
|
|
75
71
|
// Create server for production only
|
|
76
72
|
function handleRequest(req, res) {
|
|
77
73
|
var _a;
|
|
@@ -98,15 +94,15 @@ function handleRequest(req, res) {
|
|
|
98
94
|
case 4:
|
|
99
95
|
// ! Sitemap Fix
|
|
100
96
|
if (url === "/sitemap.xml") {
|
|
101
|
-
return [2 /*return*/, res.send(node_path_1.default.resolve((0, node_path_1.join)(appPath, "
|
|
97
|
+
return [2 /*return*/, res.send(node_path_1.default.resolve((0, node_path_1.join)(appPath, "client/sitemap.xml")))];
|
|
102
98
|
}
|
|
103
99
|
// ! Manifest Fix
|
|
104
100
|
if (url === "/manifest.json") {
|
|
105
|
-
return [2 /*return*/, res.send(node_path_1.default.resolve((0, node_path_1.join)(appPath, "
|
|
101
|
+
return [2 /*return*/, res.send(node_path_1.default.resolve((0, node_path_1.join)(appPath, "client/manifest.json")))];
|
|
106
102
|
}
|
|
107
103
|
templateHtml = "";
|
|
108
|
-
serverFilePath = (0, node_path_1.join)(appPath, "
|
|
109
|
-
bootstrapDirPath = (0, node_path_1.join)(appPath, "
|
|
104
|
+
serverFilePath = (0, node_path_1.join)(appPath, "server/entry-server.js");
|
|
105
|
+
bootstrapDirPath = (0, node_path_1.join)(appPath, "client/assets");
|
|
110
106
|
return [4 /*yield*/, Promise.resolve("".concat(serverFilePath)).then(function (s) { return __importStar(require(s)); })];
|
|
111
107
|
case 5:
|
|
112
108
|
entry = _b.sent();
|
|
@@ -36,14 +36,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
};
|
|
37
37
|
import fs from "node:fs/promises";
|
|
38
38
|
import fsSync from "node:fs";
|
|
39
|
-
import path, { join
|
|
40
|
-
import { fileURLToPath } from "node:url";
|
|
39
|
+
import path, { join } from "node:path";
|
|
41
40
|
import { createStaticHandler, createStaticRouter, } from "react-router-dom/server.js";
|
|
42
41
|
// @ts-ignore
|
|
43
42
|
import { createFetchRequest } from "rasengan";
|
|
44
|
-
// @ts-ignore
|
|
45
|
-
var __filename = fileURLToPath(import.meta.url);
|
|
46
|
-
var __dirname = dirname(__filename);
|
|
47
43
|
// Create server for production only
|
|
48
44
|
export default function handleRequest(req, res) {
|
|
49
45
|
var _a;
|
|
@@ -70,15 +66,15 @@ export default function handleRequest(req, res) {
|
|
|
70
66
|
case 4:
|
|
71
67
|
// ! Sitemap Fix
|
|
72
68
|
if (url === "/sitemap.xml") {
|
|
73
|
-
return [2 /*return*/, res.send(path.resolve(join(appPath, "
|
|
69
|
+
return [2 /*return*/, res.send(path.resolve(join(appPath, "client/sitemap.xml")))];
|
|
74
70
|
}
|
|
75
71
|
// ! Manifest Fix
|
|
76
72
|
if (url === "/manifest.json") {
|
|
77
|
-
return [2 /*return*/, res.send(path.resolve(join(appPath, "
|
|
73
|
+
return [2 /*return*/, res.send(path.resolve(join(appPath, "client/manifest.json")))];
|
|
78
74
|
}
|
|
79
75
|
templateHtml = "";
|
|
80
|
-
serverFilePath = join(appPath, "
|
|
81
|
-
bootstrapDirPath = join(appPath, "
|
|
76
|
+
serverFilePath = join(appPath, "server/entry-server.js");
|
|
77
|
+
bootstrapDirPath = join(appPath, "client/assets");
|
|
82
78
|
return [4 /*yield*/, import(serverFilePath)];
|
|
83
79
|
case 5:
|
|
84
80
|
entry = _b.sent();
|
package/package.json
CHANGED
package/tsconfig.json
CHANGED