/esbuild-hot-reload

Playground repo for experimenting with esbuild + hot reload

Primary LanguageJavaScriptMIT LicenseMIT

esbuild-hot-reload

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.

How to use this repo

  1. Run yarn (or your favorite package manager) to initialize dependencies
  2. Run node serve.js to kickstart a local server, pointed at public
  3. Update src/index.ts and save changes to hot reload the local server

Inspired by

This repo is inspired by @unki2aut’s MVP demo.