import { createRenderer } from 'vue-bundle-renderer' import devalue from '@nuxt/devalue' // @ts-ignore import { renderToString } from '~renderer' // @ts-ignore import server from '~build/dist/server/server' // @ts-ignore import clientManifest from '~build/dist/server/client.manifest.json' // @ts-ignore import htmlTemplate from '~build/views/document.template.js' const renderer = createRenderer(server, { clientManifest, renderToString }) export async function render (url, ctx: any) { const start = process.hrtime() const ssrContext: any = { url, runtimeConfig: { public: {}, private: {} }, ...ctx } const rendered = await renderer.renderToString(ssrContext) const state = `` const _html = `