11export { render } ;
2- // See https://vite-plugin-ssr.com /data-fetching
2+ // See https://vike.dev /data-fetching
33export const passToClient = [ 'pageProps' , 'urlPathname' ] ;
44
55import { renderToString } from 'preact-render-to-string' ;
66import { PageShell } from './PageShell' ;
7- import { escapeInject , dangerouslySkipEscape } from 'vite-plugin-ssr /server' ;
7+ import { escapeInject , dangerouslySkipEscape } from 'vike /server' ;
88
99async function render ( pageContext ) {
1010 const { Page, pageProps } = pageContext ;
11- // This render() hook only supports SSR, see https://vite-plugin-ssr.com /render-modes for how to modify render() to support SPA
11+ // This render() hook only supports SSR, see https://vike.dev /render-modes for how to modify render() to support SPA
1212 if ( ! Page ) throw new Error ( 'My render() hook expects pageContext.Page to be defined' ) ;
1313 const pageHtml = renderToString (
1414 < PageShell pageContext = { pageContext } >
1515 < Page { ...pageProps } />
1616 </ PageShell > ,
1717 ) ;
1818
19- // See https://vite-plugin-ssr.com /head
19+ // See https://vike.dev /head
2020 const { documentProps } = pageContext . exports ;
2121 const title = ( documentProps && documentProps . title ) || 'Vite SSR + Preact' ;
2222 const desc =
23- ( documentProps && documentProps . description ) || 'Preact app with Vite and vite-plugin-ssr ' ;
23+ ( documentProps && documentProps . description ) || 'Preact app with Vite and vike ' ;
2424
2525 const documentHtml = escapeInject `<!DOCTYPE html>
2626 <html lang="en">
@@ -40,7 +40,7 @@ async function render(pageContext) {
4040 return {
4141 documentHtml,
4242 pageContext : {
43- // We can add some `pageContext` here, which is useful if we want to do page redirection https://vite-plugin-ssr.com /page-redirection
43+ // We can add some `pageContext` here, which is useful if we want to do page redirection https://vike.dev /page-redirection
4444 } ,
4545 } ;
4646}
0 commit comments