This is a minimal repo that aims to demonstrate how to esbuild + TypeScript + hot reload. Note that hot reloading is not the same thing as hot module replacement, otherwise known as HMR. Hot reload simply refreshes your local server whereas HMR dynamically refreshes your local server’s modules. HMR is great when it works but poses significant complexity overhead whereas hot reloading is simpler and easier to reason about.
- Run
yarn
(or your favorite package manager) to initialize dependencies - Run
node serve.js
to kickstart a local server, pointed atpublic
- Update
src/index.ts
and save changes to hot reload the local server
This repo is inspired by @unki2aut’s MVP demo.