fix(nuxt): swap preloads for json/js payloads (#20375)

This commit is contained in:
Daniel Roe 2023-04-19 10:18:02 +01:00 committed by GitHub
parent fe441a1364
commit 4ab4ac13df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -287,8 +287,8 @@ export default defineRenderHandler(async (event) => {
head: normalizeChunks([ head: normalizeChunks([
renderedMeta.headTags, renderedMeta.headTags,
process.env.NUXT_JSON_PAYLOADS process.env.NUXT_JSON_PAYLOADS
? _PAYLOAD_EXTRACTION ? `<link rel="modulepreload" href="${payloadURL}">` : null ? _PAYLOAD_EXTRACTION ? `<link rel="preload" as="fetch" crossorigin="anonymous" href="${payloadURL}">` : null
: _PAYLOAD_EXTRACTION ? `<link rel="preload" as="fetch" crossorigin="anonymous" href="${payloadURL}">` : null, : _PAYLOAD_EXTRACTION ? `<link rel="modulepreload" href="${payloadURL}">` : null,
NO_SCRIPTS ? null : _rendered.renderResourceHints(), NO_SCRIPTS ? null : _rendered.renderResourceHints(),
_rendered.renderStyles(), _rendered.renderStyles(),
inlinedStyles, inlinedStyles,