From f8a56530a697359adfcdf76787056cc7688fe9df Mon Sep 17 00:00:00 2001 From: Matsuuu Date: Fri, 3 Sep 2021 09:01:08 +0300 Subject: [PATCH] docs: Add --if-present flag documentation to workspaces --- docs/content/using-npm/workspaces.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/content/using-npm/workspaces.md b/docs/content/using-npm/workspaces.md index 7cc125b3c7a7c..ae834c0cc7e22 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)