Skip to content

Commit eda9162

Browse files
Matsuuuwraithgar
authored andcommitted
docs: Add --if-present flag documentation to workspaces
PR-URL: #3715 Credit: @Matsuuu Close: #3715 Reviewed-by: @wraithgar
1 parent 64f7d1a commit eda9162

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)