banbri / vite-plugin-ssr_vercel

Home Page:https://vite-plugin-ssr-vercel-mauve.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

See vite-plugin-ssr.com/vercel.

How to deploy:

  1. Fork this repository.
  2. Log in to your Vercel account (or create one).
  3. Add your fork on Vercel's dashbaord with following settings:
    • FRAMEWORK PRESET should be Vite. (Vercel should automatically detect Vite; just make sure it's already set.)
    • Modify Build and Output Settings > OUTPUT DIRECTORY from dist to dist/client.

That's it, your fork is now deployed on Vercel (it should look like vite-plugin-ssr-demo.vercel.app). It's continuously deployed: if you commit and push a change to your fork, then Vercel automatically re-deploys your app.

Integration points:

  • API Route: api/ssr.js.
  • Routing URLs to api/ssr.js: vercel.json#rewrites.
  • Build: the package.json's scripts package.json#scripts['vercel-build'] and package.json#scripts.build.
  • Development: the package.json's script package.json#scripts.dev; we use Vite's development server for improved DX.

👉 Vercel runs our API Route api/ssr.js as a serverless function, for more information see Vercel Docs > Serverless Functions > Deploying.

About

https://vite-plugin-ssr-vercel-mauve.vercel.app


Languages

Language:JavaScript 60.3%Language:Vue 39.7%