|
|
@ -65,9 +65,7 @@ export async function renderPage(
|
|
|
|
|
|
|
|
|
|
|
|
let preloadLinks =
|
|
|
|
let preloadLinks =
|
|
|
|
config.mpa || (!hasCustom404 && page === '404.md')
|
|
|
|
config.mpa || (!hasCustom404 && page === '404.md')
|
|
|
|
? appChunk
|
|
|
|
? []
|
|
|
|
? [appChunk.fileName]
|
|
|
|
|
|
|
|
: []
|
|
|
|
|
|
|
|
: result && appChunk
|
|
|
|
: result && appChunk
|
|
|
|
? [
|
|
|
|
? [
|
|
|
|
...new Set([
|
|
|
|
...new Set([
|
|
|
@ -75,8 +73,7 @@ export async function renderPage(
|
|
|
|
// for them as well so we fetch everything as early as possible
|
|
|
|
// for them as well so we fetch everything as early as possible
|
|
|
|
// without having to wait for entry chunks to parse
|
|
|
|
// without having to wait for entry chunks to parse
|
|
|
|
...resolvePageImports(config, page, result, appChunk),
|
|
|
|
...resolvePageImports(config, page, result, appChunk),
|
|
|
|
pageClientJsFileName,
|
|
|
|
pageClientJsFileName
|
|
|
|
appChunk.fileName
|
|
|
|
|
|
|
|
])
|
|
|
|
])
|
|
|
|
]
|
|
|
|
]
|
|
|
|
: []
|
|
|
|
: []
|
|
|
@ -163,6 +160,11 @@ export async function renderPage(
|
|
|
|
<title>${title}</title>
|
|
|
|
<title>${title}</title>
|
|
|
|
<meta name="description" content="${description}">
|
|
|
|
<meta name="description" content="${description}">
|
|
|
|
${stylesheetLink}
|
|
|
|
${stylesheetLink}
|
|
|
|
|
|
|
|
${
|
|
|
|
|
|
|
|
appChunk
|
|
|
|
|
|
|
|
? `<script type="module" src="${siteData.base}${appChunk.fileName}"></script>`
|
|
|
|
|
|
|
|
: ``
|
|
|
|
|
|
|
|
}
|
|
|
|
${preloadLinksString}
|
|
|
|
${preloadLinksString}
|
|
|
|
${prefetchLinkString}
|
|
|
|
${prefetchLinkString}
|
|
|
|
${await renderHead(head)}
|
|
|
|
${await renderHead(head)}
|
|
|
@ -170,11 +172,6 @@ export async function renderPage(
|
|
|
|
<body>${teleports?.body || ''}
|
|
|
|
<body>${teleports?.body || ''}
|
|
|
|
<div id="app">${content}</div>
|
|
|
|
<div id="app">${content}</div>
|
|
|
|
${config.mpa ? '' : `<script>${metadataScript}</script>`}
|
|
|
|
${config.mpa ? '' : `<script>${metadataScript}</script>`}
|
|
|
|
${
|
|
|
|
|
|
|
|
appChunk
|
|
|
|
|
|
|
|
? `<script type="module" async src="${siteData.base}${appChunk.fileName}"></script>`
|
|
|
|
|
|
|
|
: ``
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
${inlinedScript}
|
|
|
|
${inlinedScript}
|
|
|
|
</body>
|
|
|
|
</body>
|
|
|
|
</html>`.trim()
|
|
|
|
</html>`.trim()
|
|
|
|