@rpcbase/server 0.498.0 → 0.500.0
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 +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4384,8 +4384,8 @@ const DEFAULT_SERVER_ERROR_MESSAGE = "We couldn't render this page on the server
|
|
|
4384
4384
|
const FALLBACK_ERROR_TEMPLATE_START = `<!doctype html><html lang="en"><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width,initial-scale=1" /><title>Server error</title><style>body{margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:#0b1021;color:#eef1f7;display:flex;align-items:center;justify-content:center;min-height:100vh;}main{max-width:420px;padding:32px;background:rgba(255,255,255,0.04);border:1px solid rgba(255,255,255,0.08);border-radius:14px;box-shadow:0 25px 50px rgba(0,0,0,0.35);}h1{font-size:24px;margin:0 0 8px;}p{margin:0 0 12px;line-height:1.5;}code{background:rgba(255,255,255,0.08);padding:2px 6px;border-radius:6px;font-size:12px;}</style></head><body><main>`;
|
|
4385
4385
|
const FALLBACK_ERROR_TEMPLATE_END = "</main></body></html>";
|
|
4386
4386
|
const isProduction = env.NODE_ENV === "production";
|
|
4387
|
-
const
|
|
4388
|
-
const templateHtml = isProduction ? readFileSync("./build/dist/client/src/client/index.html", "utf-8") : "";
|
|
4387
|
+
const skipViteServer = ["1", "yes", "true"].includes(env.SKIP_VITE_SERVER);
|
|
4388
|
+
const templateHtml = isProduction || skipViteServer ? readFileSync("./build/dist/client/src/client/index.html", "utf-8") : "";
|
|
4389
4389
|
const handleRedirectionResponse = (res, redirectResponse, location) => {
|
|
4390
4390
|
res.status(redirectResponse.status || 302);
|
|
4391
4391
|
try {
|
|
@@ -4506,7 +4506,7 @@ const ssrMiddleware = ({
|
|
|
4506
4506
|
try {
|
|
4507
4507
|
const base = "/";
|
|
4508
4508
|
const url = req.originalUrl.replace(base, "");
|
|
4509
|
-
if (isProduction ||
|
|
4509
|
+
if (isProduction || skipViteServer) {
|
|
4510
4510
|
template = templateHtml;
|
|
4511
4511
|
} else {
|
|
4512
4512
|
template = await fsPromises.readFile("./src/client/index.html", "utf-8");
|