Dev server & watch

Development server, static server and watch mode.

#

Three related commands share the same build engine but differ in what they do with it.

guchho dev

#

A development server with file watching and automatic rebuilds.

guchho dev --port=8080 --open
guchho dev --host=0.0.0.0

Options: --host (default localhost), --port (default 3000), --open, plus the build flags below them.

guchho serve

#

Serve already-built output, without rebuilding.

guchho serve
guchho serve dist --port=8080

Options: --host, --port, --open. Nothing rebuilds; the directory defaults to the build's output directory.

guchho watch

#

Watch and rebuild without a server. Use this when whatever reads the output is not a browser.

guchho watch src/index.html
guchho watch --outdir=dist

Options are the same as guchho build.

Watch behaviour

#
  • watch in a config - true means "build and keep watching".
  • server in a config - the dev server reads its options from the configuration's server section.

The JavaScript API exposes the same watcher and dev server as watch() and serve(), returning a Watcher / DevServer you can rebuild and stop programmatically.

Edit this page on GitHub