Package Exports
- @css-render/vue3-ssr
- @css-render/vue3-ssr/esm/index.js
- @css-render/vue3-ssr/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@css-render/vue3-ssr) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@css-render/vue3-ssr
Example
import { createSSRApp } from 'vue'
import { renderToString } from '@vue/server-renderer'
import { setup } = from '@css-render/vue3-ssr'
// For each request, you need to create a new app
const ssrApp = createSSRApp(App)
const { collect } = setup(ssrApp)
renderToString(ssrApp).then(appHtml => {
const css = collect()
const page = `<!DOCTYPE html>
<html>
<head>${css}</head>
<body><div id="app">${appHtml}</div></body>
</html>`
})