import { renderToNodeStream } from '@vue/server-renderer' ; import { escapeInject } from 'vite-plugin-ssr' ; import { createApp } from './app' ; import { getPageTitle } from './getPageTitle' ; import type { PageContext } from './types' ; import type { PageContextBuiltIn } from 'vite-plugin-ssr' ; export { passToClient } ; export { render } ; const passToClient = [ 'pageProps' , 'documentProps' ] ; async function render ( pageContext ) { const app = createApp ( pageContext ) ; const stream = renderToNodeStream ( app ) ; const title = getPageTitle ( pageContext ) ; return escapeInject `<!DOCTYPE html>
    <html>
      <head>
        <title>${ title }</title>
      </head>
      <body>
        <div id="app">${ stream }</div>
      </body>
    </html>` ; }