elit 3.4.1 → 3.4.2

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/server.mjs CHANGED
@@ -57387,8 +57387,9 @@ ${error}`);
57387
57387
  }
57388
57388
  }
57389
57389
  const elitImportMap = await createElitImportMap(client.root, basePath, client.mode);
57390
- const headInjection = ssrStyles ? `${ssrStyles}
57391
- ${elitImportMap}` : elitImportMap;
57390
+ const modeScript = config.mode === "preview" ? "<script>window.__ELIT_MODE__='preview';</script>" : "";
57391
+ const headInjection = `${modeScript}${ssrStyles ? "\n" + ssrStyles : ""}
57392
+ ${elitImportMap}`;
57392
57393
  html2 = html2.includes("</head>") ? html2.replace("</head>", `${headInjection}</head>`) : html2;
57393
57394
  html2 = html2.includes("</body>") ? html2.replace("</body>", `${hmrScript}</body>`) : html2 + hmrScript;
57394
57395
  content = Buffer.from(html2);
@@ -57443,7 +57444,8 @@ ${elitImportMap}` : elitImportMap;
57443
57444
  html2 = rewriteRelativePaths(html2, basePath);
57444
57445
  const hmrScript = config.mode !== "preview" ? createHMRScript(config.port, basePath) : "";
57445
57446
  const elitImportMap = await createElitImportMap(client.root, basePath, client.mode);
57446
- html2 = html2.includes("</head>") ? html2.replace("</head>", `${elitImportMap}</head>`) : html2;
57447
+ const modeScript = config.mode === "preview" ? "<script>window.__ELIT_MODE__='preview';</script>\n" : "";
57448
+ html2 = html2.includes("</head>") ? html2.replace("</head>", `${modeScript}${elitImportMap}</head>`) : html2;
57447
57449
  html2 = html2.includes("</body>") ? html2.replace("</body>", `${hmrScript}</body>`) : html2 + hmrScript;
57448
57450
  res.writeHead(200, {
57449
57451
  "Content-Type": "text/html",