mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +00:00
fix(nuxt): don't inline styles for per-request ssr: false
(#8106)
Co-authored-by: Alex C <alex.canals@jkweb.ch>
This commit is contained in:
parent
bda187c1be
commit
6ef6eae2c7
@ -205,7 +205,7 @@ export default defineRenderHandler(async (event) => {
|
|||||||
const renderedMeta = await ssrContext.renderMeta?.() ?? {}
|
const renderedMeta = await ssrContext.renderMeta?.() ?? {}
|
||||||
|
|
||||||
// Render inline styles
|
// 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 ?? [])
|
? await renderInlineStyles(ssrContext.modules ?? ssrContext._registeredComponents ?? [])
|
||||||
: ''
|
: ''
|
||||||
|
|
||||||
|
@ -598,7 +598,7 @@ describe.skipIf(process.env.NUXT_TEST_DEV || process.env.TEST_WITH_WEBPACK)('inl
|
|||||||
'{--assets:"assets"}', // <script>
|
'{--assets:"assets"}', // <script>
|
||||||
'{--scoped:"scoped"}', // <style lang=css>
|
'{--scoped:"scoped"}', // <style lang=css>
|
||||||
'{--postcss:"postcss"}', // <style lang=postcss>
|
'{--postcss:"postcss"}', // <style lang=postcss>
|
||||||
'{--global:"global"}', // entryfile dependency
|
'{--global:"global"', // entryfile dependency
|
||||||
'{--plugin:"plugin"}', // plugin dependency
|
'{--plugin:"plugin"}', // plugin dependency
|
||||||
'{--functional:"functional"}' // functional component with css import
|
'{--functional:"functional"}' // functional component with css import
|
||||||
]) {
|
]) {
|
||||||
|
1
test/fixtures/basic/assets/global.css
vendored
1
test/fixtures/basic/assets/global.css
vendored
@ -1,3 +1,4 @@
|
|||||||
:root {
|
:root {
|
||||||
--global: 'global';
|
--global: 'global';
|
||||||
|
--asset: url('~/assets/logo.svg');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user