Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nuxt): in dev mode, don't add links to css files that have been inlined #25822

Merged
merged 7 commits into from Feb 16, 2024
3 changes: 3 additions & 0 deletions packages/nuxt/src/core/runtime/nitro/renderer.ts
Expand Up @@ -393,6 +393,9 @@ export default defineRenderHandler(async (event): Promise<Partial<RenderResponse
for (const style in styles) {
const resource = styles[style]
if (!import.meta.dev || !isRenderingIsland || (resource.file.includes('scoped') && !resource.file.includes('pages/'))) {
// support for the ?inline query parameter for Vite version > 5.0
if (import.meta.dev && resource.file.endsWith('?inline')) continue
OnlyWick marked this conversation as resolved.
Show resolved Hide resolved

link.push({ rel: 'stylesheet', href: renderer.rendererContext.buildAssetsURL(resource.file) })
}
}
Expand Down