Say exactly which tasks to run
Two questions decide every run: what does each task need first, and which projects should this run touch? vx answers the first in dependsOn and the second in --filter . Both are small languages, and both fit on one screen. What a task needs: dependsOn // packages/web/vx.config.ts import { defineProject } from ' @vzn/vx/config ' export default defineProject ({ tasks : { build : { exec : { command…
To execute a task in vx, you must first determine what each task requires and which projects the run should touch. The tasks are defined in the dependsOn field, which lists the tasks that must be completed before the current task can run. The projects to include can be specified using the --filter command, which supports various syntaxes such as names, globs, glob patterns, folders, tags, and exclusions.
For example, $ vx run build --filter @demo/ui would run the build task for the ui package and all its dependent projects. If a task does not have an exec field, it is considered a group and will run its dependencies without performing any other actions. A typo in a selector will cause the run to stop and list the available tasks.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.