diff --git a/playground/ssr-vue/prerender.js b/playground/ssr-vue/prerender.js index 94484156103df9..97f42835a3eda6 100644 --- a/playground/ssr-vue/prerender.js +++ b/playground/ssr-vue/prerender.js @@ -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') diff --git a/playground/ssr-vue/server.js b/playground/ssr-vue/server.js index 55605387c481f9..df3b0059b674ec 100644 --- a/playground/ssr-vue/server.js +++ b/playground/ssr-vue/server.js @@ -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()