Vike Local Development Guide

Vike (formerly vite-plugin-ssr) provides SSR and flexible rendering modes for Vite, commonly accessed at localhost:3000 during local development.


Vike (formerly vite-plugin-ssr) is a framework for building SSR applications on top of Vite, supporting various rendering modes such as SPA, SSR, and SSG, and can be integrated with view layers like React, Vue, and Solid.

Quick Start

npm create vike@latest
cd my-app
npm install
npm run dev

Default localhost Access

PurposeAddress
Development Serverhttp://localhost:3000

Some templates may use port 5173; refer to the project’s package.json and terminal output for confirmation.

Features

  • Configurable Rendering Modes: Choose between SSR or CSR based on routing within the same project.
  • Vite-based: Development and build toolchain consistent with the Vite ecosystem.
  • Framework-agnostic: High decoupling of page logic from UI frameworks.

Common Commands

CommandDescription
npm run devDevelopment mode
npm run buildBuild client and server bundles
npm run previewPreview production build

Comparison with Next.js / SvelteKit

Vike leans towards “Vite + composable SSR layer,” offering higher flexibility, making it suitable for teams gradually introducing SSR into existing Vite projects or requiring fine-grained control over rendering strategies.

Summary

Vike is suitable for implementing SSR/SSG on Vite, with local development typically accessed at http://localhost:3000, subject to project configuration.

访客计数:------ Best viewed in Netscape Navigator · 800×600 © LocalHost Run