@rpcbase/server 0.497.0 → 0.499.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 CHANGED
@@ -4384,7 +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 templateHtml = isProduction ? readFileSync("./build/dist/client/src/client/index.html", "utf-8") : "";
4387
+ const skipViteServe = ["1", "yes", "true"].includes(env.SKIP_VITE_SERVE);
4388
+ const templateHtml = isProduction || skipViteServe ? readFileSync("./build/dist/client/src/client/index.html", "utf-8") : "";
4388
4389
  const handleRedirectionResponse = (res, redirectResponse, location) => {
4389
4390
  res.status(redirectResponse.status || 302);
4390
4391
  try {
@@ -4505,7 +4506,7 @@ const ssrMiddleware = ({
4505
4506
  try {
4506
4507
  const base = "/";
4507
4508
  const url = req.originalUrl.replace(base, "");
4508
- if (isProduction) {
4509
+ if (isProduction || skipViteServe) {
4509
4510
  template = templateHtml;
4510
4511
  } else {
4511
4512
  template = await fsPromises.readFile("./src/client/index.html", "utf-8");