Dev servers
A persistent task is a server or watcher. Its dependents start once it
prints a line matching readyWhen; if none comes, exec.timeout fails it.
import { defineProject } from '@vzn/vx/config'
export default defineProject({ tasks: { dev: { exec: { command: 'vite', persistent: { readyWhen: 'Local:' }, timeout: '30s' }, }, e2e: { dependsOn: ['dev'], exec: { command: 'playwright test' }, inputs: { files: ['e2e/**'], tasks: [] }, // dev is for order, not the key cache: { outputs: { files: ['playwright-report/**'] } }, }, },})vx run e2evx run e2e starts vite, waits for Local:, runs playwright test,
then stops the server.
Stopping
Section titled “Stopping”When the run ends, vx sends the server SIGTERM; one still alive after a
2-second grace is SIGKILLed. A persistent task has no cache block. A sandboxed server
on Linux lists its port in sandbox.allow.localBinding.
To re-run tasks as files change, see vx watch.