From dcfda90521e2e0550775a28c703119e0c55d2d33 Mon Sep 17 00:00:00 2001 From: Fran Dios Date: Wed, 10 Feb 2021 21:47:25 +0900 Subject: [PATCH] fix: Minor fixes --- core/cli.js | 2 +- core/entry-server.js | 5 +++-- example/src/App.vue | 10 ++++------ example/src/pages/PageB.vue | 1 + 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/cli.js b/core/cli.js index fff90c2..7d349dd 100755 --- a/core/cli.js +++ b/core/cli.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -const build = require('vite-ssr/build') +const build = require('./build') const [, , ...args] = process.argv diff --git a/core/entry-server.js b/core/entry-server.js index 9691635..671b606 100644 --- a/core/entry-server.js +++ b/core/entry-server.js @@ -1,7 +1,8 @@ import { createSSRApp } from 'vue' -import renderer from '@vue/server-renderer' +import { renderToString } from '@vue/server-renderer' import { createRouter, createMemoryHistory } from 'vue-router' import { createUrl, getFullPath, withoutSuffix } from './utils' + export default function (App, { routes, base }, hook) { return async function ({ request, ...extra }) { const url = createUrl(request.url) @@ -36,7 +37,7 @@ export default function (App, { routes, base }, hook) { router.currentRoute.value.meta.state || {} ) - let html = await renderer.renderToString(app) + let html = await renderToString(app) const [helmet = ''] = html.match(/]*?>(.|\s)*?<\/html>/im) || [] let [, head = ''] = helmet.match(/]*?>((.|\s)*?)<\/head>/im) || [] diff --git a/example/src/App.vue b/example/src/App.vue index 7f9dafb..dd2722b 100644 --- a/example/src/App.vue +++ b/example/src/App.vue @@ -2,14 +2,12 @@

A small state test for rehydration: {{ count }}

Below is the currently rendered route:

- - - +