Skip to content

Commit

Permalink
docs: Add --if-present flag documentation to workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Matsuuu committed Sep 3, 2021
1 parent d6c651c commit f8a5653
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/content/using-npm/workspaces.md
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 f8a5653

Please sign in to comment.