Skip to content

Commit

Permalink
fix: use dynamic import for vue server-renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
pimlie committed Apr 3, 2021
1 parent fcb47a9 commit 8e2fed1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/ssr.ts
@@ -1,10 +1,9 @@
import type { App } from 'vue'
import type { SSRContext } from '@vue/server-renderer'

// rollup doesnt like an import as it cant find the export so use require
const { renderToString } = require('@vue/server-renderer')

export async function renderToStringWithMeta (app: App): Promise<[string, SSRContext]> {
const { renderToString } = await import('@vue/server-renderer')

const ctx: SSRContext = {}

const html = await renderToString(app, ctx)
Expand Down

0 comments on commit 8e2fed1

Please sign in to comment.