From 02cd0439e88fb17184978509025d4269bd6ebaa0 Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Mon, 16 Oct 2023 16:23:21 +0800 Subject: [PATCH] docs(ssr): update example projects (#14630) --- docs/guide/ssr.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/guide/ssr.md b/docs/guide/ssr.md index 7052c0ae165150..0913c412d0f865 100644 --- a/docs/guide/ssr.md +++ b/docs/guide/ssr.md @@ -16,10 +16,16 @@ If you have questions, the community is usually helpful at [Vite Discord's #ssr ## Example Projects -Vite provides built-in support for server-side rendering (SSR). The Vite playground contains example SSR setups for Vue 3 and React, which can be used as references for this guide: +Vite provides built-in support for server-side rendering (SSR). [`create-vite-extra`](https://github.com/bluwy/create-vite-extra) contains example SSR setups you can use as references for this guide: -- [Vue 3](https://github.com/vitejs/vite-plugin-vue/tree/main/playground/ssr-vue) -- [React](https://github.com/vitejs/vite-plugin-react/tree/main/playground/ssr-react) +- [Vanilla](https://github.com/bluwy/create-vite-extra/tree/master/template-ssr-vanilla) +- [Vue](https://github.com/bluwy/create-vite-extra/tree/master/template-ssr-vue) +- [React](https://github.com/bluwy/create-vite-extra/tree/master/template-ssr-react) +- [Preact](https://github.com/bluwy/create-vite-extra/tree/master/template-ssr-preact) +- [Svelte](https://github.com/bluwy/create-vite-extra/tree/master/template-ssr-svelte) +- [Solid](https://github.com/bluwy/create-vite-extra/tree/master/template-ssr-solid) + +You can also scaffold these projects locally by [running `create-vite`](./index.md#scaffolding-your-first-vite-project) and choose `Others > create-vite-extra` under the framework option. ## Source Structure @@ -177,7 +183,7 @@ Then, in `server.js` we need to add some production specific logic by checking ` - Move the creation and all usage of the `vite` dev server behind dev-only conditional branches, then add static file serving middlewares to serve files from `dist/client`. -Refer to the [Vue](https://github.com/vitejs/vite-plugin-vue/tree/main/playground/ssr-vue) and [React](https://github.com/vitejs/vite-plugin-react/tree/main/playground/ssr-react) demos for a working setup. +Refer to the [example projects](#example-projects) for a working setup. ## Generating Preload Directives