Skip to content

thednp/vite-starter-vanjs-ssr

Repository files navigation

vite-starter-vanjs-ssr

A fully working vite starter template for VanJS forked from template-ssr-vanilla-ts.

Features:

  • SSR server powered by express;
  • SSG prerender script included;
  • isomorphic render powered by vite-plugin-vanjs.

Install

Clone the repository from Github.

git clone https://github.com/thednp/vite-starter-vanjs-ssr.git my-project
cd my-project

Run your favorite package manager installation script.

npm install
pnpm install
deno install

Development

Start the development server.

npm run dev
pnpm dev
deno task dev

Preview

Prerender the application and start the server.

npm run preview
pnpm preview
deno task preview

Build a Static Application

Prerender the application.

npm run generate

Start the application.

npm run start

Build a Server-Side Rendering Application

Build the application.

npm run build

Start the application.

npm run start

Other Notes

  • you are expected to create pages in the src/pages folder in order for the prerenderer to work;
  • for more information about SSR, it's highly recommanded to check the Vite documentation.

License

Released under MIT.