Skip to content

Commit

Permalink
test: fix ssr-vue server.js / prerender.js (#10554)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Nov 3, 2022
1 parent f199e90 commit 4a392f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 6 additions & 1 deletion playground/ssr-vue/prerender.js
Expand Up @@ -3,10 +3,15 @@

import fs from 'node:fs'
import path from 'node:path'
import url from 'node:url'

const __dirname = path.dirname(url.fileURLToPath(import.meta.url))

const toAbsolute = (p) => path.resolve(__dirname, p)

const manifest = (await import('./dist/static/ssr-manifest.json')).default
const manifest = JSON.parse(
fs.readFileSync(toAbsolute('dist/static/ssr-manifest.json'), 'utf-8')
)
const template = fs.readFileSync(toAbsolute('dist/static/index.html'), 'utf-8')
const { render } = await import('./dist/server/entry-server.js')

Expand Down
5 changes: 3 additions & 2 deletions playground/ssr-vue/server.js
Expand Up @@ -19,8 +19,9 @@ export async function createServer(
: ''

const manifest = isProd
? // @ts-ignore
(await import('./dist/client/ssr-manifest.json')).default
? JSON.parse(
fs.readFileSync(resolve('dist/client/ssr-manifest.json'), 'utf-8')
)
: {}

const app = express()
Expand Down

0 comments on commit 4a392f0

Please sign in to comment.