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

Commit

Permalink
fix(nuxt): don't inline styles for per-request ssr: false (#8106)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex C <alex.canals@jkweb.ch>
  • Loading branch information
Alex--C and alex-canals authored Oct 12, 2022
1 parent bda187c commit 6ef6eae
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/nuxt/src/core/runtime/nitro/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export default defineRenderHandler(async (event) => {
const renderedMeta = await ssrContext.renderMeta?.() ?? {}

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

Expand Down
2 changes: 1 addition & 1 deletion test/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ describe.skipIf(process.env.NUXT_TEST_DEV || process.env.TEST_WITH_WEBPACK)('inl
'{--assets:"assets"}', // <script>
'{--scoped:"scoped"}', // <style lang=css>
'{--postcss:"postcss"}', // <style lang=postcss>
'{--global:"global"}', // entryfile dependency
'{--global:"global"', // entryfile dependency
'{--plugin:"plugin"}', // plugin dependency
'{--functional:"functional"}' // functional component with css import
]) {
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/basic/assets/global.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
:root {
--global: 'global';
--asset: url('~/assets/logo.svg');
}

0 comments on commit 6ef6eae

Please sign in to comment.