test vite ssr
This commit is contained in:
1 parent
6725bf89ad
commit
066f94188a
20 files changed
+406
No files matched your search
@@ -0,0 +1,14 @@
|
||||
import { getPage } from 'vite-plugin-ssr/client'
|
||||
import { createApp } from './app'
|
||||
import type { PageContext } from './types'
|
||||
import type { PageContextBuiltInClient } from 'vite-plugin-ssr/client'
|
||||
|
||||
hydrate()
|
||||
|
||||
async function hydrate() {
|
||||
// We do Server Routing, but we can also do Client Routing by using `useClientRouter()`
|
||||
// instead of `getPage()`, see https://vite-plugin-ssr.com/useClientRouter
|
||||
const pageContext = await getPage<PageContextBuiltInClient & PageContext>()
|
||||
const app = createApp(pageContext)
|
||||
app.mount('#app')
|
||||
}
|
||||
Reference in new issue
Block a user