🚧 VeloxKit is pre-release software. APIs may change before v1.0. Get started →
Documentation
Guides
Hot Reload

Hot Reload

VeloxKit's dev server includes hot module replacement (HMR). Save a file; the window updates in under 100ms without losing component state.

How it works

  1. veloxkit dev watches your source directory for changes
  2. On save, bun rebuilds the bundle in the background (~20–80ms)
  3. The new JS is evaluated inside the running V8 context — no process restart
  4. React re-renders the entire component tree from the new code

The OS window never closes and reopens. The full cycle from save to visible update is typically under 100ms.

Start the dev server

npm run dev
# or
npx veloxkit-cli dev

The native window opens and begins watching for changes.

Configure the dev server

The CDP inspector can be enabled for in-browser debugging:

veloxkit dev --inspect        # inspector on port 9229
veloxkit dev --inspect 9230   # custom port

See the Debugging guide for how to connect Chrome DevTools.

Force a full reload

In the terminal where veloxkit dev is running, type R and press Enter. This triggers the same rebuild-and-reload path as a file change, but without needing to touch any source file. Useful after switching git branches, pulling changes, or manually editing the build output.

> veloxkit dev
[HMR] ready — edit js/app.jsx to hot-reload  (press R + Enter to force reload)
r                    ← you type this
[HMR] full reload triggered (R)
[HMR] build ok — reloading app
[HMR] eval ok — 12 scene commands

Full reload re-runs bun and re-evals the entire JS bundle in the existing V8 context. Component state is reset. The OS window stays open.