Skip to content

Commit 4a392f0

Browse files
authored
test: fix ssr-vue server.js / prerender.js (#10554)
1 parent f199e90 commit 4a392f0

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

playground/ssr-vue/prerender.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33

44
import fs from 'node:fs'
55
import path from 'node:path'
6+
import url from 'node:url'
7+
8+
const __dirname = path.dirname(url.fileURLToPath(import.meta.url))
69

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

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

playground/ssr-vue/server.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ export async function createServer(
1919
: ''
2020

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

2627
const app = express()

0 commit comments

Comments
 (0)