Skip to content

Commit

Permalink
include component CSS in head, fixed inertiajs#1760
Browse files Browse the repository at this point in the history
  • Loading branch information
buhrmi committed Dec 26, 2023
1 parent 0fc4b1c commit 68fa8f6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/svelte/src/createInertiaApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@ export default async function createInertiaApp({ id = 'app', resolve, setup, pro
}

if (isServer) {
const { html, head } = SSR.render({ id, initialPage })
const { html, head, css } = SSR.render({ id, initialPage })

return {
body: html,
head: [head],
head: [
head,
`<style data-vite-css>${css.code}</style>`,
],
}
}
}

0 comments on commit 68fa8f6

Please sign in to comment.