Skip to content

Commit

Permalink
docs: Add --if-present flag documentation to workspaces
Browse files Browse the repository at this point in the history
PR-URL: #3715
Credit: @Matsuuu
Close: #3715
Reviewed-by: @wraithgar
  • Loading branch information
Matsuuu authored and wraithgar committed Sep 8, 2021
1 parent 64f7d1a commit eda9162
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/content/using-npm/workspaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit eda9162

Please sign in to comment.