A full example of vite-plugin-ssr
showcasing each of it's available rendering modes with Vue.
- Install project dependencies with
npm install
. - Preview a serverless deployment with
npm run preview:render
. - Preview a full static deployment with
npm run preview:static
. - Go to http://localhost:3000 in your browser.
- Explore! 🔍
-
vite-plugin-ssr
The reason that this repository exists. A flexible, framework agnosticvite
plugin/framework for server-side rendering (SSR), but capable of even more, such as pre-rendering (SSG), server or client-only modes (SPA, HTML), and client routing. It's like a lightweight version of Next/Nuxt.js that gives you more architectural control. Thanks @brillout for your hard work! ❤️ -
vite
The world's best (in my current humble opinion) development server and build tool, by Evan You. It's kind of like Webpack withwebpack-dev-server
, except you don't have to spend hours writing the world's longest and ugliestwebpack.config.js
, and HMR is actually hot. -
vue
vite-plugin-ssr
might be framework agnostic, but I'm not. My preference for a front-end web framework (unless Svelte eventually steals my heart) is Vue because I find it cleaner and easier to work with than React, doesn't use JSX, and has a solid community ecosystem. Also, it's written by Even You, who later also created Vite. Maybe he's a mythical 10x developer? -
typescript
Makes JavaScript not suck. I guarantee you, if you're not using TypeScript, your code has more bugs than mine. Also, TypeScript ranks very highly among developer satisfaction, so it's definitely doing something right. It's simply a superset of JavaScript that adds syntax for types.
Package Name | Description |
---|---|
@vitejs/plugin-vue |
Adds vue support to vite . |
express + sirv |
The server setup used to preview build output. |
ts-node |
Run .ts files directly from the command line. |
chalk |
Used to add color to preview server logs. |
@types/node , @types/express |
TypeScript type definitions. |