diff --git a/packages/nuxt/src/core/runtime/nitro/renderer.ts b/packages/nuxt/src/core/runtime/nitro/renderer.ts index 69813f39b5..3f412545cf 100644 --- a/packages/nuxt/src/core/runtime/nitro/renderer.ts +++ b/packages/nuxt/src/core/runtime/nitro/renderer.ts @@ -229,9 +229,8 @@ export default defineRenderHandler(async (event): Promise> @@ -241,7 +240,7 @@ export default defineRenderHandler(async (event): Promise - ({ rel: 'stylesheet', href: renderer.rendererContext.buildAssetsURL(resource.file) }) - ) - }, headEntryOptions) + if (!isRenderingIsland || import.meta.dev) { + const link = [] + for (const style in styles) { + const resource = styles[style] + if (!import.meta.dev || (resource.file.includes('scoped') && !resource.file.includes('pages/'))) { + link.push({ rel: 'stylesheet', href: renderer.rendererContext.buildAssetsURL(resource.file) }) + } + } + head.push({ link }, headEntryOptions) + } - if (!NO_SCRIPTS) { + if (!NO_SCRIPTS && !isRenderingIsland) { // 3. Resource Hints // TODO: add priorities based on Capo head.push({ @@ -395,7 +400,7 @@ export default defineRenderHandler(async (event): Promise (