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/cli.js +6 -4
- package/dist/hmr.d.ts.map +1 -1
- package/dist/hmr.js +3 -0
- package/dist/hmr.js.map +1 -1
- package/dist/hmr.mjs +3 -0
- package/dist/hmr.mjs.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +5 -3
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +5 -3
- package/dist/server.mjs.map +1 -1
- package/package.json +1 -1
- package/src/hmr.ts +5 -0
- package/src/server.ts +4 -2
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
|
|
57391
|
-
${
|
|
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
|
-
|
|
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",
|