mbrv.org: Murat's Bun, React & Vite template
by murat
Most TypeScript bundlers that support UI hot reloads require running server & client on different processes/ports, leading to a cascade of problems.
MBRV runs on a single bun
process without sacrificing dev or prod features, such as hot reloads or server-side rendering.
bun run dev
provides hot reloads & source mapsbun run prod
builds & serves optimized versionbun run build
builds only (intodist/
)bun run.ts --help
to run without bundlers or hot reloads
- Server and client run on the same port
- No proxies or CORS issues
- Speed aside, bun makes running TypeScript a pleasure
- run.ts as single clear entry point, no blackbox scripts or commands
- Edit and save
client/App.tsx
to test component hot reloads - Server will also reload when
server/
orshared/
are saved, using nodemon to restart the bun process
- Server & client can use shared interfaces, types, and functions via
shared/
folder
- SSR is done with explicit code, no framework magic
- Enabled by default, with all relevant code in
run.ts
&server/ssr.tsx
- Express router in
server/apis/http.ts
- Socket.io setup in
server/apis/sockets.ts