From acd9bb77483f228fb54bb4c6b097b5e880dee5b0 Mon Sep 17 00:00:00 2001 From: Alice Kile Date: Tue, 30 Jul 2024 00:08:31 +0200 Subject: [PATCH] docs(core): document wildcard support for dependsOn field (#27029) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Current Behavior This feature is not yet documented... ## Expected Behavior Document wildcard support in `dependsOn` field for project configurations. Note: Reading through the PR below that impls. this wildcard support, I couldn't quite figure out if it was actually able to also work in case of object syntax and whether this will also work for `targetDefaults`... so if you know any better, please lemme know so I can update this PR 🙏 ## Related Issue(s) documents #19611 --- .../shared/reference/project-configuration.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/shared/reference/project-configuration.md b/docs/shared/reference/project-configuration.md index 19a10e36fc494..83c5af40b768f 100644 --- a/docs/shared/reference/project-configuration.md +++ b/docs/shared/reference/project-configuration.md @@ -440,6 +440,27 @@ You can also express task dependencies with an object syntax: {% /tab %} {% /tabs %} +Starting from v19.5.0, wildcards can be used to define dependencies in the `dependsOn` field. + +```json +{ + "targets": { + "test": { + "dependsOn": [ + { + "target": "build", // target name + "params": "ignore" // "forward" or "ignore", defaults to "ignore" + }, + "build-*", // support for using wildcards in dependsOn, matches: "build-css", "build-js" targets of current project + "^build-*", // matches tasks: "build-css", "build-js" targets of dependencies + "*build-*", // matches tasks: "build-css", "build-js" as well as "task-with-build-in-middle" targets of current project + "^*build-*" // matches tasks: "build-css", "build-js" as well as "task-with-build-in-middle" targets of dependencies + ] + } + } +} +``` + #### Examples You can write the shorthand configuration above in the object syntax like this: