Skip to content

Conversation

lifeishell
Copy link

@lifeishell lifeishell commented Jul 19, 2021

feat: Finish SSR part css inject.
linked to #1759

Exposes style's __inject__ function (which comes from vue-style-loader ) to script
Then you can use it to append styles on SSR context
Usage:

App.__inject__(context); // append styles on req context 
app = Vue.createSSRApp(App, context);
... other ssr codes ...
html = template.replace('</head>', `${context.context || ''}</head>`); // append styles to html head

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant