Skip to content

Commit f8a5653

Browse files
committed
docs: Add --if-present flag documentation to workspaces
1 parent d6c651c commit f8a5653

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/content/using-npm/workspaces.md

+10
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,16 @@ npm run test --workspaces
176176

177177
Will run the `test` script in both `./packages/a` and `./packages/b`.
178178

179+
### Ignoring missing scripts
180+
181+
It is not required for all of the workspaces to implement scripts run with the `npm run` command.
182+
183+
By running the command with the `--if-present` flag, npm will ignore workspaces missing target script.
184+
185+
```
186+
npm run test --workspaces --if-present
187+
```
188+
179189
### See also
180190

181191
* [npm install](/commands/npm-install)

0 commit comments

Comments
 (0)