Skip to content

Commit

Permalink
chore(docs): add lerna watch -- build --include-dependents example (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
fahslaj committed Feb 3, 2023
1 parent 1fe6188 commit aea79df
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/lerna/src/commands/watch/README.md
Expand Up @@ -36,6 +36,12 @@ Watch only package "package-4" and its dependencies and run the `test` script fo
$ lerna watch --scope="package-4" --include-dependencies -- lerna run test --scope=\$LERNA_PACKAGE_NAME
```

Watch all packages and run the `build` script for the package that changed and all packages that depend on it:

```sh
$ lerna watch -- lerna run build --scope=\$LERNA_PACKAGE_NAME --include-dependents
```

When using `npx`, the `-c` option must be used if also providing variables for substitution:

```sh
Expand Down
6 changes: 6 additions & 0 deletions website/docs/features/workspace-watching.md
Expand Up @@ -46,6 +46,12 @@ Watch a single package and its dependencies, running the "build" script on any o
$ lerna watch --scope="my-package-1" --include-dependencies -- lerna run build --scope=\$LERNA_PACKAGE_NAME
```

Watch all packages and run the `build` script for the package that changed and all packages that depend on it:

```sh
$ lerna watch -- lerna run build --scope=\$LERNA_PACKAGE_NAME --include-dependents
```

For more advanced filtering, see the [filter options](https://lerna.js.org/docs/api-reference/commands#filter-options) documentation. For more available options, see the [`lerna watch`](https://github.com/lerna/lerna/tree/main/packages/lerna/src/commands/watch#lerna-watch) documentation.

## Watch Environment Variables
Expand Down

0 comments on commit aea79df

Please sign in to comment.