import { RenderOptions , createRenderer } from './renderer' ; type BundleRenderOptions = { runInNewContext ? : boolean | 'once' ; basedir ? : string ; renderToString : typeof import ( '@vue/server-renderer' ) . renderToString ; bundleRunner : typeof import ( 'bundle-runner' ) ; } & RenderOptions ; export function createBundleRenderer ( _bundle , renderOptions ) { const { evaluateEntry , rewriteErrorTrace } = renderOptions . bundleRunner . createBundle ( _bundle , renderOptions ) ; async function createApp ( ssrContext , evalContext ) { try { const entry = await evaluateEntry ( evalContext ) ; const app = await entry ( ssrContext ) ; return app ; } catch ( err ) { rewriteErrorTrace ( err ) ; throw err ; } } return createRenderer ( createApp , renderOptions ) ; }