Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.

Commit 6ef6eae

Browse files
Alex--Calex-canals
andauthored
fix(nuxt): don't inline styles for per-request ssr: false (#8106)
Co-authored-by: Alex C <[email protected]>
1 parent bda187c commit 6ef6eae

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

packages/nuxt/src/core/runtime/nitro/renderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export default defineRenderHandler(async (event) => {
205205
const renderedMeta = await ssrContext.renderMeta?.() ?? {}
206206

207207
// Render inline styles
208-
const inlinedStyles = process.env.NUXT_INLINE_STYLES
208+
const inlinedStyles = process.env.NUXT_INLINE_STYLES && !(process.env.NUXT_NO_SSR || ssrContext.noSSR)
209209
? await renderInlineStyles(ssrContext.modules ?? ssrContext._registeredComponents ?? [])
210210
: ''
211211

test/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ describe.skipIf(process.env.NUXT_TEST_DEV || process.env.TEST_WITH_WEBPACK)('inl
598598
'{--assets:"assets"}', // <script>
599599
'{--scoped:"scoped"}', // <style lang=css>
600600
'{--postcss:"postcss"}', // <style lang=postcss>
601-
'{--global:"global"}', // entryfile dependency
601+
'{--global:"global"', // entryfile dependency
602602
'{--plugin:"plugin"}', // plugin dependency
603603
'{--functional:"functional"}' // functional component with css import
604604
]) {

test/fixtures/basic/assets/global.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
:root {
22
--global: 'global';
3+
--asset: url('~/assets/logo.svg');
34
}

0 commit comments

Comments
 (0)