@taujs/server 0.1.3 → 0.1.4
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 +4 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -378,7 +378,10 @@ var SSRServer = (0, import_fastify_plugin.default)(
|
|
|
378
378
|
const initialDataResolved = await initialDataPromise;
|
|
379
379
|
const initialDataScript = `<script>window.__INITIAL_DATA__ = ${JSON.stringify(initialDataResolved).replace(/</g, "\\u003c")}</script>`;
|
|
380
380
|
const { headContent, appHtml } = await renderSSR(initialDataResolved, req.url, attr?.meta);
|
|
381
|
-
|
|
381
|
+
let aggregateHeadContent = headContent;
|
|
382
|
+
if (ssrManifest) aggregateHeadContent += preloadLinks;
|
|
383
|
+
if (manifest) aggregateHeadContent += cssLinks;
|
|
384
|
+
const fullHtml = template.replace(SSRTAG.ssrHead, aggregateHeadContent).replace(SSRTAG.ssrHtml, `${appHtml}${initialDataScript}<script type="module" src="${bootstrapModules}" async=""></script>`);
|
|
382
385
|
return reply.status(200).header("Content-Type", "text/html").send(fullHtml);
|
|
383
386
|
} else {
|
|
384
387
|
const { renderStream } = renderModule;
|