Development Server
Process orchestration, file watching, and multi-process dev mode via telaio dev.
Development Server
pnpx telaio devtelaio dev starts the application in development mode. It orchestrates multiple processes, watches the filesystem for changes, and restarts processes when relevant files are modified.
Peer dependencies
telaio dev requires two peer dependencies:
pnpm add -D concurrently @parcel/watcherconcurrently manages multiple child processes with labeled output. @parcel/watcher provides native filesystem watching with low overhead.
Configuration
Configure dev in your telaio.config.ts:
import { defineConfig } from 'telaio';
export default defineConfig({
dev: {
processes: [
{ name: 'worker', command: 'node src/worker.ts', prefixColor: 'cyan' },
{ name: 'scheduler', command: 'node src/scheduler.ts', prefixColor: 'yellow' },
],
watch: {
include: ['config/**', '.env'],
ignore: ['*.test.ts', 'dist/**'],
debounceMs: 500,
},
output: 'dev.log',
},
});ProcessConfig
Each entry in processes describes an additional process to run alongside the main server.
| Option | Type | Description |
|---|---|---|
name | string | Label shown in the combined output |
command | string | Shell command to run |
prefixColor | string | Color for the process label in terminal output |
WatchConfig
| Option | Type | Description |
|---|---|---|
include | string[] | Additional glob patterns to watch beyond the defaults |
ignore | string[] | Glob patterns to exclude from watching |
debounceMs | number | Milliseconds to wait after a change before restarting. Default: 300 |
output
When output is set to a file path, the combined log output from all processes is written to that file in addition to stdout. Useful for capturing dev session logs.
What gets watched
By default, telaio dev watches:
src/**telaio.config.ts.envand.env.*
Paths in watch.include are added to this set. Paths in watch.ignore are excluded.
Process lifecycle
On startup, all configured processes are launched in parallel. When a watched file changes:
- All child processes receive
SIGTERM - After a short drain period, they are killed if still running
- All processes restart with the same command
The main Telaio server is always included as one of the managed processes. Additional entries in processes are extra workers, queue consumers, or any other long-running Node process your app needs.
For the queue consumer specifically, prefer using telaio consumer in a separate terminal or Docker container rather than adding it to dev.processes. This keeps the consumer lifecycle independent and matches how you would run it in production.