fix(nuxt): remove modulepreload for spa fallback routes with ssr:true (#7553)

This commit is contained in:
pooya parsa 2022-09-15 14:20:16 +02:00 committed by GitHub
parent 950cb60bd5
commit 4b4558c2be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -194,7 +194,7 @@ export default defineRenderHandler(async (event) => {
htmlAttrs: normalizeChunks([renderedMeta.htmlAttrs]),
head: normalizeChunks([
renderedMeta.headTags,
!process.env.NUXT_NO_SCRIPTS && process.env.prerender ? `<link rel="modulepreload" href="${payloadURL}">` : null,
(process.env.prerender && !ssrContext.noSSR) ? `<link rel="modulepreload" href="${payloadURL}">` : null,
_rendered.renderResourceHints(),
_rendered.renderStyles(),
inlinedStyles,