Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatsuuu <huhta.matias@gmail.com>2021-09-03 09:01:08 +0300
committerGar <gar+gh@danger.computer>2021-09-08 23:29:23 +0300
commiteda9162f2db19b512d3af6b0d43201d54045c13a (patch)
treee6d5c816fb59fee2c2966be4dae0451117f47d12
parent64f7d1a55db99b1aaf8fb59557b3dedcdcd954a0 (diff)
docs: Add --if-present flag documentation to workspaces
PR-URL: https://github.com/npm/cli/pull/3715 Credit: @Matsuuu Close: #3715 Reviewed-by: @wraithgar
-rw-r--r--docs/content/using-npm/workspaces.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/content/using-npm/workspaces.md b/docs/content/using-npm/workspaces.md
index 7cc125b3c..ae834c0cc 100644
--- a/docs/content/using-npm/workspaces.md
+++ b/docs/content/using-npm/workspaces.md
@@ -176,6 +176,16 @@ npm run test --workspaces
Will run the `test` script in both `./packages/a` and `./packages/b`.
+### Ignoring missing scripts
+
+It is not required for all of the workspaces to implement scripts run with the `npm run` command.
+
+By running the command with the `--if-present` flag, npm will ignore workspaces missing target script.
+
+```
+npm run test --workspaces --if-present
+```
+
### See also
* [npm install](/commands/npm-install)