no message
This commit is contained in:
@@ -120,7 +120,7 @@ const getEntryIds = () => getClientManifest().then((r) => Object.values(r).filte
|
||||
r2._globalCSS
|
||||
)
|
||||
).map((r2) => r2.src));
|
||||
const getServerEntry = () => import('../app/server.mjs').then((r) => r.default || r);
|
||||
const getServerEntry = () => import('../app/server.mjs').then(function (n) { return n.v; }).then((r) => r.default || r);
|
||||
const getSSRStyles = lazyCachedFunction(() => import('../app/styles.mjs').then((r) => r.default || r));
|
||||
const getSSRRenderer = lazyCachedFunction(async () => {
|
||||
const manifest = await getClientManifest();
|
||||
@@ -188,9 +188,10 @@ const renderer = defineRenderHandler(async (event) => {
|
||||
statusMessage: "Page Not Found: /__nuxt_error"
|
||||
});
|
||||
}
|
||||
const isRenderingIsland = false ;
|
||||
const islandContext = void 0;
|
||||
let url = ssrError?.url || islandContext?.url || event.path;
|
||||
const isRenderingPayload = PAYLOAD_URL_RE.test(url) && !islandContext;
|
||||
const isRenderingPayload = PAYLOAD_URL_RE.test(url) && !isRenderingIsland;
|
||||
if (isRenderingPayload) {
|
||||
url = url.substring(0, url.lastIndexOf("/")) || "/";
|
||||
event._path = url;
|
||||
@@ -201,12 +202,14 @@ const renderer = defineRenderHandler(async (event) => {
|
||||
plugins: unheadPlugins
|
||||
});
|
||||
const headEntryOptions = { mode: "server" };
|
||||
head.push(appHead, headEntryOptions);
|
||||
{
|
||||
head.push(appHead, headEntryOptions);
|
||||
}
|
||||
const ssrContext = {
|
||||
url,
|
||||
event,
|
||||
runtimeConfig: useRuntimeConfig(),
|
||||
noSSR: event.context.nuxt?.noSSR || routeOptions.ssr === false && !islandContext || (false),
|
||||
noSSR: event.context.nuxt?.noSSR || routeOptions.ssr === false && !isRenderingIsland || (false),
|
||||
head,
|
||||
error: !!ssrError,
|
||||
nuxt: void 0,
|
||||
@@ -247,12 +250,17 @@ const renderer = defineRenderHandler(async (event) => {
|
||||
const NO_SCRIPTS = routeOptions.experimentalNoScripts;
|
||||
const { styles, scripts } = getRequestDependencies(ssrContext, renderer.rendererContext);
|
||||
head.push({ style: inlinedStyles });
|
||||
head.push({
|
||||
link: Object.values(styles).map(
|
||||
(resource) => ({ rel: "stylesheet", href: renderer.rendererContext.buildAssetsURL(resource.file) })
|
||||
)
|
||||
}, headEntryOptions);
|
||||
if (!NO_SCRIPTS) {
|
||||
{
|
||||
const link = [];
|
||||
for (const style in styles) {
|
||||
const resource = styles[style];
|
||||
{
|
||||
link.push({ rel: "stylesheet", href: renderer.rendererContext.buildAssetsURL(resource.file) });
|
||||
}
|
||||
}
|
||||
head.push({ link }, headEntryOptions);
|
||||
}
|
||||
if (!NO_SCRIPTS && !isRenderingIsland) {
|
||||
head.push({
|
||||
link: getPreloadLinks(ssrContext, renderer.rendererContext)
|
||||
}, headEntryOptions);
|
||||
@@ -268,7 +276,7 @@ const renderer = defineRenderHandler(async (event) => {
|
||||
tagPriority: "high"
|
||||
});
|
||||
}
|
||||
if (!routeOptions.experimentalNoScripts) {
|
||||
if (!routeOptions.experimentalNoScripts && !isRenderingIsland) {
|
||||
head.push({
|
||||
script: Object.values(scripts).map((resource) => ({
|
||||
type: resource.module ? "module" : null,
|
||||
@@ -280,10 +288,10 @@ const renderer = defineRenderHandler(async (event) => {
|
||||
}
|
||||
const { headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs } = await renderSSRHead(head);
|
||||
const htmlContext = {
|
||||
island: Boolean(islandContext),
|
||||
htmlAttrs: [htmlAttrs],
|
||||
island: isRenderingIsland,
|
||||
htmlAttrs: htmlAttrs ? [htmlAttrs] : [],
|
||||
head: normalizeChunks([headTags, ssrContext.styles]),
|
||||
bodyAttrs: [bodyAttrs],
|
||||
bodyAttrs: bodyAttrs ? [bodyAttrs] : [],
|
||||
bodyPrepend: normalizeChunks([bodyTagsOpen, ssrContext.teleports?.body]),
|
||||
body: [_rendered.html],
|
||||
bodyAppend: [bodyTags]
|
||||
@@ -322,11 +330,7 @@ function joinAttrs(chunks) {
|
||||
return chunks.join(" ");
|
||||
}
|
||||
function renderHTMLDocument(html) {
|
||||
return `<!DOCTYPE html>
|
||||
<html ${joinAttrs(html.htmlAttrs)}>
|
||||
<head>${joinTags(html.head)}</head>
|
||||
<body ${joinAttrs(html.bodyAttrs)}>${joinTags(html.bodyPrepend)}${joinTags(html.body)}${joinTags(html.bodyAppend)}</body>
|
||||
</html>`;
|
||||
return `<!DOCTYPE html><html${joinAttrs(html.htmlAttrs)}><head>${joinTags(html.head)}</head><body${joinAttrs(html.bodyAttrs)}>${joinTags(html.bodyPrepend)}${joinTags(html.body)}${joinTags(html.bodyAppend)}</body></html>`;
|
||||
}
|
||||
async function renderInlineStyles(usedModules) {
|
||||
const styleMap = await getSSRStyles();
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"renderer.mjs","sources":["../../../../node_modules/nitropack/dist/runtime/renderer.mjs","../../../../node_modules/@unhead/vue/dist/shared/vue.cf295fb1.mjs","../../../../node_modules/nuxt/dist/core/runtime/nitro/paths.js","../../../../node_modules/nuxt/dist/core/runtime/nitro/renderer.js"],"sourcesContent":null,"names":["renderToString","_renderToString"],"mappings":"","x_google_ignoreList":[0,1,2,3]}
|
||||
{"version":3,"file":"renderer.mjs","sources":["../../../../node_modules/.pnpm/nitropack@2.8.1/node_modules/nitropack/dist/runtime/renderer.mjs","../../../../node_modules/.pnpm/@unhead+vue@1.8.10_vue@3.4.15/node_modules/@unhead/vue/dist/shared/vue.cf295fb1.mjs","../../../../node_modules/.pnpm/nuxt@3.9.3_less@4.2.0_vite@5.0.12/node_modules/nuxt/dist/core/runtime/nitro/paths.js","../../../../node_modules/.pnpm/nuxt@3.9.3_less@4.2.0_vite@5.0.12/node_modules/nuxt/dist/core/runtime/nitro/renderer.js"],"sourcesContent":null,"names":["renderToString","_renderToString"],"mappings":"","x_google_ignoreList":[0,1,2,3]}
|
||||
Reference in New Issue
Block a user