diff --git a/packages/nuxt/src/core/runtime/nitro/renderer.ts b/packages/nuxt/src/core/runtime/nitro/renderer.ts index e973d53f8e..4a7037ae44 100644 --- a/packages/nuxt/src/core/runtime/nitro/renderer.ts +++ b/packages/nuxt/src/core/runtime/nitro/renderer.ts @@ -385,7 +385,7 @@ export default defineRenderHandler(async (event): Promise { it('should not include inlined CSS in generated CSS file', async () => { const html: string = await $fetch('/styles') - const cssFiles = new Set([...html.matchAll(/]*href="([^"]*\.css)">/g)].map(m => m[1]!)) + const cssFiles = new Set([...html.matchAll(/]*href="([^"]*\.css)"(?: crossorigin)?>/g)].map(m => m[1]!)) let css = '' for (const file of cssFiles || []) { css += await $fetch(file) @@ -1831,11 +1831,7 @@ describe.skipIf(isDev() || isWebpack)('inlining component styles', () => { it('does not load stylesheet for page styles', async () => { const html: string = await $fetch('/styles') - expect(html.match(/]*href="[^"]*\.css">/g)?.filter(m => m.includes('entry'))?.map(m => m.replace(/\.[^.]*\.css/, '.css'))).toMatchInlineSnapshot(` - [ - "", - ] - `) + expect(html.match(/]*href="[^"]*\.css">(?: crossorigin)?/g)?.filter(m => m.includes('entry'))?.map(m => m.replace(/\.[^.]*\.css/, '.css'))).toMatchInlineSnapshot(`undefined`) }) it('still downloads client-only styles', async () => { @@ -2365,6 +2361,7 @@ describe('component islands', () => { { "link": [ { + "crossorigin": "", "href": "/_nuxt/components/islands/PureComponent.vue?vue&type=style&index=0&scoped=c0c0cf89&lang.css", "rel": "stylesheet", },