Development
Here are some quick notes about how I develop esbuild.
Primary workflow
My development workflow revolves around the top-level Makefile, which I use as a script runner.
- Build
Assuming you have Go installed, you can compile esbuild by running make in the top-level directory (or go build ./cmd/esbuild if you don't have make installed). This creates an executable called esbuild (or esbuild.exe on Windows).
- Test
You can run the tests written in Go by running make test-go in the top-level directory (or go test ./internal/... if you don't have make installed).
If you want to run more kinds of tests, you can run make test instead. This requires installing node. And it's possible to run even more tests than that with additional make commands (read the Makefile for details).
- Publish
Here's what I do to publish a new release:
- Bump the version in
version.txt - Copy that version into
CHANGELOG.md - Run
make publish-alland follow the prompts
Running in the browser
If you want to test esbuild in the browser (lets you try out lots of things rapidly), you can:
- Run
make platform-wasmto build the WebAssembly version of esbuild - Serve the repo directory over HTTP (such as with
./esbuild --servedir=.) - Visit
/scripts/try.htmlin your browser