☄️ vth

Lite

Lite vth template

Introduction

This template is a minimal version of the full-stack vth template.

It includes Vite, React for the frontend and Hono for the backend and RPC.

Getting started

To use this template, run the CLI with --lite flag:

npm create vth --lite

...or download from the repository:

Terminal
npx degit mrozio13pl/vth/templates/lite

Project structure

The project structure is very similar to the full-stack template:

Reactindex.tsx
TypeScriptclient.ts
Reactindex.tsx
Reactrefresh.tsx
npmpackage.json

Hot refresh

For development, you have to include a seperate script to handle hot refresh. This is because plugins like @vitejs/plugin-react can't inject the refresh script when working with Hono.

server/refresh.ts
import RefreshRuntime from '/@react-refresh';
RefreshRuntime.injectIntoGlobalHook(window);
window.$RefreshReg$ = () => {};
window.$RefreshSig$ = () => (type) => type;
window.__vite_plugin_react_preamble_installed__ = true;